[metacity/wip/gtk-theme: 32/35] 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: 32/35] theme: allow NULL as theme name
- Date: Thu, 19 Feb 2015 21:30:15 +0000 (UTC)
commit e057bb0da463917e8a7d8a3fc9054cf8f5b5bde8
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 5d3d23a..1f2c6a0 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -999,15 +999,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 132e70b..e875f0e 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -5361,7 +5361,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]