diff options
Diffstat (limited to 'src/themes')
-rw-r--r-- | src/themes/coco/coco-theme.c | 14 | ||||
-rw-r--r-- | src/themes/nodoka/nodoka-theme.c | 14 | ||||
-rw-r--r-- | src/themes/slider/theme.c | 14 | ||||
-rw-r--r-- | src/themes/standard/theme.c | 14 |
4 files changed, 24 insertions, 32 deletions
diff --git a/src/themes/coco/coco-theme.c b/src/themes/coco/coco-theme.c index f52729b..94f38e3 100644 --- a/src/themes/coco/coco-theme.c +++ b/src/themes/coco/coco-theme.c @@ -680,16 +680,14 @@ set_notification_timeout(GtkWindow *nw, glong timeout) void set_notification_hints(GtkWindow *nw, GVariant *hints) { WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); - GVariant *value = NULL, *icon_value = NULL; + guint8 urgency; + gboolean action_icons; g_assert(windata != NULL); - g_variant_lookup(hints, "urgency", "v", &value); - g_variant_lookup(hints, "action-icons", "v", &icon_value); - - if (value != NULL && g_variant_get_type(value) == G_VARIANT_TYPE_BYTE) + if (g_variant_lookup(hints, "urgency", "y", &urgency)) { - windata->urgency = g_variant_get_byte(value); + windata->urgency = urgency; if (windata->urgency == URGENCY_CRITICAL) { gtk_window_set_title(GTK_WINDOW(nw), "Critical Notification"); @@ -699,9 +697,9 @@ void set_notification_hints(GtkWindow *nw, GVariant *hints) } /* Determine if action-icons have been requested */ - if (icon_value != NULL && g_variant_get_type(icon_value) == G_VARIANT_TYPE_BOOLEAN) + if (g_variant_lookup(hints, "action-icons", "b", &action_icons)) { - windata->action_icons = g_variant_get_boolean(icon_value); + windata->action_icons = action_icons; } } diff --git a/src/themes/nodoka/nodoka-theme.c b/src/themes/nodoka/nodoka-theme.c index 9633178..e2bfb06 100644 --- a/src/themes/nodoka/nodoka-theme.c +++ b/src/themes/nodoka/nodoka-theme.c @@ -1085,16 +1085,14 @@ set_notification_timeout(GtkWindow *nw, glong timeout) void set_notification_hints(GtkWindow *nw, GVariant *hints) { WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); - GVariant *value = NULL, *icon_value = NULL; + guint8 urgency; + gboolean action_icons; g_assert(windata != NULL); - g_variant_lookup(hints, "urgency", "v", &value); - g_variant_lookup(hints, "action-icons", "v", &icon_value); - - if (value != NULL && g_variant_get_type(value) == G_VARIANT_TYPE_BYTE) + if (g_variant_lookup(hints, "urgency", "y", &urgency)) { - windata->urgency = g_variant_get_byte(value); + windata->urgency = urgency; if (windata->urgency == URGENCY_CRITICAL) { gtk_window_set_title(GTK_WINDOW(nw), "Critical Notification"); @@ -1104,9 +1102,9 @@ void set_notification_hints(GtkWindow *nw, GVariant *hints) } /* Determine if action-icons have been requested */ - if (icon_value != NULL && g_variant_get_type(icon_value) == G_VARIANT_TYPE_BOOLEAN) + if (g_variant_lookup(hints, "action-icons", "b", &action_icons)) { - windata->action_icons = g_variant_get_boolean(icon_value); + windata->action_icons = action_icons; } } diff --git a/src/themes/slider/theme.c b/src/themes/slider/theme.c index 78984d0..0c9d5fc 100644 --- a/src/themes/slider/theme.c +++ b/src/themes/slider/theme.c @@ -446,16 +446,14 @@ GtkWindow* create_notification(UrlClickedCb url_clicked) void set_notification_hints(GtkWindow *nw, GVariant *hints) { WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); - GVariant *value = NULL, *icon_value = NULL; + guint8 urgency; + gboolean action_icons; g_assert(windata != NULL); - g_variant_lookup(hints, "urgency", "v", &value); - g_variant_lookup(hints, "action-icons", "v", &icon_value); - - if (value != NULL && g_variant_get_type(value) == G_VARIANT_TYPE_BYTE) + if (g_variant_lookup(hints, "urgency", "y", &urgency)) { - windata->urgency = g_variant_get_byte(value); + windata->urgency = urgency; if (windata->urgency == URGENCY_CRITICAL) { gtk_window_set_title(GTK_WINDOW(nw), "Critical Notification"); @@ -465,9 +463,9 @@ void set_notification_hints(GtkWindow *nw, GVariant *hints) } /* Determine if action-icons have been requested */ - if (icon_value != NULL && g_variant_get_type(icon_value) == G_VARIANT_TYPE_BOOLEAN) + if (g_variant_lookup(hints, "action-icons", "b", &action_icons)) { - windata->action_icons = g_variant_get_boolean(icon_value); + windata->action_icons = action_icons; } } diff --git a/src/themes/standard/theme.c b/src/themes/standard/theme.c index 91147c2..d36bda3 100644 --- a/src/themes/standard/theme.c +++ b/src/themes/standard/theme.c @@ -796,16 +796,14 @@ GtkWindow* create_notification(UrlClickedCb url_clicked) void set_notification_hints(GtkWindow *nw, GVariant *hints) { WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata"); - GVariant *value = NULL, *icon_value = NULL; + guint8 urgency; + gboolean action_icons; g_assert(windata != NULL); - g_variant_lookup(hints, "urgency", "v", &value); - g_variant_lookup(hints, "action-icons", "v", &icon_value); - - if (value != NULL && g_variant_get_type(value) == G_VARIANT_TYPE_BYTE) + if (g_variant_lookup(hints, "urgency", "y", &urgency)) { - windata->urgency = g_variant_get_byte(value); + windata->urgency = urgency; if (windata->urgency == URGENCY_CRITICAL) { gtk_window_set_title(GTK_WINDOW(nw), "Critical Notification"); @@ -815,9 +813,9 @@ void set_notification_hints(GtkWindow *nw, GVariant *hints) } /* Determine if action-icons have been requested */ - if (icon_value != NULL && g_variant_get_type(icon_value) == G_VARIANT_TYPE_BOOLEAN) + if (g_variant_lookup(hints, "action-icons", "b", &action_icons)) { - windata->action_icons = g_variant_get_boolean(icon_value); + windata->action_icons = action_icons; } } |