~chipaca/ubuntuone-client/nautilus-ppage

« back to all changes in this revision

Viewing changes to libsyncdaemon/syncdaemon-filesystem-interface.c

  • Committer: Tarmac
  • Author(s): john.lenton at canonical
  • Date: 2010-08-09 15:03:37 UTC
  • mfrom: (617.1.5 quick-tree-info)
  • Revision ID: rodney.dawes@canonical.com-20100809150337-hdyj22tbi5wkkyfq
Initial version of the dbus call and etc., needed to get the recursive sync state of a folder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
 */
80
80
SyncdaemonMetadata *
81
81
syncdaemon_filesystem_interface_get_metadata (SyncdaemonFilesystemInterface *interface,
82
 
                                              const gchar *path)
 
82
                                              const gchar *path,
 
83
                                              gboolean with_subtree_sync_check)
83
84
{
84
85
        GError *error = NULL;
85
86
        GHashTable *hash;
 
87
        const char *method;
86
88
 
87
89
        g_return_val_if_fail (SYNCDAEMON_IS_FILESYSTEM_INTERFACE (interface), NULL);
88
90
 
89
 
        if (!dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), "get_metadata", &error,
 
91
        if (with_subtree_sync_check)
 
92
                method = "get_metadata_and_quick_tree_synced";
 
93
        else
 
94
                method = "get_metadata";
 
95
 
 
96
        if (!dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), method, &error,
90
97
                               G_TYPE_STRING, path,
91
98
                               G_TYPE_INVALID,
92
99
                               dbus_g_type_get_map ("GHashTable",
93
100
                                                    G_TYPE_STRING,
94
101
                                                    G_TYPE_STRING), &hash,
95
102
                               G_TYPE_INVALID)) {
96
 
                g_warning ("Failed calling get_metadata: %s", error->message);
 
103
                g_warning ("Failed calling %s: %s", method, error->message);
97
104
                g_error_free (error);
98
105
 
99
106
                return NULL;
141
148
void
142
149
syncdaemon_filesystem_interface_get_metadata_async (SyncdaemonFilesystemInterface *interface,
143
150
                                                    const gchar *path,
 
151
                                                    gboolean with_subtree_sync_check,
144
152
                                                    SyncdaemonGotMetadataFunc callback,
145
153
                                                    gpointer user_data)
146
154
{
147
155
        GotMetadataData *gmd;
 
156
        const char *method;
148
157
 
149
158
        g_return_if_fail (SYNCDAEMON_IS_FILESYSTEM_INTERFACE (interface));
150
159
 
 
160
        if (with_subtree_sync_check)
 
161
                method = "get_metadata_and_quick_tree_synced";
 
162
        else
 
163
                method = "get_metadata";
 
164
 
151
165
        gmd = g_new0 (GotMetadataData, 1);
152
166
        gmd->interface = interface;
153
167
        gmd->callback = callback;
154
168
        gmd->user_data = user_data;
155
169
 
156
 
        dbus_g_proxy_begin_call (DBUS_G_PROXY (interface->priv->proxy), "get_metadata",
 
170
        dbus_g_proxy_begin_call (DBUS_G_PROXY (interface->priv->proxy),
 
171
                                 method,
157
172
                                 got_metadata_cb, gmd, NULL,
158
173
                                 G_TYPE_STRING, path,
159
174
                                 G_TYPE_INVALID);