]> spindle.queued.net Git - midori/commitdiff
Don't use grep in sokoke_get_desktop and fix memory leaks
authorEnrico Tröger <enrico.troeger@uvena.de>
Fri, 28 Nov 2008 23:16:57 +0000 (00:16 +0100)
committerChristian Dywan <christian@twotoasts.de>
Fri, 28 Nov 2008 23:16:57 +0000 (00:16 +0100)
katze/katze-utils.c
midori/midori-preferences.c
midori/sokoke.c

index 6d2d9359ec8eaf1f1628b8000d410974eb700433..03788b8a9ce2c8101492e532eaeb6c4a14bbb376 100644 (file)
@@ -59,14 +59,13 @@ proxy_combo_box_text_changed_cb (GtkComboBox* button, GObject* object)
     return FALSE;
 }
 
-static gboolean
+static void
 proxy_entry_activate_cb (GtkEntry* entry,
                          GObject*  object)
 {
     const gchar* text = gtk_entry_get_text (entry);
     const gchar* property = g_object_get_data (G_OBJECT (entry), "property");
     g_object_set (object, property, text, NULL);
-    return FALSE;
 }
 
 static gboolean
@@ -99,13 +98,12 @@ proxy_spin_button_changed_cb (GtkSpinButton* button, GObject* object)
     return FALSE;
 }
 
-static gchar*
+static void
 proxy_combo_box_changed_cb (GtkComboBox* button, GObject* object)
 {
     gint value = gtk_combo_box_get_active (button);
     const gchar* property = g_object_get_data (G_OBJECT (button), "property");
     g_object_set (object, property, value, NULL);
-    return FALSE;
 }
 
 /**
index 58791794d2a57ca1cfd9f0aec31ff7eec020c502..aed94c6295b0a2f0de7c2638532b0b0eb4ae408c 100644 (file)
@@ -100,7 +100,7 @@ midori_preferences_init (MidoriPreferences* preferences)
     g_signal_connect (preferences, "response",
                       G_CALLBACK (midori_preferences_response_cb), NULL);
 
-    /* TODO: Do we want tooltips for explainations or can we omit that? */
+    /* TODO: Do we want tooltips for explanations or can we omit that? */
     g_free (dialog_title);
 }
 
index 2822f5a29cf0d15a32a625251dacc3f589768181..970b54bd2e40b2da42c2a8bf77e941a833b7907c 100644 (file)
@@ -212,14 +212,15 @@ sokoke_get_desktop (void)
     if (G_UNLIKELY (desktop == SOKOKE_DESKTOP_UNTESTED))
     {
         /* Are we running in Xfce? */
-        gint result; gchar* out; gchar* err;
-        gboolean success = g_spawn_command_line_sync (
-            "xprop -root _DT_SAVE_MODE | grep -q xfce4",
-            &out, &err, &result, NULL);
-        if (success && !result)
+        gint result;
+        gchar *out = NULL;
+        gboolean success = g_spawn_command_line_sync ("xprop -root _DT_SAVE_MODE",
+            &out, NULL, &result, NULL);
+        if (success && ! result && out != NULL && strstr(out, "xfce4") != NULL)
             desktop = SOKOKE_DESKTOP_XFCE;
         else
             desktop = SOKOKE_DESKTOP_UNKNOWN;
+        g_free(out);
     }
 
     return desktop;
@@ -258,6 +259,7 @@ sokoke_xfce_header_new (const gchar* icon,
         gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
         gtk_container_add (GTK_CONTAINER (xfce_heading), hbox);
         g_free (markup);
+        gtk_widget_destroy(entry);
         return xfce_heading;
     }
     return NULL;