@@ -102,7 +102,7 @@ void add_notification_action(GtkWindow *nw, const char *text, const char *key,
102
102
void clear_notification_actions (GtkWindow * nw );
103
103
void move_notification (GtkWidget * nw , int x , int y );
104
104
void set_notification_timeout (GtkWindow * nw , glong timeout );
105
- void set_notification_hints (GtkWindow * nw , GHashTable * hints );
105
+ void set_notification_hints (GtkWindow * nw , GVariant * hints );
106
106
void notification_tick (GtkWindow * nw , glong remaining );
107
107
108
108
#define STRIPE_WIDTH 32
@@ -1082,20 +1082,19 @@ set_notification_timeout(GtkWindow *nw, glong timeout)
1082
1082
}
1083
1083
1084
1084
/* Set notification hints */
1085
- void
1086
- set_notification_hints (GtkWindow * nw , GHashTable * hints )
1085
+ void set_notification_hints (GtkWindow * nw , GVariant * hints )
1087
1086
{
1088
1087
WindowData * windata = g_object_get_data (G_OBJECT (nw ), "windata" );
1089
- GValue * value = NULL , * icon_value = NULL ;
1088
+ GVariant * value = NULL , * icon_value = NULL ;
1090
1089
1091
1090
g_assert (windata != NULL );
1092
1091
1093
- value = ( GValue * ) g_hash_table_lookup ( hints , "urgency" );
1094
- icon_value = ( GValue * ) g_hash_table_lookup ( hints , "action-icons" );
1092
+ g_variant_lookup ( hints , "urgency" , "v" , & value );
1093
+ g_variant_lookup ( hints , "action-icons" , "v" , & icon_value );
1095
1094
1096
- if (value != NULL && G_VALUE_HOLDS_UCHAR (value ))
1095
+ if (value != NULL && g_variant_get_type (value ) == G_VARIANT_TYPE_BYTE )
1097
1096
{
1098
- windata -> urgency = g_value_get_uchar (value );
1097
+ windata -> urgency = g_variant_get_byte (value );
1099
1098
1100
1099
if (windata -> urgency == URGENCY_CRITICAL ) {
1101
1100
gtk_window_set_title (GTK_WINDOW (nw ), "Critical Notification" );
@@ -1105,9 +1104,9 @@ set_notification_hints(GtkWindow *nw, GHashTable *hints)
1105
1104
}
1106
1105
1107
1106
/* Determine if action-icons have been requested */
1108
- if (icon_value != NULL && G_VALUE_HOLDS_BOOLEAN (icon_value ))
1107
+ if (icon_value != NULL && g_variant_get_type (icon_value ) == G_VARIANT_TYPE_BOOLEAN )
1109
1108
{
1110
- windata -> action_icons = g_value_get_boolean (icon_value );
1109
+ windata -> action_icons = g_variant_get_boolean (icon_value );
1111
1110
}
1112
1111
}
1113
1112
0 commit comments