[Xfce4-commits] [panel-plugins/xfce4-statusnotifier-plugin] 01/01: Check tooltip type before deconstructing (Bug #15110)
noreply at xfce.org
noreply at xfce.org
Sat Feb 2 22:18:32 CET 2019
This is an automated email from the git hooks/post-receive script.
n i n e t l s p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-statusnotifier-plugin.
commit d5fd29117df0bfbc659531491af1a4375880b8e3
Author: Viktor Odintsev <ninetls at xfce.org>
Date: Sun Feb 3 00:17:14 2019 +0300
Check tooltip type before deconstructing (Bug #15110)
---
panel-plugin/sn-item.c | 37 ++++++++++++++++++++++++++-----------
1 file changed, 26 insertions(+), 11 deletions(-)
diff --git a/panel-plugin/sn-item.c b/panel-plugin/sn-item.c
index cfb8e94..67b557c 100644
--- a/panel-plugin/sn-item.c
+++ b/panel-plugin/sn-item.c
@@ -728,12 +728,12 @@ sn_item_get_all_properties_result (GObject *source_object,
#define update_new_string(val, entry, update_what) \
if (g_strcmp0 (string_empty_null (val), string_empty_null (item->entry))) \
- { \
- g_free (item->entry); \
- item->entry = (val) != NULL && strlen (val) > 0 \
- ? g_strdup (val) : NULL; \
- update_what = TRUE; \
- }
+ { \
+ g_free (item->entry); \
+ item->entry = (val) != NULL && strlen (val) > 0 \
+ ? g_strdup (val) : NULL; \
+ update_what = TRUE; \
+ }
#define update_new_pixbuf(val, entry, update_what) \
if (!sn_item_pixbuf_equals (val, item->entry)) \
@@ -773,11 +773,26 @@ sn_item_get_all_properties_result (GObject *source_object,
}
else if (!g_strcmp0 (name, "ToolTip"))
{
- g_variant_get (value, "(sa(iiay)ss)", NULL, NULL, &str_val1, &str_val2);
- update_new_string (str_val1, tooltip_title, update_tooltip);
- update_new_string (str_val2, tooltip_subtitle, update_tooltip);
- g_free (str_val1);
- g_free (str_val2);
+ cstr_val1 = g_variant_get_type_string (value);
+ if (!g_strcmp0 (cstr_val1, "(sa(iiay)ss)"))
+ {
+ g_variant_get (value, "(sa(iiay)ss)", NULL, NULL, &str_val1, &str_val2);
+ update_new_string (str_val1, tooltip_title, update_tooltip);
+ update_new_string (str_val2, tooltip_subtitle, update_tooltip);
+ g_free (str_val1);
+ g_free (str_val2);
+ }
+ else if (!g_strcmp0 (cstr_val1, "s"))
+ {
+ cstr_val1 = g_variant_get_string (value, NULL);
+ update_new_string (cstr_val1, tooltip_title, update_tooltip);
+ update_new_string (NULL, tooltip_subtitle, update_tooltip);
+ }
+ else
+ {
+ update_new_string (NULL, tooltip_title, update_tooltip);
+ update_new_string (NULL, tooltip_subtitle, update_tooltip);
+ }
}
else if (!g_strcmp0 (name, "ItemIsMenu"))
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list