┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2013-10-26 09:24:04 +0200
committerFrank Reininghaus <[email protected]>2013-10-26 09:24:04 +0200
commitf55119945f0edc369b53c64b45ae117dc73ff426 (patch)
tree848d3f45981b8a73f2a4483bbcbd0dd1f9cfe3e6 /src/dolphinmainwindow.cpp
parent96ba990d865b2dfb966961061ba5154dcd3187b4 (diff)
Fix broken view state restoration
The fix for bug 161385 (which was about Dolphin still showing an empty view if a device that had been unmounted earlier was clicked in the Places Panel) caused a regression: the view state (current item, scroll position, Details View expansion state) was not restored any more when going "Back". The reason is that "m_view->reload()" in DolphinViewContainer::setUrl(const KUrl& newUrl) was always executed just after entering a directory, and that command overwrites this information. Distinguishing between "change URL" and "reload the view" works better if it's done in DolphinMainWindow instead of DolphinViewContainer. BUG: 326039 FIXED-IN: 4.11.3 REVIEW: 113290
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index ccef356ea..9da73f96e 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -1417,6 +1417,19 @@ void DolphinMainWindow::slotPanelErrorMessage(const QString& error)
activeViewContainer()->showMessage(error, DolphinViewContainer::Error);
}
+void DolphinMainWindow::slotPlaceActivated(const KUrl& url)
+{
+ DolphinViewContainer* view = activeViewContainer();
+
+ if (view->url() == url) {
+ // We can end up here if the user clicked a device in the Places Panel
+ // which had been unmounted earlier, see https://bugs.kde.org/show_bug.cgi?id=161385.
+ reloadView();
+ } else {
+ changeUrl(url);
+ }
+}
+
void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContainer)
{
Q_ASSERT(viewContainer);
@@ -1749,7 +1762,7 @@ void DolphinMainWindow::setupDockWidgets()
addDockWidget(Qt::LeftDockWidgetArea, placesDock);
connect(placesPanel, SIGNAL(placeActivated(KUrl)),
- this, SLOT(changeUrl(KUrl)));
+ this, SLOT(slotPlaceActivated(KUrl)));
connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)),
this, SLOT(openNewTab(KUrl)));
connect(placesPanel, SIGNAL(errorMessage(QString)),