summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2014-10-03 16:41:36 +1300
committerRobert Ancell <robert.ancell@canonical.com>2014-10-03 16:41:36 +1300
commitc68853aa93380e7410f25785bfef8b21395ae8dd (patch)
tree1430240803ccde73fc4b53d16554c77ef5378ed9 /tests
parent6ed3da1444a90d85f5f0df9ff4bad92bedfd89f7 (diff)
downloadlightdm-c68853aa93380e7410f25785bfef8b21395ae8dd.tar.gz
Revert changes to AccountsService properties watching - it appears it's not using org.freedesktop.DBus.Properties
Diffstat (limited to 'tests')
-rw-r--r--tests/src/test-runner.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/tests/src/test-runner.c b/tests/src/test-runner.c
index c9ef7689..dc12d475 100644
--- a/tests/src/test-runner.c
+++ b/tests/src/test-runner.c
@@ -828,6 +828,7 @@ handle_command (const gchar *command)
GString *status_text;
gchar *username;
AccountsUser *user;
+ GError *error = NULL;
status_text = g_string_new ("RUNNER UPDATE-USER USERNAME=");
@@ -836,81 +837,67 @@ handle_command (const gchar *command)
user = get_accounts_user_by_name (username);
if (user)
{
- GVariantBuilder invalidated_properties;
- GError *error = NULL;
-
- g_variant_builder_init (&invalidated_properties, G_VARIANT_TYPE_ARRAY);
-
if (g_hash_table_lookup (params, "NAME"))
{
user->user_name = g_strdup (g_hash_table_lookup (params, "NAME"));
g_string_append_printf (status_text, " NAME=%s", user->user_name);
- g_variant_builder_add (&invalidated_properties, "s", "UserName");
}
if (g_hash_table_lookup (params, "REAL-NAME"))
{
user->real_name = g_strdup (g_hash_table_lookup (params, "REAL-NAME"));
g_string_append_printf (status_text, " REAL-NAME=%s", user->real_name);
- g_variant_builder_add (&invalidated_properties, "s", "RealName");
}
if (g_hash_table_lookup (params, "HOME-DIRECTORY"))
{
user->home_directory = g_strdup (g_hash_table_lookup (params, "HOME-DIRECTORY"));
g_string_append_printf (status_text, " HOME-DIRECTORY=%s", user->home_directory);
- g_variant_builder_add (&invalidated_properties, "s", "HomeDirectory");
}
if (g_hash_table_lookup (params, "IMAGE"))
{
user->image = g_strdup (g_hash_table_lookup (params, "IMAGE"));
g_string_append_printf (status_text, " IMAGE=%s", user->image);
- g_variant_builder_add (&invalidated_properties, "s", "IconFile");
}
if (g_hash_table_lookup (params, "BACKGROUND"))
{
user->background = g_strdup (g_hash_table_lookup (params, "BACKGROUND"));
g_string_append_printf (status_text, " BACKGROUND=%s", user->background);
- g_variant_builder_add (&invalidated_properties, "s", "BackgroundFile");
}
if (g_hash_table_lookup (params, "LANGUAGE"))
{
user->language = g_strdup (g_hash_table_lookup (params, "LANGUAGE"));
g_string_append_printf (status_text, " LANGUAGE=%s", user->language);
- g_variant_builder_add (&invalidated_properties, "s", "Language");
}
if (g_hash_table_lookup (params, "LAYOUTS"))
{
const gchar *value = g_hash_table_lookup (params, "LAYOUTS");
user->layouts = g_strsplit (value, ";", -1);
g_string_append_printf (status_text, " LAYOUTS=%s", value);
- g_variant_builder_add (&invalidated_properties, "s", "XKeyboardLayouts");
}
if (g_hash_table_lookup (params, "HAS-MESSAGES"))
{
user->has_messages = g_strcmp0 (g_hash_table_lookup (params, "HAS-MESSAGES"), "TRUE") == 0;
g_string_append_printf (status_text, " HAS-MESSAGES=%s", user->has_messages ? "TRUE" : "FALSE");
- g_variant_builder_add (&invalidated_properties, "s", "XHasMessages");
}
if (g_hash_table_lookup (params, "SESSION"))
{
user->xsession = g_strdup (g_hash_table_lookup (params, "SESSION"));
g_string_append_printf (status_text, " SESSION=%s", user->xsession);
- g_variant_builder_add (&invalidated_properties, "s", "XSession");
}
-
- g_dbus_connection_emit_signal (accounts_connection,
- NULL,
- user->path,
- "org.freedesktop.DBus.Properties",
- "PropertiesChanged",
- g_variant_new ("(sa{sv}as)", "org.freedesktop.Accounts.User", NULL, &invalidated_properties),
- &error);
- if (error)
- g_warning ("Failed to emit PropertiesChanged: %s", error->message);
- g_clear_error (&error);
}
else
g_warning ("Unknown user %s", username);
+ g_dbus_connection_emit_signal (accounts_connection,
+ NULL,
+ user->path,
+ "org.freedesktop.Accounts.User",
+ "Changed",
+ g_variant_new ("()"),
+ &error);
+ if (error)
+ g_warning ("Failed to emit Changed: %s", error->message);
+ g_clear_error (&error);
+
check_status (status_text->str);
g_string_free (status_text, TRUE);
}
@@ -2174,7 +2161,6 @@ handle_user_call (GDBusConnection *connection,
if (strcmp (method_name, "SetXSession") == 0)
{
gchar *xsession;
- GVariantBuilder invalidated_properties;
g_variant_get (parameters, "(&s)", &xsession);
@@ -2184,14 +2170,12 @@ handle_user_call (GDBusConnection *connection,
g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
/* And notify others that it took */
- g_variant_builder_init (&invalidated_properties, G_VARIANT_TYPE_ARRAY);
- g_variant_builder_add (&invalidated_properties, "s", "XSession");
g_dbus_connection_emit_signal (accounts_connection,
NULL,
user->path,
- "org.freedesktop.DBus.Properties",
- "PropertiesChanged",
- g_variant_new ("(sa{sv}as)", "org.freedesktop.Accounts.User", NULL, &invalidated_properties),
+ "org.freedesktop.Accounts.User",
+ "Changed",
+ g_variant_new ("()"),
NULL);
}
else
@@ -2287,6 +2271,7 @@ accounts_name_acquired_cb (GDBusConnection *connection,
" <property name='XSession' type='s' access='read'/>"
" <property name='XKeyboardLayouts' type='as' access='read'/>"
" <property name='XHasMessages' type='b' access='read'/>"
+ " <signal name='Changed' />"
" </interface>"
"</node>";
GError *error = NULL;