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
=== modified file 'configure.ac'
--- configure.ac 2010-08-19 11:25:33 +0000
+++ configure.ac 2010-08-24 14:14:44 +0000
@@ -135,10 +135,12 @@
135GOBJECT_INTROSPECTION_CHECK([0.6.4])135GOBJECT_INTROSPECTION_CHECK([0.6.4])
136136
137# Fix up some junk from GIR137# Fix up some junk from GIR
138INTROSPECTION_GIRDIR_NAME="`basename ${INTROSPECTION_GIRDIR}`"138if test "x$found_introspection" = "xyes"; then
139INTROSPECTION_TYPELIBDIR_NAME="`basename ${INTROSPECTION_TYPELIBDIR}`"139 INTROSPECTION_GIRDIR_NAME="`basename ${INTROSPECTION_GIRDIR}`"
140AC_SUBST(INTROSPECTION_GIRDIR_NAME)140 INTROSPECTION_TYPELIBDIR_NAME="`basename ${INTROSPECTION_TYPELIBDIR}`"
141AC_SUBST(INTROSPECTION_TYPELIBDIR_NAME)141 AC_SUBST(INTROSPECTION_GIRDIR_NAME)
142 AC_SUBST(INTROSPECTION_TYPELIBDIR_NAME)
143fi
142144
143dnl glib-genmarshal145dnl glib-genmarshal
144AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)146AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
145147
=== modified file 'libsyncdaemon/syncdaemon-authentication.c'
--- libsyncdaemon/syncdaemon-authentication.c 2010-08-23 04:37:48 +0000
+++ libsyncdaemon/syncdaemon-authentication.c 2010-08-24 14:14:44 +0000
@@ -98,11 +98,11 @@
98}98}
9999
100static void100static void
101credentials_found_cb (DBusGProxy *proxy, GHashTable *result, gpointer user_data)101credentials_found_cb (DBusGProxy *proxy, const gchar *app_name, GHashTable *result, gpointer user_data)
102{102{
103 SyncdaemonAuthentication *auth = SYNCDAEMON_AUTHENTICATION (user_data);103 SyncdaemonAuthentication *auth = SYNCDAEMON_AUTHENTICATION (user_data);
104104
105 if (!g_str_has_prefix (g_hash_table_lookup (result, "name"), UBUNTUONE_APP_NAME)) {105 if (g_strcmp0 (app_name, UBUNTUONE_APP_NAME) != 0) {
106 g_debug ("Credentials are not for '" UBUNTUONE_APP_NAME "', ignoring");106 g_debug ("Credentials are not for '" UBUNTUONE_APP_NAME "', ignoring");
107 return;107 return;
108 }108 }
@@ -129,10 +129,19 @@
129}129}
130130
131static void131static void
132credentials_error_cb (DBusGProxy *proxy, const gchar *error, gpointer user_data)132credentials_error_cb (DBusGProxy *proxy,
133 const gchar *app_name,
134 const gchar *error_message,
135 const gchar *detailed_error,
136 gpointer user_data)
133{137{
134 g_debug ("Authorization error");138 g_debug ("Authorization error");
135 g_signal_emit (user_data, auth_signals[ERROR_SIGNAL], 0, error);139 if (g_strcmp0 (app_name, UBUNTUONE_APP_NAME) != 0) {
140 g_debug ("Credentials are not for '" UBUNTUONE_APP_NAME "', ignoring");
141 return;
142 }
143
144 g_signal_emit (user_data, auth_signals[ERROR_SIGNAL], 0, error_message);
136}145}
137146
138static void147static void
@@ -152,7 +161,16 @@
152 auth->priv->proxy = dbus_g_proxy_new_for_name (auth->priv->bus, "com.ubuntu.sso",161 auth->priv->proxy = dbus_g_proxy_new_for_name (auth->priv->bus, "com.ubuntu.sso",
153 "/credentials", "com.ubuntu.sso.ApplicationCredentials");162 "/credentials", "com.ubuntu.sso.ApplicationCredentials");
154 if (auth->priv->proxy != NULL) {163 if (auth->priv->proxy != NULL) {
164 dbus_g_object_register_marshaller (_syncdaemon_marshal_VOID__STRING_POINTER,
165 G_TYPE_NONE,
166 G_TYPE_STRING,
167 dbus_g_type_get_map ("GHashTable",
168 G_TYPE_STRING,
169 G_TYPE_STRING),
170 G_TYPE_INVALID);
171
155 dbus_g_proxy_add_signal (auth->priv->proxy, "CredentialsFound",172 dbus_g_proxy_add_signal (auth->priv->proxy, "CredentialsFound",
173 G_TYPE_STRING,
156 dbus_g_type_get_map ("GHashTable",174 dbus_g_type_get_map ("GHashTable",
157 G_TYPE_STRING,175 G_TYPE_STRING,
158 G_TYPE_STRING),176 G_TYPE_STRING),
@@ -168,6 +186,8 @@
168186
169 dbus_g_proxy_add_signal (auth->priv->proxy, "CredentialsError",187 dbus_g_proxy_add_signal (auth->priv->proxy, "CredentialsError",
170 G_TYPE_STRING,188 G_TYPE_STRING,
189 G_TYPE_STRING,
190 G_TYPE_STRING,
171 G_TYPE_INVALID);191 G_TYPE_INVALID);
172 dbus_g_proxy_connect_signal (auth->priv->proxy, "CredentialsError",192 dbus_g_proxy_connect_signal (auth->priv->proxy, "CredentialsError",
173 G_CALLBACK (credentials_error_cb), auth, NULL);193 G_CALLBACK (credentials_error_cb), auth, NULL);

Subscribers

People subscribed via source and target branches