app: Use g_variant_lookup instead of dict iteration
This commit is contained in:
parent
8b0e846e0e
commit
0256a6d47b
@ -960,10 +960,8 @@ application_properties_changed (GDBusConnection *connection,
|
|||||||
{
|
{
|
||||||
ShellApp *app = user_data;
|
ShellApp *app = user_data;
|
||||||
GVariant *changed_properties;
|
GVariant *changed_properties;
|
||||||
GVariantIter iter;
|
|
||||||
gboolean busy = FALSE;
|
gboolean busy = FALSE;
|
||||||
const gchar *key, *interface_name_for_signal;
|
const gchar *interface_name_for_signal;
|
||||||
GVariant *value;
|
|
||||||
|
|
||||||
g_variant_get (parameters,
|
g_variant_get (parameters,
|
||||||
"(&s@a{sv}as)",
|
"(&s@a{sv}as)",
|
||||||
@ -974,19 +972,7 @@ application_properties_changed (GDBusConnection *connection,
|
|||||||
if (g_strcmp0 (interface_name_for_signal, "org.gtk.Application") != 0)
|
if (g_strcmp0 (interface_name_for_signal, "org.gtk.Application") != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_variant_iter_init (&iter, changed_properties);
|
g_variant_lookup (changed_properties, "Busy", "b", &busy);
|
||||||
while (g_variant_iter_next (&iter, "{&sv}", &key, &value))
|
|
||||||
{
|
|
||||||
if (g_strcmp0 (key, "Busy") != 0)
|
|
||||||
{
|
|
||||||
g_variant_unref (value);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
busy = g_variant_get_boolean (value);
|
|
||||||
g_variant_unref (value);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (busy)
|
if (busy)
|
||||||
shell_app_state_transition (app, SHELL_APP_STATE_BUSY);
|
shell_app_state_transition (app, SHELL_APP_STATE_BUSY);
|
||||||
|
Loading…
Reference in New Issue
Block a user