From 991df9c857d5f69ebec4d9ed5e7f35ab26940ffa Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 25 Sep 2007 11:06:54 +0000 Subject: clear columns if the new URL is no parent of the currently shown columns svn path=/trunk/KDE/kdebase/apps/; revision=716840 --- src/dolphincolumnview.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/dolphincolumnview.cpp') diff --git a/src/dolphincolumnview.cpp b/src/dolphincolumnview.cpp index f8bcf548e..119888f2d 100644 --- a/src/dolphincolumnview.cpp +++ b/src/dolphincolumnview.cpp @@ -506,7 +506,18 @@ void DolphinColumnView::showColumn(const KUrl& url) { const KUrl& rootUrl = m_columns[0]->url(); if (!rootUrl.isParentOf(url)) { - // the URL is no child URL of the column view, hence do nothing + // the URL is no child URL of the column view, hence clear all columns + // and reset the root column + QList::iterator start = m_columns.begin() + 1; + QList::iterator end = m_columns.end(); + for (QList::iterator it = start; it != end; ++it) { + (*it)->deleteLater(); + } + m_columns.erase(start, end); + m_index = 0; + m_columns[0]->setActive(true); + m_columns[0]->setUrl(url); + assureVisibleActiveColumn(); return; } @@ -870,14 +881,4 @@ void DolphinColumnView::requestActivation(ColumnWidget* column) } } -void DolphinColumnView::deleteInactiveChildColumns() -{ - QList::iterator start = m_columns.begin() + m_index + 1; - QList::iterator end = m_columns.end(); - for (QList::iterator it = start; it != end; ++it) { - (*it)->deleteLater(); - } - m_columns.erase(start, end); -} - #include "dolphincolumnview.moc" -- cgit v1.3