Bug 161385

Summary: Dolphin doesn't update automatically a unmounted/mounted resource
Product: [Applications] dolphin Reporter: Davide Ferrari <vide80>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: adrian, amantia, d.account, eddiefullmetal, emmanuelpescosta099, frank78ac, ivan.pessotto, markg85, sven.burmeister
Priority: NOR    
Version: 2.1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.11.3
Sentry Crash Report:
Attachments: Proposed patch

Description Davide Ferrari 2008-04-28 20:50:01 UTC
Version:            (using Devel)
Installed from:    Compiled sources

How to reproduce.
Mount a resource/device present in the Places panel (a disk partition, for example). Select the device by clicking on it. Content is showed correctly in the files view. RMB the device, and click "Unmount". Device is unmounted, files view shows no content, mounted emblem is remove. Everything ok. Now, click again on the device entry in the place panel. Device is mounted (emblem is showed) but no content present in the files view. You have to press F5 to get the content showed correctly.
Comment 1 Peter Penz 2008-06-07 14:15:02 UTC
SVN commit 818005 by ppenz:

Fixed the following Information Panel issues:
* Trash icon is not updated when trash has been emptied or got filled.
* When renaming an item the old name will be shown in the Information Panel.
* When unmounting media, still the mounted icon is shown.

BUG: 161385
BUG: 153514
BUG: 154747
CCBUG: 159366

 M  +65 -3     infosidebarpage.cpp  
 M  +6 -0      infosidebarpage.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=818005
Comment 2 Davide Ferrari 2008-06-08 22:41:51 UTC
Thanks :)
Comment 3 Davide Ferrari 2008-06-09 09:38:27 UTC
I'm sorry but the bug is still present as of today's SVN.
Comment 4 Peter Penz 2008-06-09 10:01:24 UTC
> I'm sorry but the bug is still present as of today's SVN. 

Ah, my fault: The SVN commit fixed only the Information Panel stuff. 
Comment 5 Davide Ferrari 2008-08-19 18:27:23 UTC
peter, any news about this bug? It still happens in KDE 4.1.0
Comment 6 Peter Penz 2008-08-19 21:12:43 UTC
Sorry, no news yet. There are currently 153 open bugs and and 135 open wish reports, so it might take a while... But I did not forget about this issue :-)
Comment 7 Frank Reininghaus 2009-05-03 22:49:33 UTC
*** Bug 191520 has been marked as a duplicate of this bug. ***
Comment 8 Frank Reininghaus 2010-01-19 13:46:48 UTC
*** Bug 223342 has been marked as a duplicate of this bug. ***
Comment 9 Dario Andres 2010-02-21 16:32:49 UTC
*** Bug 158932 has been marked as a duplicate of this bug. ***
Comment 10 Mark 2010-09-19 03:03:07 UTC
Any update on this one, Peter?
Comment 11 Matthias Fuchs 2011-06-03 00:28:32 UTC
This problem is also present in the kde open dialog.
So I think the best way to fix this would probably be in the KDirModel. Though 
I am not sure on that.

Essentially as it looks to me the main problem is that the KDirWatcher -- or 
what it is called -- gets removed on unmounting, thus it does not recognise 
that the directory is recreated/changes later on.
Comment 12 Ivan Pessotto 2012-04-28 12:47:57 UTC
I'm on Gentoo with KDE 4.8.1 on x86 and this bug still exist.

When I unmount and the remount the same USB memory device, dolphin don't show the content until I manually refresh it.
Comment 13 Mark 2012-04-28 18:01:40 UTC
I still see this issue from time to time on KDE 4.8.2
There seems to be no difference between local folders or networks folders.

I did notice this happening when i was extracting files using ark or when extracting something from the command line. Just an observation, it doesn't seem to happen every single time.
Comment 14 Jeroen van Meeuwen (Kolab Systems) 2012-08-24 16:18:25 UTC
Resetting assignee to default as per bug #305719
Comment 15 Grigoriadis Grigoris 2012-10-26 18:12:15 UTC
I can still replicate this issue on Kubuntu with KDE 4.9.2
Steps:
1. Open dolphin and insert usb stick
2. Click on the removable drive from the places panel, its contents are displayed
3. On the places panel right click on the removable drive and select "Safely remove 'xxx'", Dolphin stays in the same directory and no files are displayed
4. Re-insert the usb, the removable drive appears in the places panel
5. Click on the removable drive, still no files are displayed

I checked the source code and i found that DolphinViewContainer::setUrl(const KUrl& newUrl) checks if the given url is the same with the current url and doesn't call the setLocationUrl (even if it did KUrlNavigator will perform the check in the setLocationUrl method). So the DolphinView::setUrl(const KUrl& url) which loads the directory is never called.
Comment 16 Frank Reininghaus 2013-09-26 21:52:16 UTC
Created attachment 82503 [details]
Proposed patch

Thanks for the good step-by-step instructions and the analysis of the code!

Sorry for the very late reply - we just have far too many bug reports (more than 400 new ones were reported since your comment)  to give each one the attention it deserves. However, the number of open reports has been decreasing constantly during the last year, thanks to helpful comments like yours which make it easier to find out what the root cause of a bug is (if you know what part of the code to look at, most of the work is done already).

The attached patch fixes the problem for me. I'll test it a bit more, and I'd also appreciate if anyone else who might test it reports any problems with the patch. Thanks.
Comment 17 Emmanuel Pescosta 2013-10-04 11:59:07 UTC
I tested your patch, but I haven't found any problems so far - A "ship it" from my side.
Comment 18 Frank Reininghaus 2013-10-07 07:21:42 UTC
Git commit 7f8dca1b806efd18fe8ebb9f5cc574a0c0550c88 by Frank Reininghaus.
Committed on 07/10/2013 at 07:17.
Pushed by freininghaus into branch 'KDE/4.11'.

Reload the view if a previously unmounted device is mounted again

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!
FIXED-IN: 4.11.3

M  +4    -0    dolphin/src/dolphinviewcontainer.cpp

http://commits.kde.org/kde-baseapps/7f8dca1b806efd18fe8ebb9f5cc574a0c0550c88