Bug 56857 - KPropertiesDialog: should disable "change icon" button when directory is not writeable
Summary: KPropertiesDialog: should disable "change icon" button when directory is not ...
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 3.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-05 01:01 UTC by klee
Modified: 2013-08-25 20:01 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Simple initial patch (2.40 KB, patch)
2009-06-01 16:00 UTC, Dario Andres
Details

Note You need to log in before you can comment on or make changes to this bug.
Description klee 2003-04-05 01:01:37 UTC
Version:            (using KDE KDE 3.1)
Installed from:    Compiled From Sources

Usability bug: the "Properties" dialog allows the user to change the icon for a directory, even when that directory (and hence its .directory file) is not writeable by the current user.  This button should be disabled, or not even present---it should be presented as an ordinary icon, like files.
Comment 1 klee 2004-12-01 05:48:22 UTC
fixed long ago. thanks.
Comment 2 klee 2004-12-01 05:51:44 UTC
ack, sorry, not fixed.
Comment 3 lexual 2005-04-13 03:09:34 UTC
confirming for 3.4.0.

You can't actually change the icon, but you shouldn't be given the impression that you can change the icon.
Comment 4 lexual 2008-01-19 05:47:46 UTC
This is the error message given with kde4:

"Could not save properties. You do not have sufficient access to write to /bin/.directory."
Comment 5 Bui Arantsson 2008-05-03 17:01:17 UTC
while this hasn't been "fixed" in KDE 3.9.5, as soon as you try to actually apply a new icon, you receive the message:

"Could not save properties. You do not have sufficient access to write to /home/guest/.directory."

and although I agree that it may be a bit confusing at first, I this the message given should be sufficient to explain why it isn't a viable option.
Comment 6 Michael Leupold 2008-05-04 19:37:44 UTC
I can confirm this for 3.5.9 and trunk r803905. Maybe this should be made a wish or WONTFIX in case this is the intended behaviour.
Comment 7 Jaime Torres 2008-07-08 16:54:45 UTC
This is a kdelibs bug.

This could be modified, for example, in the KFilePropsPlugin constructor, near the connect( iconButton, ....)

There are three options:

* Only disable it when the user has no possibility to enable write 
rights in the .directory file, ie:
 
The user is not the owner, nor is part of the group and the other rights 
does not contains write right.
 
* Be afraid of the changes in the permissions tab when the directory is writable.

* Do not fix it.
Comment 8 lexual 2009-02-23 01:24:38 UTC
Still current for 4.2
Comment 9 Pino Toscano 2009-02-25 14:45:00 UTC
(In reply to comment #8)
> Still current for 4.2

But no need to change Version, please.
Comment 10 lexual 2009-03-06 11:39:16 UTC
Pino, I'm a little confused.

Isn't useful information to know that a bug is still relevant, and can be reproduced against the 4.x series.
Comment 11 Matt Rogers 2009-03-07 04:59:12 UTC
the version field is the original version the report was against, and should generally remain static.
Comment 12 Dario Andres 2009-06-01 15:51:40 UTC
I'm preparing a rather simple initial implementation about this. With simple initial permissions checks.
IIRC, Dolphin now uses a "local database" for storing directory view configuration is the directory is not writable. So, even if that case, the icon button could be enabled and the icon value saved to that local writable database.
@Peter: is this right ?
Comment 13 Dario Andres 2009-06-01 16:00:50 UTC
Created attachment 34169 [details]
Simple initial patch

We need to discuss about the possibility of writing "local" .directory files for folders without write permissions and any other possible situations.
I also thought about using KDirWatcher to monitor (external) permissions changes and update the icon button status
Comment 14 David Faure 2009-11-13 21:11:59 UTC
I don't like the use of NetAccess (nested event loop). If you have a KFileItem already as input, just use its mostLocalUrl() member function.

I'm not sure we really need to distinguish between "the .directory file exists, do we have write permissions to modify it", and "it doesn't exist, can we write into the parent dir". If it exists and is readonly, we can always delete+recreate it, if we have write permissions in the parent dir ;-) So the last test (directory is writable) is enough (and saves us from all the "KFileItem internalItem" code).
Comment 15 David Faure 2010-02-25 19:32:05 UTC
SVN commit 1096074 by dfaure:

Don't show an icon button if the icon cannot be changed (directory or .desktop file not writable).
(This looks better than disabling the button as the patch in the BR suggested; this way we still
see the icon in full colors, rather than grayed out)
CCBUG: 56857


 M  +18 -3     kpropertiesdialog.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1096074
Comment 16 David Faure 2010-02-25 19:34:13 UTC
SVN commit 1096076 by dfaure:

Don't show an icon button if the icon cannot be changed (directory or .desktop file not writable).
KDE-3.1 bug from 2003, fixed for 4.4.1 in 2010, it's never too late ;)
BUG: 56857


 M  +18 -3     kpropertiesdialog.cpp  
 M  +1 -0      kpropertiesdialog_p.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1096076
Comment 17 Minh Ngo 2013-08-25 20:01:06 UTC
Bad fix. At the moment user must open a Create dialog twice:
- first for creating a desktop file for example
- and then for changing an icon

Because the default path is in the system directory ( /usr/share/kde4/templates/.source/Program.desktop )