! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xdg user directory compatibility patch
Status:
RESOLVED: FIXED
Product:
Xfce4-places-plugin
Component:
General

Comments

Description Andrea Santilli 2008-10-10 09:07:52 CEST
Created attachment 1877 
patch for places plugin

I opened this bug report some time ago, proposing a solution for thunar and xfdesktop: http://bugzilla.xfce.org/show_bug.cgi?id=4365

The patches are about having xfce support the xdg user directories. Right now the xfdesktop patch has already been committed to svn.

We need the places plugin to be compatible too and I guess this is just about changing the directory for the desktop menu entry.

Here is the patch
Comment 1 Christian Dywan 2008-10-10 12:40:02 CEST
(In reply to comment #0)
> Created an attachment (id=1877) [details]
> patch for places plugin
> 
> I opened this bug report some time ago, proposing a solution for thunar and
> xfdesktop: http://bugzilla.xfce.org/show_bug.cgi?id=4365
> 
> The patches are about having xfce support the xdg user directories. Right now
> the xfdesktop patch has already been committed to svn.
> 
> We need the places plugin to be compatible too and I guess this is just about
> changing the directory for the desktop menu entry.
> 
> Here is the patch

Please also make it not display the Desktop if it's set to the user's home.
Comment 2 Andrea Santilli 2008-10-15 04:45:26 CEST
Created attachment 1895 
patch for places plugin #2

Now the plugin hides the desktop when it points to $HOME.

Anyway the plugin segfaults for other unknown reasons when you take it off the panel (got it from dmesg output)
Comment 3 Diego Ongaro 2008-11-19 06:48:45 CET
Created attachment 1989 
Based on att1895

Thanks, Andrea. I've iterated on your patch a bit. Let me know what you think.

I tried to get it so that the plugin would notice any xdg configuration changes immediately, but it seems that g_get_user_special_dir doesn't work that way. Oh well.

-Diego
Comment 4 Andrea Santilli 2008-11-21 13:28:58 CET
Hi Diego, I've just changed the patch and looks fine apart for a detail: according to the specifications, when the desktop directory isnt set it should default to ~/Desktop. Can you fix that please? :)

About the xdg configuration changes, unfortunately g_get_user_special_dir () reads the configuration only once, and the read values are owned by glib. So the changes never reflect on the returned values.

Your change might be useful anyway if in the future we provide some kind of monitoring on changes on ~/.config/user-dirs.dirs (that could be done without polling by using GIO) and so provide a function in libxfce4util that improves and replaces g_get_user_special_dir () completely.
Comment 5 Diego Ongaro 2008-11-21 17:51:30 CET
> according to the specifications, when the desktop directory isnt set it should
> default to ~/Desktop. Can you fix that please? :)

I thought I retained that behavior. See the comment /* fall back to ~/Desktop */.

> Your change might be useful anyway if in the future we provide some kind of
> monitoring on changes on ~/.config/user-dirs.dirs (that could be done without
> polling by using GIO) and so provide a function in libxfce4util that improves
> and replaces g_get_user_special_dir () completely.

Maybe g_get_user_special_dir will eventually do that, also.
Comment 6 Andrea Santilli 2008-11-21 18:44:39 CET
> I thought I retained that behavior. See the comment /* fall back to ~/Desktop
*/.

Oh sorry. I was trying to figure out with it wouldn't show the desktop but the code seemed ok. Well the directory simply wasn't there (d'oh)

> Maybe g_get_user_special_dir will eventually do that, also.

Yeah I guess you're right. It would be better to file a bug report against glib directly.

Ok so the patch is perfect to me.
Comment 7 Diego Ongaro 2008-11-21 19:27:41 CET
Committed attachment 1989  as svn r6153.

Bug #4461

Reported by:
Andrea Santilli
Reported on: 2008-10-10
Last modified on: 2010-11-09

People

Assignee:
Diego Ongaro
CC List:
2 users

Version

Version:
unspecified

Attachments

patch for places plugin (1.90 KB, patch)
2008-10-10 09:07 CEST , Andrea Santilli
no flags
patch for places plugin #2 (2.54 KB, patch)
2008-10-15 04:45 CEST , Andrea Santilli
no flags
Based on att1895 (4.77 KB, patch)
2008-11-19 06:48 CET , Diego Ongaro
no flags

Additional information