Bug 318534

Summary: Can't change view mode on external devices
Product: [Applications] dolphin Reporter: Gandalf Lechner <gandalflechner>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: emmanuelpescosta099
Priority: NOR    
Version: 2.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.11.0
Sentry Crash Report:

Description Gandalf Lechner 2013-04-18 07:03:43 UTC
After a recent update, I cannot change the view mode on external devices (USB connected hard disk) any more. I can write to the device, and there is no .directory file in the path I am looking at. However, when selecting a different view mode, like details view for example, only the icon in the menu bar of dolphin becomes selected, but the actual view stays in "icon mode" (if that is the right name for that mode where you see the icons of the files in a grid). This bug does not appear in folders on my internal hard disk.

Reproducible: Always

Actual Results:  
Cannot change view mode

Expected Results:  
Can change view mode
Comment 1 Frank Reininghaus 2013-04-23 17:50:43 UTC
Thanks for the bug report, but I cannot reproduce the problem.

1. What is the file system of the external device?
2. What "recent update" are you referring to, i.e., what is the last known good version, and which is the bad one?
Comment 2 Gandalf Lechner 2013-04-23 21:16:50 UTC
I saw this so far on devices with vfat and ext4 filesystems. Unfortunately I cannot be too precise about the "recent update". I am using the KDE 4.10.2 packages provided by Kubuntu in their 13.04 branch. About a week ago it was fine, now I see the mentioned problem.

What I now saw is that when I open dolphin as root, the view modes can be changed as usual. But as regular user it doesn't work, indepdendently of write permissions. Also deleting the .directory file didn't change this.
Comment 3 Emmanuel Pescosta 2013-06-10 22:11:36 UTC
I cannot reproduce this bug in Dolphin 2.2/2.3

Tested with a usb stick (vfat filesystem) - works fine as root and as normal user.

@Gandalf:
Does Dolphin create a .directory file for your device? - Can you please have a look at "/home/$USER/.kde4/share/apps/dolphin/view_properties/local/run/$USER/{Name of your device}/" if there is any .desktop file with your view properties? Thanks

For example the .desktop file for my usb stick:
     [Dolphin]
     Timestamp=2013,6,11,0,5,20
     Version=3
     ViewMode=2          (hint: 1 ... details view, 2 ... compact view, 3 ... icon view mode)

     [Settings]
     HiddenFilesShown=true
Comment 4 Frank Reininghaus 2013-06-20 15:06:11 UTC
@Gandalf: Emmanuel did some analysis, see https://git.reviewboard.kde.org/r/111120/.

Could you check if you have write permissions for all directories inside .kde4/share/apps/dolphin/view_properties/local? This is where Dolphin tries to store the view mode for external devices.

If that is the case, please try to give yourself write permissions for all these directories and check if that helps. Thanks.
Comment 5 Gandalf Lechner 2013-06-21 08:00:25 UTC
I now checked again; currently I also cannot see the described bug behaviour. Due to a bad crash I had to reinstall kubuntu (with KDE 4.10.4 now), and the changing of view modes works fine as it should. I also have write permissions to the directories you mentioned - maybe that was messed up in my last installation.
Comment 6 Frank Reininghaus 2013-06-21 10:44:29 UTC
Thanks for the quick reply. It seems that a lack of write permissions is the only obvious reason why such a thing could happen. We'll try to fix that, such that changing the view mode always does change the view mode, even if storing the new settings on disk fails.
Comment 7 Frank Reininghaus 2013-06-22 07:29:27 UTC
Git commit 4e80918a446bb91d12763cc1eefc12b85b172652 by Frank Reininghaus.
Committed on 22/06/2013 at 07:27.
Pushed by freininghaus into branch 'master'.

Make sure that changing the view mode does not fail

This commit ensures that changing the view mode works even if the
.directory file in the user's KDE folder is not writable.
FIXED-IN: 4.11.0
REVIEW: 111120

M  +11   -4    dolphin/src/views/dolphinview.cpp
M  +8    -1    dolphin/src/views/dolphinview.h

http://commits.kde.org/kde-baseapps/4e80918a446bb91d12763cc1eefc12b85b172652