Merge lp:~alecu/ubuntuone-client/the-other-signal into lp:ubuntuone-client

Proposed by Alejandro J. Cura
Status: Merged
Approved by: Natalia Bidart
Approved revision: 960
Merged at revision: 961
Proposed branch: lp:~alecu/ubuntuone-client/the-other-signal
Merge into: lp:ubuntuone-client
Prerequisite: lp:~alecu/ubuntuone-client/revert-dbus-interface-change
Diff against target: 51 lines (+27/-1)
1 file modified
libsyncdaemon/syncdaemon-authentication.c (+27/-1)
To merge this branch: bzr merge lp:~alecu/ubuntuone-client/the-other-signal
Reviewer Review Type Date Requested Status
Roman Yepishev (community) fieldtest Approve
Natalia Bidart (community) Approve
Review via email: mp+58190@code.launchpad.net

Commit message

Listen to the same DBus interface that Syncdaemon uses (LP: #759197)

Description of the change

Listen to the same DBus interface that Syncdaemon uses (LP: #759197)

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

This is a simpler way to fix Bug #759197, because the previous one broke a few things and had to be reverted.

Revision history for this message
Alejandro J. Cura (alecu) wrote :

To test this branch: create a new desktop user, log as it, check that there's no "Ubuntu One" bookmark on nautilus; then log into Ubuntu One (using a new or an existing user) and after logging into Ubuntu One the bookmark should be created.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

It works, code looks good.

review: Approve
Revision history for this message
Alejandro J. Cura (alecu) wrote :
Revision history for this message
Roman Yepishev (rye) wrote :

Works properly

review: Approve (fieldtest)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libsyncdaemon/syncdaemon-authentication.c'
2--- libsyncdaemon/syncdaemon-authentication.c 2011-04-18 20:39:30 +0000
3+++ libsyncdaemon/syncdaemon-authentication.c 2011-04-18 20:39:30 +0000
4@@ -31,6 +31,7 @@
5 struct _SyncdaemonAuthenticationPrivate {
6 DBusGConnection *bus;
7 DBusGProxy *proxy;
8+ DBusGProxy *newer_proxy;
9 gboolean has_credentials;
10 SyncdaemonCredentials *credentials;
11 };
12@@ -55,6 +56,8 @@
13 g_object_unref (G_OBJECT (auth->priv->credentials));
14 if (auth->priv->proxy != NULL)
15 g_object_unref (G_OBJECT (auth->priv->proxy));
16+ if (auth->priv->newer_proxy != NULL)
17+ g_object_unref (G_OBJECT (auth->priv->newer_proxy));
18 if (auth->priv->bus != NULL)
19 dbus_g_connection_unref (auth->priv->bus);
20
21@@ -192,7 +195,30 @@
22 dbus_g_proxy_connect_signal (auth->priv->proxy, "CredentialsError",
23 G_CALLBACK (credentials_error_cb), auth, NULL);
24 } else
25- g_warning ("Couldn't get proxy for com.ubuntu.sso");
26+ g_warning ("Couldn't get proxy for com.ubuntu.sso.ApplicationCredentials");
27+
28+ auth->priv->newer_proxy = dbus_g_proxy_new_for_name (auth->priv->bus, "com.ubuntu.sso",
29+ "/com/ubuntu/sso/credentials", "com.ubuntu.sso.CredentialsManagement");
30+ if (auth->priv->newer_proxy != NULL) {
31+ dbus_g_object_register_marshaller (_syncdaemon_marshal_VOID__STRING_POINTER,
32+ G_TYPE_NONE,
33+ G_TYPE_STRING,
34+ dbus_g_type_get_map ("GHashTable",
35+ G_TYPE_STRING,
36+ G_TYPE_STRING),
37+ G_TYPE_INVALID);
38+
39+ dbus_g_proxy_add_signal (auth->priv->newer_proxy, "CredentialsFound",
40+ G_TYPE_STRING,
41+ dbus_g_type_get_map ("GHashTable",
42+ G_TYPE_STRING,
43+ G_TYPE_STRING),
44+ G_TYPE_INVALID);
45+ dbus_g_proxy_connect_signal (auth->priv->newer_proxy, "CredentialsFound",
46+ G_CALLBACK (credentials_found_cb), auth, NULL);
47+ } else
48+ g_warning ("Couldn't get proxy for com.ubuntu.sso.CredentialsManagement");
49+
50 }
51 }
52

Subscribers

People subscribed via source and target branches