From ac82eaa1bd9be37bdef34bd12e07fa7f2446ffda Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Mon, 12 Mar 2012 09:45:20 +0300 Subject: [PATCH] Load wallpapers from standard locations. (Bug 5089) This patch has xfdesktop-settings load backdrops from the XFCE_RESOURCE_DATA wallpapers/ and backdrops/ as well as the usual xfce4/backdrops/. This should make it easier for the users to pick backdrops that they have installed. --- settings/main.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/settings/main.c b/settings/main.c index c6fbaad..ccefe8f 100644 --- a/settings/main.c +++ b/settings/main.c @@ -681,6 +681,7 @@ xfdesktop_settings_dialog_populate_image_list(AppearancePanel *panel) xfconf_channel_set_string(panel->channel, prop_image, image_file); xfconf_channel_set_string(panel->channel, prop_last, image_file); + /* Load the wallpaers in /usr/(local/)?share/xfce4/backrops */ backdrop_dirs = xfce_resource_lookup_all(XFCE_RESOURCE_DATA, "xfce4/backdrops/"); for(i = 0; backdrop_dirs[i]; ++i) { @@ -690,6 +691,32 @@ xfdesktop_settings_dialog_populate_image_list(AppearancePanel *panel) image_file_iter = tmp; } + g_strfreev(backdrop_dirs); + + /* Load the wallpapers in /usr/(local/)?share/wallpapers */ + backdrop_dirs = xfce_resource_lookup_all(XFCE_RESOURCE_DATA, + "wallpapers/"); + for(i = 0; backdrop_dirs[i]; ++i) { + tmp = xfdesktop_image_list_add_dir(ls, backdrop_dirs[i], + image_file); + if(tmp) + image_file_iter = tmp; + } + + g_strfreev(backdrop_dirs); + + /* Load the wallpapers in /usr/(local/)?share/backgrounds/ */ + backdrop_dirs = xfce_resource_lookup_all(XFCE_RESOURCE_DATA, + "backgrounds/"); + for(i = 0; backdrop_dirs[i]; ++i) { + tmp = xfdesktop_image_list_add_dir(ls, backdrop_dirs[i], + image_file); + if(tmp) + image_file_iter = tmp; + } + + g_strfreev(backdrop_dirs); + if(!image_file_iter) image_file_iter = xfdesktop_settings_image_treeview_add(GTK_TREE_MODEL(ls), image_file); -- 1.7.5.4