┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2013-10-26 09:30:18 +0200
committerFrank Reininghaus <[email protected]>2013-10-26 09:30:18 +0200
commit70cd04df40b152fd7a448964b9f9ca4948291eb3 (patch)
treedc23f77283b149ef0a6953fefffd413e5979ae35 /src
parent76ae282ad9ad4ff9db0b7566df3c6058b38e64e6 (diff)
parentf55119945f0edc369b53c64b45ae117dc73ff426 (diff)
Merge remote-tracking branch 'origin/KDE/4.11'
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp15
-rw-r--r--src/dolphinmainwindow.h7
-rw-r--r--src/dolphinviewcontainer.cpp4
3 files changed, 21 insertions, 5 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index d8973053c..0804f4be9 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -1421,6 +1421,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);
@@ -1753,7 +1766,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)),
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index 7da5801ff..6b046c2ea 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -466,6 +466,13 @@ private slots:
*/
void slotPanelErrorMessage(const QString& error);
+ /**
+ * Is called if the user clicked an item in the Places Panel.
+ * Reloads the view if \a url is the current URL already, and changes the
+ * current URL otherwise.
+ */
+ void slotPlaceActivated(const KUrl& url);
+
private:
/**
* Activates the given view, which means that
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index dc51f85f0..cc26198a0 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -372,10 +372,6 @@ void DolphinViewContainer::setUrl(const KUrl& newUrl)
{
if (newUrl != m_urlNavigator->locationUrl()) {
m_urlNavigator->setLocationUrl(newUrl);
- } else if (m_view->itemsCount() == 0) {
- // Maybe a previously unmounted device has been mounted again.
- // Let's reload the view to be safe (see https://bugs.kde.org/show_bug.cgi?id=161385).
- m_view->reload();
}
#ifdef KActivities_FOUND