Merge lp:~rodrigo-moya/ubuntuone-client/app-name-in-signals into lp:ubuntuone-client

Proposed by Rodrigo Moya
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 650
Merged at revision: 651
Proposed branch: lp:~rodrigo-moya/ubuntuone-client/app-name-in-signals
Merge into: lp:ubuntuone-client
Diff against target: 86 lines (+30/-8)
2 files modified
configure.ac (+6/-4)
libsyncdaemon/syncdaemon-authentication.c (+24/-4)
To merge this branch: bzr merge lp:~rodrigo-moya/ubuntuone-client/app-name-in-signals
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
dobey (community) Approve
Review via email: mp+33528@code.launchpad.net

Commit message

Receive app_name in all DBus signals from ubuntu-sso

Description of the change

Receive app_name in all DBus signals from ubuntu-sso

To post a comment you must log in.
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2010-08-19 11:25:33 +0000
3+++ configure.ac 2010-08-24 14:14:44 +0000
4@@ -135,10 +135,12 @@
5 GOBJECT_INTROSPECTION_CHECK([0.6.4])
6
7 # Fix up some junk from GIR
8-INTROSPECTION_GIRDIR_NAME="`basename ${INTROSPECTION_GIRDIR}`"
9-INTROSPECTION_TYPELIBDIR_NAME="`basename ${INTROSPECTION_TYPELIBDIR}`"
10-AC_SUBST(INTROSPECTION_GIRDIR_NAME)
11-AC_SUBST(INTROSPECTION_TYPELIBDIR_NAME)
12+if test "x$found_introspection" = "xyes"; then
13+ INTROSPECTION_GIRDIR_NAME="`basename ${INTROSPECTION_GIRDIR}`"
14+ INTROSPECTION_TYPELIBDIR_NAME="`basename ${INTROSPECTION_TYPELIBDIR}`"
15+ AC_SUBST(INTROSPECTION_GIRDIR_NAME)
16+ AC_SUBST(INTROSPECTION_TYPELIBDIR_NAME)
17+fi
18
19 dnl glib-genmarshal
20 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
21
22=== modified file 'libsyncdaemon/syncdaemon-authentication.c'
23--- libsyncdaemon/syncdaemon-authentication.c 2010-08-23 04:37:48 +0000
24+++ libsyncdaemon/syncdaemon-authentication.c 2010-08-24 14:14:44 +0000
25@@ -98,11 +98,11 @@
26 }
27
28 static void
29-credentials_found_cb (DBusGProxy *proxy, GHashTable *result, gpointer user_data)
30+credentials_found_cb (DBusGProxy *proxy, const gchar *app_name, GHashTable *result, gpointer user_data)
31 {
32 SyncdaemonAuthentication *auth = SYNCDAEMON_AUTHENTICATION (user_data);
33
34- if (!g_str_has_prefix (g_hash_table_lookup (result, "name"), UBUNTUONE_APP_NAME)) {
35+ if (g_strcmp0 (app_name, UBUNTUONE_APP_NAME) != 0) {
36 g_debug ("Credentials are not for '" UBUNTUONE_APP_NAME "', ignoring");
37 return;
38 }
39@@ -129,10 +129,19 @@
40 }
41
42 static void
43-credentials_error_cb (DBusGProxy *proxy, const gchar *error, gpointer user_data)
44+credentials_error_cb (DBusGProxy *proxy,
45+ const gchar *app_name,
46+ const gchar *error_message,
47+ const gchar *detailed_error,
48+ gpointer user_data)
49 {
50 g_debug ("Authorization error");
51- g_signal_emit (user_data, auth_signals[ERROR_SIGNAL], 0, error);
52+ if (g_strcmp0 (app_name, UBUNTUONE_APP_NAME) != 0) {
53+ g_debug ("Credentials are not for '" UBUNTUONE_APP_NAME "', ignoring");
54+ return;
55+ }
56+
57+ g_signal_emit (user_data, auth_signals[ERROR_SIGNAL], 0, error_message);
58 }
59
60 static void
61@@ -152,7 +161,16 @@
62 auth->priv->proxy = dbus_g_proxy_new_for_name (auth->priv->bus, "com.ubuntu.sso",
63 "/credentials", "com.ubuntu.sso.ApplicationCredentials");
64 if (auth->priv->proxy != NULL) {
65+ dbus_g_object_register_marshaller (_syncdaemon_marshal_VOID__STRING_POINTER,
66+ G_TYPE_NONE,
67+ G_TYPE_STRING,
68+ dbus_g_type_get_map ("GHashTable",
69+ G_TYPE_STRING,
70+ G_TYPE_STRING),
71+ G_TYPE_INVALID);
72+
73 dbus_g_proxy_add_signal (auth->priv->proxy, "CredentialsFound",
74+ G_TYPE_STRING,
75 dbus_g_type_get_map ("GHashTable",
76 G_TYPE_STRING,
77 G_TYPE_STRING),
78@@ -168,6 +186,8 @@
79
80 dbus_g_proxy_add_signal (auth->priv->proxy, "CredentialsError",
81 G_TYPE_STRING,
82+ G_TYPE_STRING,
83+ G_TYPE_STRING,
84 G_TYPE_INVALID);
85 dbus_g_proxy_connect_signal (auth->priv->proxy, "CredentialsError",
86 G_CALLBACK (credentials_error_cb), auth, NULL);

Subscribers

People subscribed via source and target branches