Fix Bug 310465 - Can't switch view mode for non-writable paths
Review Request #107458 - Created Nov. 25, 2012 and submitted
Fix Bug 310465 - Can't switch view mode for non-writable paths Check also if the .directory file is writable, not only the parent folder.
Tested with: 1. Not-Writable Folder 2. Not-Writable .directory File but writable Folder 3. Writable Folder and writable .directory File (Normal case) Works fine for me in all three cases ;)
Review request changed
Check if the Folder is writable -> If writable: Check if the ".directory" File exists and is writable Previous patch introduced a regression with folders, without ".directory" files. (It worked but the View Settings were not saved in the right folder - Dolphin handled them like non-writable folders)
Revision 2 (+5 -3)
Thanks Emmanuel for this patch! Looks good, just one little thing that I found out accidentally when testing this: the same bug happens if the .directory file is writable, but not readable. This may not be a very common use case, but I'd say that we better get rid of this issue once and for all now that we're looking at it. Changing the condition (fileInfo.exists() && !fileInfo.isWritable()) to (fileInfo.exists() && !(fileInfo.isReadable() && fileInfo.isWritable())) fixes that for me. If you agree that this makes sense, please include it in your commit. Moreover, it won't hurt to mention the bug number in the comment, just to make sure that anyone wondering in the future what this is about knows where to look.