]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Reload the view if a previously unmounted device is mounted again
authorFrank Reininghaus <frank78ac@googlemail.com>
Mon, 7 Oct 2013 07:17:48 +0000 (09:17 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Mon, 7 Oct 2013 07:17:48 +0000 (09:17 +0200)
The problem was that DolphinViewContainer::setUrl(newUrl) was ignored
if newUrl is equal to the URL which is shown in the view already.

The new approach is to reload the view in that method if it is empty, to
make sure that we do not miss that a previously unmounted device has
been re-mounted.

Thanks to Grigoriadis Grigoris for analyzing the root cause of this
issue!

BUG: 161385
FIXED-IN: 4.11.3

src/dolphinviewcontainer.cpp

index e7c571294be20f9ae13681be58a1de1f36762e62..c8fc757ba700252a9fc141a0e14ef7235132a0af 100644 (file)
@@ -372,6 +372,10 @@ 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