Bug 177474

Summary: Documents path in About me panel is not stored
Product: [Applications] systemsettings Reporter: Martin van Es <bugs>
Component: kcm_useraccountAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: a.samirh78, faure, lydia, moray, omega7, sitter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: some debug output

Description Martin van Es 2008-12-11 10:03:03 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

After setting the 'Docoments path' in the 'About me' panel (systemsettings) the value is always reset to $HOME/Documents.
Comment 1 Martin van Es 2008-12-17 22:33:39 UTC
Fixed in 4.1.85
Comment 2 Martin van Es 2008-12-17 23:22:58 UTC
Not fixed, because it's back after logout/login.
Comment 3 Lydia Pintscher 2009-01-17 15:30:48 UTC
Yes I can confirm this here with 4.2 RC1. It does not get saved. Very annoying. Please someone fix this for 4.2.
Comment 4 Harald Sitter 2009-01-17 16:37:44 UTC
Well, I don't think this can make it for 4.2, to resolve this properly a general make over needs to be done.

I guess (that is without looking at the source) there is a bigger problem than it just not storing the value. KDELibs is now using the Desktop, Autostart, Documents and other addition paths (like for example Music) as defined by the xdg-user-dirs config (accessed via Qt's implementation).
It might be possible that the KCM simply doesn't edit and/or read the values from the appropriate xdg config, and thus the value doesn't get remembered. There is clearly some mixing between the former (kde-only) implementation and the current XDG implementation going on.
In any case the KCM should be changed to show all supported paths. :)
Comment 5 David Faure 2009-01-19 17:06:19 UTC
Hmm I think I fixed this in r908359 (trunk).
Seems to work here.
(I didn't try logout+login, but launching `kcmshell4 desktoppath` shows the new value again, that should be enough).

r908359 was mostly about adding other paths to that GUI, but I also cleaned up the code a little bit. So I'm not 100% sure it fixed this, but at least it works here. Can someone who had the bug, retest with trunk?
Comment 6 Martin van Es 2009-08-23 13:35:48 UTC
This bug is not fixed in 4.3.0.
Comment 7 David Faure 2009-08-27 16:52:02 UTC
Works here. Please investigate why it doesn't work for you. After you change the value, is ~/.config/user-dirs.dirs updated?
For those who compile from sources, can you apply the attached patch and look at the debug output of  
   kcmshell4 desktoppath
when making the change there?
Comment 8 David Faure 2009-08-27 16:52:29 UTC
Created attachment 36503 [details]
some debug output
Comment 9 Martin van Es 2009-08-27 21:22:10 UTC
I can confirm that ~/.config/user-dirs.dirs is updated and contains the correct (changed) paths. After loging out (which is not a completely correct logout due to bug #191034) and thus landing at the prompt this file still contains the changed paths.
Immediately after logging in again (after restarting kdm) however, the file is updated and contains the old paths again.
Comment 10 David Faure 2009-08-28 02:21:04 UTC
Huh. That means that the systemsettings module works fine, it's something else which is re-writing the users-dirs.dirs file. Maybe some script from your distro? Can you investigate who/what is touching the file?

Techniques:
1) making it readonly and looking for errors in .xsession-errors (but this assumes proper error handling in the guilty code ;-)
2) starting kde in failsafe mode. checking that the file is still ok. Then doing a 
   strace -f -ff -o /tmp/startkde startkde
and checking in /tmp/startkde.* if anything is writing to users-dirs.dirs.
Comment 11 Martin van Es 2009-09-03 21:20:19 UTC
Firstly, the distro that's fidling with my .config/user-dirs.dirs file is Ubuntu Jaunty.

The first test you describe is negative. I changed the rights of the user-dirs.dirs file to 400 (-r-----) but after login in it's 600 again and contains the old configuration, like described in the bug.

The second test is frustrating: starting KDE that way doesn't change the file and so there's no process in /tmp/startkde.* that touches it.
Comment 12 omega7 2009-10-14 02:07:54 UTC
This was happening to me.  I just figured out that it's the quotes!  When you change the path in the desktoppath module, it updates ~/.config/user-dirs.dirs, but does not put quotes around the path.  The next time xdg-user-dirs-update runs, it recreates the default path and rewrites user-dirs.dirs.  If the path is wrapped in double-quotes, this does not happen.
Comment 13 David Faure 2009-10-15 17:12:58 UTC
Fixed by Lubos today in r1035639
Comment 14 Moray Guise 2009-10-22 12:29:29 UTC
I'm using Mandriva 2009.1, and the directory $HOME/Documents was created for me on each login.  I couldn't follow the instructions in David Faure's comment #10.  But omega7's workaround works for me - excellent, thank you all!
Comment 15 Dario Andres 2009-10-23 15:11:16 UTC
*** Bug 211464 has been marked as a duplicate of this bug. ***
Comment 16 Ahmad Samir 2009-10-23 15:38:00 UTC
I beg to differ, but this doesn't seem to be fixed in kde4.3.2, bug 211464 has been marked as a duplicate of this one but my test case here: https://bugs.kde.org/show_bug.cgi?id=211464#c0
is still valid, the new Path isn't enclosed in " " marks and so on log in xdg-user-dirs-update reverts ~/.config/user-dirs.dirs to its default config file, my guess is it nukes the whole file.
Comment 17 David Faure 2009-10-24 00:37:03 UTC
I didn't say the fix was in 4.3.2.

r1035639 is for 4.3.3.
Comment 18 Ahmad Samir 2009-10-24 00:43:46 UTC
I see, thanks for the clarification. (and sorry for the noise :-/)