notification: Do not duplicate calls on parse functions

This commit is contained in:
Marco Trevisan (Treviño) 2022-04-22 01:01:56 +02:00
parent 12a7f008a8
commit 0be9962a46
1 changed files with 9 additions and 9 deletions

View File

@ -1033,26 +1033,26 @@ maybe_parse_snap_hint_value (NotifyNotification *notification,
const gchar *key, const gchar *key,
GVariant *value) GVariant *value)
{ {
StringParserFunc parse_func = NULL;
if (!notification->priv->snap_path) if (!notification->priv->snap_path)
return value; return value;
if (g_strcmp0 (key, "desktop-entry") == 0) { if (g_strcmp0 (key, "desktop-entry") == 0) {
value = get_parsed_variant (notification, parse_func = try_prepend_snap_desktop;
key,
value,
try_prepend_snap_desktop);
} else if (g_strcmp0 (key, "image-path") == 0 || } else if (g_strcmp0 (key, "image-path") == 0 ||
g_strcmp0 (key, "image_path") == 0 || g_strcmp0 (key, "image_path") == 0 ||
g_strcmp0 (key, "sound-file") == 0) { g_strcmp0 (key, "sound-file") == 0) {
value = get_parsed_variant (notification, parse_func = try_prepend_snap;
key,
value,
try_prepend_snap);
} }
if (parse_func == NULL) {
return value; return value;
} }
return get_parsed_variant (notification, key, value, parse_func);
}
/** /**
* notify_notification_set_hint: * notify_notification_set_hint:
* @notification: a #NotifyNotification * @notification: a #NotifyNotification