~sil/libubuntuone/restrict-domains

« back to all changes in this revision

Viewing changes to libubuntuone/syncdaemon.c

Connect syncdaemon only when we have OAuth tokens, and prepare for 7d change in library page

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
                                                          "/", "com.ubuntuone.SyncDaemon.SyncDaemon");
50
50
                if (daemon_proxy == NULL)
51
51
                        g_warning ("Could not get proxy for com.ubuntuone.SyncDaemon.SyncDaemon");
52
 
                else {
53
 
                        /* Make the syncdaemon connect if it's not connected */
54
 
                        error = NULL;
55
 
 
56
 
                        if (!dbus_g_proxy_call (daemon_proxy, "connect", &error,
57
 
                                                G_TYPE_INVALID,
58
 
                                                G_TYPE_INVALID)) {
59
 
                                g_warning ("Could not connect to Ubuntu One: %s", error->message);
60
 
                                g_error_free (error);
61
 
                        }
62
 
                }
63
52
        }
64
53
 
65
54
        /* Initialize com.ubuntuone.SyncDaemon.Status proxy */
72
61
}
73
62
 
74
63
void
 
64
syncdaemon_connect (void)
 
65
{
 
66
        GError *error;
 
67
 
 
68
        syncdaemon_init ();
 
69
 
 
70
        /* Make the syncdaemon connect if it's not connected */
 
71
        error = NULL;
 
72
 
 
73
        if (!dbus_g_proxy_call (daemon_proxy, "connect", &error,
 
74
                                G_TYPE_INVALID,
 
75
                                G_TYPE_INVALID)) {
 
76
                g_warning ("Could not connect to Ubuntu One: %s", error->message);
 
77
                g_error_free (error);
 
78
        }
 
79
}
 
80
 
 
81
void
75
82
syncdaemon_finalize (void)
76
83
{
77
84
        g_object_unref (G_OBJECT (daemon_proxy));