From 417493caa3e4542bfa16c080d0ea41a8ff7b3148 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Enrico=20Tr=C3=B6ger?= Date: Sat, 29 Nov 2008 00:16:57 +0100 Subject: [PATCH] Don't use grep in sokoke_get_desktop and fix memory leaks --- katze/katze-utils.c | 6 ++---- midori/midori-preferences.c | 2 +- midori/sokoke.c | 12 +++++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 6d2d9359..03788b8a 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -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; } /** diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 58791794..aed94c62 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -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); } diff --git a/midori/sokoke.c b/midori/sokoke.c index 2822f5a2..970b54bd 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -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; -- 2.39.5