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,24 +1033,24 @@ 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);
} }
return value; if (parse_func == NULL) {
return value;
}
return get_parsed_variant (notification, key, value, parse_func);
} }
/** /**