From: Peter Penz Date: Tue, 25 Sep 2007 11:06:54 +0000 (+0000) Subject: clear columns if the new URL is no parent of the currently shown columns X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/991df9c857d5f69ebec4d9ed5e7f35ab26940ffa clear columns if the new URL is no parent of the currently shown columns svn path=/trunk/KDE/kdebase/apps/; revision=716840 --- 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" diff --git a/src/dolphincolumnview.h b/src/dolphincolumnview.h index 71ac89468..75d07ce07 100644 --- a/src/dolphincolumnview.h +++ b/src/dolphincolumnview.h @@ -142,12 +142,6 @@ private: */ void requestActivation(ColumnWidget* column); - /** - * Deletes all inactive child columns, that are a child of - * the currently active column. - */ - void deleteInactiveChildColumns(); - private: DolphinController* m_controller; bool m_restoreActiveColumnFocus;