diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 8 | ||||
| -rw-r--r-- | src/views/dolphinview.cpp | 8 | ||||
| -rw-r--r-- | src/views/dolphinview.h | 1 |
3 files changed, 14 insertions, 3 deletions
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<KUrl>& 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<int>() << newWidth << newWidth); connectViewSignals(m_viewTab[tabIndex].secondaryView); - m_viewTab[tabIndex].secondaryView->view()->reload(); m_viewTab[tabIndex].secondaryView->setActive(false); m_viewTab[tabIndex].secondaryView->show(); } diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 4ab16e052..6108c9d4a 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -768,6 +768,14 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event) return QWidget::eventFilter(watched, event); } +void DolphinView::showEvent(QShowEvent* event) +{ + QWidget::showEvent(event); + if (!event->spontaneous()) { + loadDirectory(url()); + } +} + void DolphinView::activate() { setActive(true); diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 1d1d316ea..48967e62b 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -559,6 +559,7 @@ protected: /** @see QWidget::mouseReleaseEvent */ virtual void mouseReleaseEvent(QMouseEvent* event); virtual bool eventFilter(QObject* watched, QEvent* event); + virtual void showEvent(QShowEvent* event); private slots: /** |
