[metacity/wip/gtk-theme: 48/61] theme: allow NULL as theme name
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity/wip/gtk-theme: 48/61] theme: allow NULL as theme name
- Date: Tue, 20 Jan 2015 23:17:42 +0000 (UTC)
commit ee5bd737b5d78e8f22a7371f0f9a6175479060b0
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Jan 21 00:01:07 2015 +0200
theme: allow NULL as theme name
Theme name == NULL - use current GTK+ theme.
src/core/prefs.c | 9 +++++----
src/ui/theme.c | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 1e197ab..a85aaee 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -990,15 +990,16 @@ theme_name_handler (GVariant *value,
*result = NULL; /* ignored */
string_value = g_variant_get_string (value, NULL);
- if (!string_value || !*string_value)
- return FALSE;
-
if (g_strcmp0 (current_theme, string_value) != 0)
{
if (current_theme)
g_free (current_theme);
- current_theme = g_strdup (string_value);
+ if (!string_value || !*string_value)
+ current_theme = NULL;
+ else
+ current_theme = g_strdup (string_value);
+
queue_changed (META_PREF_THEME);
}
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 9634eac..a45e524 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -5056,7 +5056,7 @@ meta_theme_set_current (const char *name,
if (!force_reload &&
meta_current_theme &&
- strcmp (name, meta_current_theme->name) == 0)
+ g_strcmp0 (name, meta_current_theme->name) == 0)
return;
err = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]