[glib] Fix gsettings tool crash, part 2



commit a558e460a2f493670932faa4c947ffc42ea8bc70
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Sat Jun 19 19:00:13 2010 +0200

    Fix gsettings tool crash, part 2
    
    Same as previous commit, but for two other functions it missed.

 gio/gsettings-tool.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c
index 7f07f4e..d3501f3 100644
--- a/gio/gsettings-tool.c
+++ b/gio/gsettings-tool.c
@@ -271,7 +271,10 @@ handle_writable (gint   *argc,
   schema = (*argv)[1];
   key = (*argv)[2];
 
-  settings = g_settings_new_with_path (schema, path);
+  if (path)
+    settings = g_settings_new_with_path (schema, path);
+  else
+    settings = g_settings_new (schema);
 
   if (g_settings_is_writable (settings, key))
     g_print ("true\n");
@@ -347,7 +350,10 @@ handle_monitor (gint   *argc,
   schema = (*argv)[1];
   key = (*argv)[2];
 
-  settings = g_settings_new_with_path (schema, path);
+  if (path)
+    settings = g_settings_new_with_path (schema, path);
+  else
+    settings = g_settings_new (schema);
 
   detailed_signal = g_strdup_printf ("changed::%s", key);
   g_signal_connect (settings, detailed_signal,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]