From 558e20309f0d44543af0e5d3b9cbe504e1e2aeb7 Mon Sep 17 00:00:00 2001
From: Stephan Arts <stephan@xfce.org>
Date: Sat, 18 Apr 2009 14:36:41 +0000
Subject: [PATCH] Applied patch by mike massonnet (bug #5056)

(Old svn revision: 29834)
---
 ChangeLog                               |  9 +++++++++
 plugins/thunar-wallpaper/twp-provider.c | 12 ++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c6aad8d5e..07df0c9d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,15 @@
 
 	* configure.in.in, docs/manual/gl/images/: Fix broken build due
 	  to incomplete integration of the Galician manual translations.
+
+2009-04-07  Mike Massonnet <mmassonnet@xfce.org>
+
+	* plugins/thunar-wallpaper/twp-provider.c(twp_action_set_wallpaper):
+	  Escape spaces in filename (bug #5056) and set style auto (bug #5057)
+	* plugins/thunar-wallpaper/twp-provider.c(twp_action_set_wallpaper),
+	  plugins/thunar-wallpaper/twp-provider.c(check_cli_tools):
+	  Don't pretend gconftool exists (if it exists it is just a symlink),
+	  instead look for gconftool-2
 	
 2009-03-12  Jannis Pohlmann <jannis@xfce.org>
 
diff --git a/plugins/thunar-wallpaper/twp-provider.c b/plugins/thunar-wallpaper/twp-provider.c
index 868d8f1a7..0d4038ea4 100644
--- a/plugins/thunar-wallpaper/twp-provider.c
+++ b/plugins/thunar-wallpaper/twp-provider.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2008 Stephan Arts <stephan@xfce.org>
- * Copyright (c) 2008 Mike Massonnet <mmassonnet@xfce.org>
+ * Copyright (c) 2008-2009 Mike Massonnet <mmassonnet@xfce.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -243,7 +243,7 @@ twp_action_set_wallpaper (GtkAction *action, gpointer user_data)
             image_show_prop = g_strdup_printf("/backdrop/screen%d/monitor%d/image-show", screen_nr, monitor_nr);
             image_style_prop = g_strdup_printf("/backdrop/screen%d/monitor%d/image-style", screen_nr, monitor_nr);
 
-            command = g_strdup_printf ("xfconf-query -c xfce4-desktop -p %s --create -t string -s %s", image_path_prop, file_name);
+            command = g_strdup_printf ("xfconf-query -c xfce4-desktop -p %s --create -t string -s \"%s\"", image_path_prop, file_name);
             g_spawn_command_line_async (command, NULL);
             g_free (command);
 
@@ -251,7 +251,7 @@ twp_action_set_wallpaper (GtkAction *action, gpointer user_data)
             g_spawn_command_line_async (command, NULL);
             g_free (command);
 
-            command = g_strdup_printf ("xfconf-query -c xfce4-desktop -p %s --create -t int -s 4", image_style_prop);
+            command = g_strdup_printf ("xfconf-query -c xfce4-desktop -p %s --create -t int -s 0", image_style_prop);
             g_spawn_command_line_async (command, NULL);
             g_free (command);
 
@@ -264,12 +264,12 @@ twp_action_set_wallpaper (GtkAction *action, gpointer user_data)
             image_path_prop = g_strdup_printf("/desktop/gnome/background/picture_filename");
             image_show_prop = g_strdup_printf("/desktop/gnome/background/draw_background");
 
-            command = g_strdup_printf ("gconftool %s --set %s--type string", image_path_prop, file_name);
+            command = g_strdup_printf ("gconftool-2 %s --set %s--type string", image_path_prop, file_name);
             g_spawn_command_line_async (command, NULL);
             g_free (command);
 
 
-            command = g_strdup_printf ("gconftool %s --set true --type boolean", image_show_prop);
+            command = g_strdup_printf ("gconftool-2 %s --set true --type boolean", image_show_prop);
             g_spawn_command_line_async (command, NULL);
             g_free (command);
 
@@ -298,7 +298,7 @@ check_cli_tools ()
     g_free (program);
   }
 
-  program = g_find_program_in_path ("gconftool");
+  program = g_find_program_in_path ("gconftool-2");
   if (G_LIKELY (program != NULL))
   {
     _has_gconftool = TRUE;
-- 
GitLab