From 39911cad181a168b917b67fb2963e8ebb942210c Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 8 Mar 2011 22:25:53 +0100 Subject: Prevent unnecessary reloading of KDirLister on startup When Dolphin is started with a directory as argument unnecessary reload operations of KDirListers are done. The patch improves this by just letting the DolphinView internally do a loading as soon as it gets visible (and without reloading). Also in case if only one directory is passed as argument the current tab gets reused instead of creating new tabs and removing the current tab. Thanks a lot to David Faure for pointing out this unefficient handling. --- src/dolphinmainwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index c50a42a40..e0f6019c0 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -163,6 +163,11 @@ void DolphinMainWindow::openDirectories(const QList& dirs) return; } + if (dirs.count() == 1) { + m_activeViewContainer->setUrl(dirs.first()); + return; + } + const int oldOpenTabsCount = m_viewTab.count(); const GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings(); @@ -419,7 +424,6 @@ void DolphinMainWindow::openNewTab(const KUrl& url) viewTab.primaryView = new DolphinViewContainer(url, viewTab.splitter); viewTab.primaryView->setActive(false); connectViewSignals(viewTab.primaryView); - viewTab.primaryView->view()->reload(); m_viewTab.append(viewTab); @@ -1307,7 +1311,6 @@ void DolphinMainWindow::init() m_activeViewContainer = m_viewTab[m_tabIndex].primaryView; connectViewSignals(m_activeViewContainer); DolphinView* view = m_activeViewContainer->view(); - view->reload(); m_activeViewContainer->show(); m_actionHandler->setCurrentView(view); @@ -1924,7 +1927,6 @@ void DolphinMainWindow::createSecondaryView(int tabIndex) splitter->addWidget(m_viewTab[tabIndex].secondaryView); splitter->setSizes(QList() << newWidth << newWidth); connectViewSignals(m_viewTab[tabIndex].secondaryView); - m_viewTab[tabIndex].secondaryView->view()->reload(); m_viewTab[tabIndex].secondaryView->setActive(false); m_viewTab[tabIndex].secondaryView->show(); } -- cgit v1.3