Merge lp:~rodrigo-moya/ubuntuone-client/no-shared-callback-data into lp:ubuntuone-client

Proposed by Rodrigo Moya
Status: Merged
Approved by: Rodrigo Moya
Approved revision: 719
Merged at revision: 719
Proposed branch: lp:~rodrigo-moya/ubuntuone-client/no-shared-callback-data
Merge into: lp:ubuntuone-client
Diff against target: 1172 lines (+523/-474)
9 files modified
nautilus/Makefile.am (+2/-0)
nautilus/context-menu.c (+426/-0)
nautilus/context-menu.h (+32/-0)
nautilus/error-dialog.c (+1/-1)
nautilus/location-widget.h (+0/-3)
nautilus/ubuntuone-nautilus.c (+17/-456)
nautilus/ubuntuone-nautilus.h (+5/-14)
nautilus/utils.c (+39/-0)
po/POTFILES.in (+1/-0)
To merge this branch: bzr merge lp:~rodrigo-moya/ubuntuone-client/no-shared-callback-data
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Roman Yepishev (community) fieldtest Approve
Review via email: mp+36281@code.launchpad.net

Commit message

Don't use shared callback data anymore, each menu should have its own

Description of the change

Don't use shared callback data anymore, each menu should have its own

To post a comment you must log in.
Revision history for this message
Roman Yepishev (rye) :
review: Approve (fieldtest)
Revision history for this message
Natalia Bidart (nataliabidart) :
review: Approve
Revision history for this message
dobey (dobey) wrote :

Attempt to merge into lp:ubuntuone-client failed due to conflicts:

text conflict in nautilus/ubuntuone-nautilus.c

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'nautilus/Makefile.am'
--- nautilus/Makefile.am 2010-08-25 14:00:10 +0000
+++ nautilus/Makefile.am 2010-09-22 11:18:40 +0000
@@ -24,6 +24,8 @@
24 add-contact-dialog.h \24 add-contact-dialog.h \
25 contacts-view.c \25 contacts-view.c \
26 contacts-view.h \26 contacts-view.h \
27 context-menu.c \
28 context-menu.h \
27 error-dialog.c \29 error-dialog.c \
28 location-widget.c \30 location-widget.c \
29 location-widget.h \31 location-widget.h \
3032
=== added file 'nautilus/context-menu.c'
--- nautilus/context-menu.c 1970-01-01 00:00:00 +0000
+++ nautilus/context-menu.c 2010-09-22 11:18:40 +0000
@@ -0,0 +1,426 @@
1/*
2 * UbuntuOne Nautilus plugin
3 *
4 * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
5 *
6 * Copyright 2009-2010 Canonical Ltd.
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 3, as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranties of
14 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifdef HAVE_CONFIG_H
23#include <config.h>
24#endif
25
26#include <glib/gi18n-lib.h>
27#include <libsyncdaemon/libsyncdaemon.h>
28#include "context-menu.h"
29#include "location-widget.h"
30#include "share-dialog.h"
31
32typedef struct {
33 UbuntuOneNautilus *uon;
34 gchar *path;
35 GtkWidget *parent;
36
37 /* Whether to make a file public or private */
38 gboolean make_public;
39} MenuCallbackData;
40
41static void
42free_menu_cb_data (gpointer data, GObject *where_the_object_was)
43{
44 MenuCallbackData *cb_data = (MenuCallbackData *) data;
45
46 g_free (cb_data->path);
47 g_free (cb_data);
48}
49
50/* Menu callbacks */
51static void
52got_public_meta (SyncdaemonFilesystemInterface *interface,
53 gboolean success,
54 SyncdaemonMetadata *metadata,
55 gpointer user_data)
56{
57 MenuCallbackData *data = (MenuCallbackData *) user_data;
58 GError * error = NULL;
59 const gchar * share_id, * node_id;
60 SyncdaemonInterface *public;
61
62 if (!success) {
63 g_warning ("ERROR: getting metadata for public file");
64 return;
65 }
66
67 share_id = syncdaemon_metadata_get_share_id (metadata);
68 node_id = syncdaemon_metadata_get_node_id (metadata);
69
70 public = syncdaemon_daemon_get_publicfiles_interface (data->uon->syncdaemon);
71 if (public != NULL) {
72 syncdaemon_publicfiles_interface_change_public_access (SYNCDAEMON_PUBLICFILES_INTERFACE (public),
73 share_id, node_id, data->make_public);
74 }
75}
76
77static void
78unsubscribe_folder_cb (NautilusMenuItem *item, gpointer user_data)
79{
80 SyncdaemonInterface *interface;
81 MenuCallbackData * data = (MenuCallbackData *) user_data;
82
83 /* Perform the removal of this folder */
84 interface = syncdaemon_daemon_get_folders_interface (data->uon->syncdaemon);
85 if (interface != NULL) {
86 SyncdaemonFolderInfo *folder_info;
87
88 folder_info = syncdaemon_folders_interface_get_info (SYNCDAEMON_FOLDERS_INTERFACE (interface),
89 data->path);
90 if (folder_info != NULL) {
91 if (ubuntuone_nautilus_check_shares_and_public_files (data->uon, folder_info, data->parent)) {
92 syncdaemon_folders_interface_delete (SYNCDAEMON_FOLDERS_INTERFACE (interface),
93 syncdaemon_folder_info_get_volume_id (folder_info));
94 }
95 g_object_unref (G_OBJECT (folder_info));
96 }
97 }
98}
99
100static void
101subscribe_folder_cb (NautilusMenuItem *item, gpointer user_data)
102{
103 SyncdaemonInterface *interface;
104 MenuCallbackData * data = (MenuCallbackData *) user_data;
105
106 /* Perform the addition of this folder */
107 interface = syncdaemon_daemon_get_folders_interface (data->uon->syncdaemon);
108 if (interface != NULL) {
109 /* If there is no user authenticated, make Syncdaemon do so */
110 if (!syncdaemon_authentication_has_credentials (syncdaemon_daemon_get_authentication (data->uon->syncdaemon)))
111 syncdaemon_daemon_connect (data->uon->syncdaemon);
112 syncdaemon_folders_interface_create (SYNCDAEMON_FOLDERS_INTERFACE (interface),
113 data->path);
114 }
115}
116
117static void
118copy_public_url_cb (NautilusMenuItem *item, gpointer user_data)
119{
120 MenuCallbackData * data = (MenuCallbackData *) user_data;
121 gchar * url;
122
123 url = g_hash_table_lookup (data->uon->public, data->path);
124 gtk_clipboard_set_text (gtk_clipboard_get(GDK_SELECTION_CLIPBOARD),
125 url, strlen (url));
126 gtk_clipboard_store (gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
127}
128
129static void
130toggle_publicity_cb (NautilusMenuItem * item, gpointer user_data)
131{
132 SyncdaemonFilesystemInterface *interface;
133 MenuCallbackData * data = (MenuCallbackData *) user_data;
134
135 interface = (SyncdaemonFilesystemInterface *) syncdaemon_daemon_get_filesystem_interface (data->uon->syncdaemon);
136 if (interface != NULL) {
137 /* we know this will not be a directory (so no need for _and_quick_tree_synced) */
138 syncdaemon_filesystem_interface_get_metadata_async (interface, data->path, FALSE,
139 (SyncdaemonGotMetadataFunc) got_public_meta, data);
140 }
141
142 g_hash_table_replace (data->uon->public, g_strdup (data->path), UPDATE_PENDING);
143 ubuntuone_nautilus_reset_emblem (data->uon, data->path);
144}
145
146static void
147share_folder_cb (NautilusMenuItem *item, gpointer user_data)
148{
149 MenuCallbackData * data = (MenuCallbackData *) user_data;
150 GtkWidget * dialog;
151
152 dialog = share_dialog_new (data->parent, data->uon, data->path);
153 gtk_widget_show (dialog);
154}
155
156static void
157unshare_folder_cb (NautilusMenuItem *item, gpointer user_data)
158{
159 MenuCallbackData * data = (MenuCallbackData *) user_data;
160 gchar * share_id;
161 SyncdaemonSharesInterface *interface;
162
163 interface = (SyncdaemonSharesInterface *) syncdaemon_daemon_get_shares_interface (data->uon->syncdaemon);
164 if (interface != NULL) {
165 share_id = g_hash_table_lookup (data->uon->shares, data->path);
166 syncdaemon_shares_interface_delete (interface, share_id);
167 }
168}
169
170static void
171toggle_location_cb (NautilusMenuItem *item, gpointer user_data)
172{
173 GConfClient *conf_client;
174
175 conf_client = gconf_client_get_default ();
176 gconf_client_set_bool (conf_client, EXPANDER_SHOWN_KEY, !ubuntuone_is_location_bar_enabled (), NULL);
177}
178
179NautilusMenuItem *
180context_menu_new (UbuntuOneNautilus *uon,
181 GtkWidget *window,
182 GList *files)
183{
184 NautilusFileInfo *file;
185 NautilusMenu *submenu;
186 NautilusMenuItem *root_item, *menu_item, *urlitem;
187 gchar *path, *item, *homedir_path;
188 gboolean is_managed, is_root, is_udf, is_public, is_shared, is_pending;
189 gboolean is_inhome, is_dir, is_regular;
190 MenuCallbackData *cb_data;
191
192 is_managed = is_root = is_udf = is_public = is_shared = is_pending = FALSE;
193 is_inhome = is_dir = is_regular = FALSE;
194
195 if (g_list_length (files) != 1)
196 return NULL;
197
198 file = NAUTILUS_FILE_INFO (g_list_nth_data (files, 0));
199 path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);
200
201 if (path == NULL)
202 return NULL;
203
204 if (ubuntuone_is_storagefs (uon, path, &is_root))
205 is_managed = TRUE;
206
207 homedir_path = g_strdup_printf ("%s/", g_get_home_dir());
208 if (strncmp (path, homedir_path, strlen (homedir_path)) == 0)
209 is_inhome = TRUE;
210 g_free (homedir_path);
211
212 if ((item = g_hash_table_lookup (uon->udfs, path)) != NULL) {
213 is_udf = TRUE;
214 if (strcmp (item, UPDATE_PENDING) == 0)
215 is_pending = TRUE;
216 } else if ((item = g_hash_table_lookup (uon->public, path)) != NULL) {
217 is_public = TRUE;
218 if (strcmp (item, UPDATE_PENDING) == 0)
219 is_pending = TRUE;
220 }
221 if (g_hash_table_lookup (uon->shares, path) != NULL)
222 is_shared = TRUE;
223
224 is_dir = nautilus_file_info_is_directory (file);
225 is_regular = nautilus_file_info_get_file_type (file) == G_FILE_TYPE_REGULAR;
226
227 cb_data = g_new0 (MenuCallbackData, 1);
228 cb_data->uon = uon;
229 cb_data->parent = window;
230 cb_data->path = g_strdup (path);
231
232 /* Create the root item */
233 root_item = nautilus_menu_item_new ("ubuntuone",
234 _("_Ubuntu One"),
235 _("Ubuntu One options"),
236 "ubuntuone");
237 submenu = nautilus_menu_new ();
238 nautilus_menu_item_set_submenu (root_item, submenu);
239
240 g_object_weak_ref (G_OBJECT (root_item), (GWeakNotify) free_menu_cb_data, cb_data);
241
242 /* Share/unshare */
243 if ((is_managed || is_udf) && !is_root && is_dir) {
244
245 menu_item = nautilus_menu_item_new ("ubuntuone-share",
246 _("_Share..."),
247 _("Share this folder on Ubuntu One"),
248 "ubuntuone");
249 if (is_pending)
250 g_object_set (menu_item, "sensitive", FALSE, NULL);
251
252 g_signal_connect (menu_item, "activate",
253 G_CALLBACK (share_folder_cb), cb_data);
254 } else {
255 /* the different tooltips will probably do us no good */
256 if (is_root) {
257 menu_item = nautilus_menu_item_new ("ubuntuone-noshare-root",
258 _("_Share..."),
259 _("Sorry, you can't share the root of a Ubuntu One volume"),
260 "ubuntuone");
261 } else if (!(is_managed || is_udf)) {
262 menu_item = nautilus_menu_item_new ("ubuntuone-noshare-unmanaged",
263 _("_Share..."),
264 _("Sorry, you can't share folders not managed by Ubuntu One"),
265 "ubuntuone");
266 } else {
267 menu_item = nautilus_menu_item_new ("ubuntuone-noshare-unmanaged",
268 _("_Share..."),
269 _("Sorry, you can only share folders"),
270 "ubuntuone");
271 }
272 g_object_set (menu_item, "sensitive", FALSE, NULL);
273 }
274
275 nautilus_menu_append_item (submenu, menu_item);
276
277 if ((is_managed && is_shared) && !is_root && is_dir) {
278 menu_item = nautilus_menu_item_new ("ubuntuone-unshare",
279 _("Stop _Sharing"),
280 _("Stop sharing this folder on Ubuntu One"),
281 "ubuntuone");
282 if (is_pending)
283 g_object_set (menu_item, "sensitive", FALSE, NULL);
284
285 g_signal_connect (menu_item, "activate",
286 G_CALLBACK (unshare_folder_cb), cb_data);
287 nautilus_menu_append_item (submenu, menu_item);
288 }
289
290 /* UDF logic
291 *
292 * XXX: clean this up and separate the logic out and reuse this
293 * and locationbar somewhere (libsd?)
294 */
295 menu_item = NULL;
296
297 if (is_dir && is_inhome) {
298 /* UDFs could be happening */
299 if (is_managed) {
300 if (strcmp (path, uon->managed) == 0) {
301 /* the Ubuntu One directory, no UDFs */
302 menu_item = nautilus_menu_item_new ("ubuntuone-no-disable-u1",
303 _("Stop Synchronizing This _Folder"),
304 _("Sorry, you can't stop synchronizing ~/Ubuntu One"),
305 "ubuntuone");
306 g_object_set (menu_item, "sensitive", FALSE, NULL);
307 } else if (is_root) {
308 /* the root of a UDF: disabling possible */
309
310 menu_item = nautilus_menu_item_new ("ubuntuone-disable-udf",
311 _("Stop Synchronizing This _Folder"),
312 _("Stop synchronizing this folder with Ubuntu One"),
313 "ubuntuone");
314
315 g_signal_connect (menu_item, "activate",
316 G_CALLBACK (unsubscribe_folder_cb), cb_data);
317 }
318 } else {
319 /* unmanaged */
320 menu_item = nautilus_menu_item_new ("ubuntuone-enable-udf",
321 _("Synchronize This _Folder"),
322 _("Start synchronizing this folder with Ubuntu One"),
323 "ubuntuone");
324
325 g_signal_connect (menu_item, "activate",
326 G_CALLBACK (subscribe_folder_cb), cb_data);
327 }
328 } else {
329 if (is_dir) {
330 menu_item = nautilus_menu_item_new ("ubuntuone-no-disable-u1",
331 _("Synchronize This _Folder"),
332 _("Sorry, you can only synchronize folders within your home folder"),
333 "ubuntuone");
334 } else {
335 menu_item = nautilus_menu_item_new ("ubuntuone-no-disable-u1",
336 _("Synchronize This _Folder"),
337 _("Sorry, you can only synchronize folders"),
338 "ubuntuone");
339 }
340
341 g_object_set (menu_item, "sensitive", FALSE, NULL);
342 }
343
344 if (!menu_item) {
345 menu_item = nautilus_menu_item_new ("ubuntuone-no-udf-operation-possible",
346 _("Synchronize This _Folder"),
347 _("Synchronization not possible for this folder"),
348 "ubuntuone");
349 g_object_set (menu_item, "sensitive", FALSE, NULL);
350 }
351
352 nautilus_menu_append_item (submenu, menu_item);
353
354 /* public files */
355 menu_item = urlitem = NULL;
356
357 if (is_managed && is_regular) {
358 if (is_public) {
359 urlitem = nautilus_menu_item_new ("ubuntuone-geturl",
360 _("Copy Web _Link"),
361 _("Copy the Ubuntu One public URL for this file to the clipboard."),
362 "ubuntuone");
363 if (is_pending)
364 g_object_set (urlitem, "sensitive", FALSE, NULL);
365 g_signal_connect (urlitem, "activate",
366 G_CALLBACK (copy_public_url_cb), cb_data);
367
368 menu_item = nautilus_menu_item_new ("ubuntuone-unpublish",
369 _("Stop _Publishing"),
370 _("No longer share this file with everyone via Ubuntu One."),
371 "ubuntuone");
372 if (is_pending)
373 g_object_set (menu_item, "sensitive", FALSE, NULL);
374
375 cb_data->make_public = FALSE;
376 } else {
377 menu_item = nautilus_menu_item_new ("ubuntuone-publish",
378 _("_Publish"),
379 _("Make this file available to anyone via Ubuntu One."),
380 "ubuntuone");
381 cb_data->make_public = TRUE;
382 }
383 g_signal_connect (menu_item, "activate",
384 G_CALLBACK (toggle_publicity_cb), cb_data);
385 }
386
387 if (!urlitem) {
388 urlitem = nautilus_menu_item_new ("ubuntuone-geturl",
389 _("Copy Web _Link"),
390 _("Sorry, no public URL for this file via Ubuntu One."),
391 "ubuntuone");
392 g_object_set (urlitem, "sensitive", FALSE, NULL);
393 }
394
395 if (!menu_item) {
396 menu_item = nautilus_menu_item_new ("ubuntuone-publish",
397 _("_Publish"),
398 _("Sorry, unable to publish via Ubuntu One."),
399 "ubuntuone");
400 g_object_set (menu_item, "sensitive", FALSE, NULL);
401 }
402
403 nautilus_menu_append_item (submenu, menu_item);
404 nautilus_menu_append_item (submenu, urlitem);
405
406 /* location bar enable/disable */
407 if (ubuntuone_is_location_bar_enabled ()) {
408 menu_item = nautilus_menu_item_new ("ubuntuone-location-hide",
409 _("Hide _Ribbon"),
410 _("Do not show the Ubuntu One ribbon"
411 " in selected folders"),
412 "ubuntuone");
413 } else {
414 menu_item = nautilus_menu_item_new ("ubuntuone-location-show",
415 _("Show _Ribbon in Some Folders"),
416 _("Show the Ubuntu One ribbon"
417 " in selected folders"),
418 "ubuntuone");
419 }
420
421 g_signal_connect (menu_item, "activate",
422 G_CALLBACK (toggle_location_cb), cb_data);
423 nautilus_menu_append_item (submenu, menu_item);
424
425 return root_item;
426}
0427
=== added file 'nautilus/context-menu.h'
--- nautilus/context-menu.h 1970-01-01 00:00:00 +0000
+++ nautilus/context-menu.h 2010-09-22 11:18:40 +0000
@@ -0,0 +1,32 @@
1/*
2 * UbuntuOne Nautilus plugin
3 *
4 * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
5 *
6 * Copyright 2009-2010 Canonical Ltd.
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 3, as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranties of
14 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef __CONTEXT_MENU_H__
23#define __CONTEXT_MENU_H__
24
25#include <libnautilus-extension/nautilus-menu-provider.h>
26#include "ubuntuone-nautilus.h"
27
28NautilusMenuItem *context_menu_new (UbuntuOneNautilus *uon,
29 GtkWidget *window,
30 GList *files);
31
32#endif
033
=== modified file 'nautilus/error-dialog.c'
--- nautilus/error-dialog.c 2010-08-02 10:40:26 +0000
+++ nautilus/error-dialog.c 2010-09-22 11:18:40 +0000
@@ -37,7 +37,7 @@
37 va_end (args);37 va_end (args);
3838
39 /* Show the dialog */39 /* Show the dialog */
40 dialog = gtk_message_dialog_new (GTK_WINDOW (uon->cb_data->parent),40 dialog = gtk_message_dialog_new (NULL,
41 GTK_DIALOG_DESTROY_WITH_PARENT,41 GTK_DIALOG_DESTROY_WITH_PARENT,
42 GTK_MESSAGE_ERROR,42 GTK_MESSAGE_ERROR,
43 GTK_BUTTONS_CLOSE,43 GTK_BUTTONS_CLOSE,
4444
=== modified file 'nautilus/location-widget.h'
--- nautilus/location-widget.h 2010-08-11 22:38:44 +0000
+++ nautilus/location-widget.h 2010-09-22 11:18:40 +0000
@@ -61,7 +61,4 @@
61GType location_widget_get_type (void);61GType location_widget_get_type (void);
62GtkWidget *location_widget_new (UbuntuOneNautilus *uon, const gchar *path);62GtkWidget *location_widget_new (UbuntuOneNautilus *uon, const gchar *path);
6363
64/* this is the wrong place for this, but it'll have to do for now */
65gboolean location_widget_check_shared_for_folder (SyncdaemonDaemon *daemon, SyncdaemonFolderInfo *folder_info, GtkWidget *widget);
66
67#endif64#endif
6865
=== modified file 'nautilus/ubuntuone-nautilus.c'
--- nautilus/ubuntuone-nautilus.c 2010-09-14 14:20:39 +0000
+++ nautilus/ubuntuone-nautilus.c 2010-09-22 11:18:40 +0000
@@ -33,8 +33,8 @@
33#include <libnautilus-extension/nautilus-location-widget-provider.h>33#include <libnautilus-extension/nautilus-location-widget-provider.h>
34#include <libsyncdaemon/libsyncdaemon.h>34#include <libsyncdaemon/libsyncdaemon.h>
35#include "ubuntuone-nautilus.h"35#include "ubuntuone-nautilus.h"
36#include "context-menu.h"
36#include "location-widget.h"37#include "location-widget.h"
37#include "share-dialog.h"
3838
39/* We need to do this explicitly because older versions of nautilus39/* We need to do this explicitly because older versions of nautilus
40 * don't seem to do it for us40 * don't seem to do it for us
@@ -49,17 +49,11 @@
49/* The header is generated from ubuntuone-marshallers.list */49/* The header is generated from ubuntuone-marshallers.list */
50#include "ubuntuone-marshallers.h"50#include "ubuntuone-marshallers.h"
5151
52/* This is used when a change is pending */
53#define UPDATE_PENDING "pending"
54
55static void ubuntuone_nautilus_finalize(GObject * object);52static void ubuntuone_nautilus_finalize(GObject * object);
5653
57static void ubuntuone_nautilus_register_type (GTypeModule * module);54static void ubuntuone_nautilus_register_type (GTypeModule * module);
5855
59/* Utility functions */56/* Utility functions */
60static void ubuntuone_nautilus_reset_emblem (UbuntuOneNautilus * uon,
61 const char * path);
62
63static void ubuntuone_nautilus_observed_file_unref (gpointer user_data,57static void ubuntuone_nautilus_observed_file_unref (gpointer user_data,
64 GObject *where_the_object_was);58 GObject *where_the_object_was);
6559
@@ -115,22 +109,6 @@
115109
116static GObjectClass * parent_class = NULL;110static GObjectClass * parent_class = NULL;
117111
118static void ubuntuone_nautilus_reset_emblem (UbuntuOneNautilus * uon,
119 const char * path) {
120
121 GHashTableIter iter;
122 gchar *key;
123 NautilusFileInfo *file;
124
125 /* Remove emblems from all files in the specified path */
126 g_hash_table_iter_init (&iter, uon->observed);
127 while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &file)) {
128 if (g_str_has_prefix (key, path) || g_strcmp0 (key, path) == 0) {
129 nautilus_file_info_invalidate_extension_info (file);
130 }
131 }
132}
133
134/* Called when NautilusFileInfo is unreferenced */112/* Called when NautilusFileInfo is unreferenced */
135static void ubuntuone_nautilus_observed_file_unref (gpointer user_data,113static void ubuntuone_nautilus_observed_file_unref (gpointer user_data,
136 GObject *where_the_object_was) {114 GObject *where_the_object_was) {
@@ -157,8 +135,8 @@
157 uon = UBUNTUONE_NAUTILUS(user_data);135 uon = UBUNTUONE_NAUTILUS(user_data);
158 file = NAUTILUS_FILE_INFO(value);136 file = NAUTILUS_FILE_INFO(value);
159137
160 g_object_weak_unref (G_OBJECT(file),138 g_object_weak_unref (G_OBJECT (file),
161 (GWeakNotify)ubuntuone_nautilus_observed_file_unref,139 (GWeakNotify) ubuntuone_nautilus_observed_file_unref,
162 uon);140 uon);
163141
164}142}
@@ -316,44 +294,16 @@
316 iface->update_file_info = ubuntuone_nautilus_update_file_info;294 iface->update_file_info = ubuntuone_nautilus_update_file_info;
317}295}
318296
319static gboolean
320show_location (void)
321{
322 GConfClient *conf_client;
323 GConfValue * show_location_value;
324 gboolean show_location;
325
326 conf_client = gconf_client_get_default ();
327 show_location_value = gconf_client_get (conf_client, EXPANDER_SHOWN_KEY, NULL);
328 g_object_unref (conf_client);
329
330 if (show_location_value == NULL) {
331 show_location = TRUE;
332 } else {
333 show_location = gconf_value_get_bool (show_location_value);
334 }
335 gconf_value_free (show_location_value);
336
337 return show_location;
338}
339
340static void toggle_location() {
341 GConfClient *conf_client;
342
343 conf_client = gconf_client_get_default ();
344 gconf_client_set_bool (conf_client, EXPANDER_SHOWN_KEY, !show_location(), NULL);
345}
346
347/* LocationWidget provider */297/* LocationWidget provider */
348static GtkWidget * ubuntuone_nautilus_get_location_widget(NautilusLocationWidgetProvider * provider,298static GtkWidget * ubuntuone_nautilus_get_location_widget (NautilusLocationWidgetProvider * provider,
349 const char * uri,299 const char * uri,
350 GtkWidget * parent) {300 GtkWidget * parent) {
351 UbuntuOneNautilus * uon;301 UbuntuOneNautilus * uon;
352 gchar *path;302 gchar *path;
353 GtkWidget *location;303 GtkWidget *location;
354304
355 /* if the bar is disabled, do nothing */305 /* if the bar is disabled, do nothing */
356 if (!show_location())306 if (!ubuntuone_is_location_bar_enabled ())
357 return NULL;307 return NULL;
358308
359 uon = UBUNTUONE_NAUTILUS (provider);309 uon = UBUNTUONE_NAUTILUS (provider);
@@ -378,151 +328,15 @@
378 iface->get_widget = ubuntuone_nautilus_get_location_widget;328 iface->get_widget = ubuntuone_nautilus_get_location_widget;
379}329}
380330
381static void __cb_data_free (struct _CBData * data) {
382 if (!data)
383 return;
384
385 data->uon = NULL;
386 data->parent = NULL;
387
388 if (data->path) {
389 g_free (data->path);
390 data->path = NULL;
391 }
392
393 g_free (data);
394
395 data = NULL;
396}
397
398/* Menu callbacks */
399static void ubuntuone_nautilus_public_meta (SyncdaemonFilesystemInterface *interface,
400 gboolean success,
401 SyncdaemonMetadata *metadata,
402 gpointer user_data) {
403 struct _CBData * data = (struct _CBData *) user_data;
404 GError * error = NULL;
405 const gchar * share_id, * node_id;
406 SyncdaemonInterface *public;
407
408 if (!success) {
409 g_warning ("ERROR: getting metadata for public file");
410 return;
411 }
412
413 share_id = syncdaemon_metadata_get_share_id (metadata);
414 node_id = syncdaemon_metadata_get_node_id (metadata);
415
416 public = syncdaemon_daemon_get_publicfiles_interface (data->uon->syncdaemon);
417 if (public != NULL) {
418 syncdaemon_publicfiles_interface_change_public_access (SYNCDAEMON_PUBLICFILES_INTERFACE (public),
419 share_id, node_id, data->make_public);
420 }
421}
422
423static void ubuntuone_nautilus_unsubscribe_folder (NautilusMenuItem *item,
424 gpointer user_data) {
425 SyncdaemonInterface *interface;
426 struct _CBData * data = (struct _CBData *) user_data;
427
428 /* Perform the removal of this folder */
429 interface = syncdaemon_daemon_get_folders_interface (data->uon->syncdaemon);
430 if (interface != NULL) {
431 SyncdaemonFolderInfo *folder_info;
432
433 folder_info = syncdaemon_folders_interface_get_info (SYNCDAEMON_FOLDERS_INTERFACE (interface),
434 data->path);
435 if (folder_info != NULL) {
436 if (ubuntuone_nautilus_check_shares_and_public_files (data->uon, folder_info, data->parent)) {
437 syncdaemon_folders_interface_delete (SYNCDAEMON_FOLDERS_INTERFACE (interface),
438 syncdaemon_folder_info_get_volume_id (folder_info));
439 }
440 g_object_unref (G_OBJECT (folder_info));
441 }
442 }
443}
444
445static void ubuntuone_nautilus_subscribe_folder (NautilusMenuItem *item,
446 gpointer user_data) {
447 SyncdaemonInterface *interface;
448 struct _CBData * data = (struct _CBData *) user_data;
449
450 /* Perform the addition of this folder */
451 interface = syncdaemon_daemon_get_folders_interface (data->uon->syncdaemon);
452 if (interface != NULL) {
453 /* If there is no user authenticated, make Syncdaemon do so */
454 if (!syncdaemon_authentication_has_credentials (syncdaemon_daemon_get_authentication (data->uon->syncdaemon)))
455 syncdaemon_daemon_connect (data->uon->syncdaemon);
456 syncdaemon_folders_interface_create (SYNCDAEMON_FOLDERS_INTERFACE (interface),
457 data->path);
458 }
459}
460
461static void ubuntuone_nautilus_copy_public_url (NautilusMenuItem * item,
462 gpointer user_data) {
463 struct _CBData * data = (struct _CBData *) user_data;
464 gchar * url;
465
466 url = g_hash_table_lookup (data->uon->public, data->path);
467 gtk_clipboard_set_text (gtk_clipboard_get(GDK_SELECTION_CLIPBOARD),
468 url, strlen (url));
469 gtk_clipboard_store (gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
470}
471
472static void ubuntuone_nautilus_toggle_publicity (NautilusMenuItem * item,
473 gpointer user_data) {
474 SyncdaemonFilesystemInterface *interface;
475 struct _CBData * data = (struct _CBData *) user_data;
476
477 interface = (SyncdaemonFilesystemInterface *) syncdaemon_daemon_get_filesystem_interface (data->uon->syncdaemon);
478 if (interface != NULL) {
479 /* we know this will not be a directory (so no need for _and_quick_tree_synced) */
480 syncdaemon_filesystem_interface_get_metadata_async (interface, data->path, FALSE,
481 (SyncdaemonGotMetadataFunc) ubuntuone_nautilus_public_meta,
482 data);
483 }
484
485 g_hash_table_replace (data->uon->public, g_strdup (data->path), UPDATE_PENDING);
486 ubuntuone_nautilus_reset_emblem (data->uon, data->path);
487}
488
489static void ubuntuone_nautilus_share_folder (NautilusMenuItem * item,
490 gpointer * user_data) {
491 struct _CBData * data = (struct _CBData *) user_data;
492 GtkWidget * dialog;
493
494 dialog = share_dialog_new (data->parent, data->uon, data->path);
495 gtk_widget_show (dialog);
496}
497
498static void ubuntuone_nautilus_unshare_folder (NautilusMenuItem * item,
499 gpointer * user_data) {
500 struct _CBData * data = (struct _CBData *) user_data;
501 gchar * share_id;
502 SyncdaemonSharesInterface *interface;
503
504 interface = (SyncdaemonSharesInterface *) syncdaemon_daemon_get_shares_interface (data->uon->syncdaemon);
505 if (interface != NULL) {
506 share_id = g_hash_table_lookup (data->uon->shares, data->path);
507 syncdaemon_shares_interface_delete (interface, share_id);
508 }
509}
510
511/* Menu provider */331/* Menu provider */
512static GList * ubuntuone_nautilus_get_menu_items (NautilusMenuProvider * provider,332static GList *
513 GtkWidget * window,333ubuntuone_nautilus_get_menu_items (NautilusMenuProvider * provider,
514 GList * files) {334 GtkWidget * window,
335 GList * files)
336{
515 UbuntuOneNautilus * uon;337 UbuntuOneNautilus * uon;
516 NautilusFileInfo * file;338 GList *items = NULL;
517 NautilusMenu * submenu;339 NautilusMenuItem *root_item;
518 NautilusMenuItem * root_item;
519 GList * items = NULL;
520 gchar * path;
521 gchar * item;
522 gchar * homedir_path;
523 gboolean is_managed, is_root, is_udf, is_public, is_shared, is_pending;
524 gboolean is_inhome, is_dir, is_regular;
525 struct _CBData * cb_data;
526340
527 uon = UBUNTUONE_NAUTILUS (provider);341 uon = UBUNTUONE_NAUTILUS (provider);
528342
@@ -530,260 +344,9 @@
530 if (!syncdaemon_daemon_is_ready (uon->syncdaemon))344 if (!syncdaemon_daemon_is_ready (uon->syncdaemon))
531 return NULL;345 return NULL;
532346
533 is_managed = is_root = is_udf = is_public = is_shared = is_pending = FALSE;347 root_item = context_menu_new (uon, window, files);
534 is_inhome = is_dir = is_regular = FALSE;348 if (root_item != NULL)
535349 items = g_list_append (items, root_item);
536 if (g_list_length (files) != 1)
537 return NULL;
538
539 file = g_list_nth_data (files, 0);
540 path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);
541
542 if (path == NULL)
543 goto done;
544
545 if (ubuntuone_is_storagefs (uon, path, &is_root))
546 is_managed = TRUE;
547
548 homedir_path = g_strdup_printf ("%s/", g_get_home_dir());
549 if (strncmp (path, homedir_path, strlen (homedir_path)) == 0)
550 is_inhome = TRUE;
551 g_free (homedir_path);
552
553 if ((item = g_hash_table_lookup (uon->udfs, path)) != NULL) {
554 is_udf = TRUE;
555 if (strcmp (item, UPDATE_PENDING) == 0)
556 is_pending = TRUE;
557 } else if ((item = g_hash_table_lookup (uon->public, path)) != NULL) {
558 is_public = TRUE;
559 if (strcmp (item, UPDATE_PENDING) == 0)
560 is_pending = TRUE;
561 }
562 if (g_hash_table_lookup (uon->shares, path) != NULL)
563 is_shared = TRUE;
564
565 is_dir = nautilus_file_info_is_directory (file);
566 is_regular = nautilus_file_info_get_file_type (file) == G_FILE_TYPE_REGULAR;
567
568 if (uon->cb_data)
569 __cb_data_free (uon->cb_data);
570
571 cb_data = g_new0 (struct _CBData, 1);
572 cb_data->uon = uon;
573 cb_data->parent = window;
574 cb_data->path = g_strdup (path);
575
576 uon->cb_data = cb_data;
577
578 root_item = nautilus_menu_item_new ("ubuntuone",
579 _("_Ubuntu One"),
580 _("Ubuntu One options"),
581 "ubuntuone");
582 submenu = nautilus_menu_new ();
583 nautilus_menu_item_set_submenu (root_item, submenu);
584
585 items = g_list_append (items, root_item);
586
587 /* Share/unshare */
588 {
589 NautilusMenuItem * item;
590
591 if ((is_managed || is_udf) && !is_root && is_dir) {
592
593 item = nautilus_menu_item_new ("ubuntuone-share",
594 _("_Share..."),
595 _("Share this folder on Ubuntu One"),
596 "ubuntuone");
597 if (is_pending)
598 g_object_set (item, "sensitive", FALSE, NULL);
599
600 g_signal_connect (item, "activate",
601 G_CALLBACK (ubuntuone_nautilus_share_folder),
602 cb_data);
603 } else {
604 /* the different tooltips will probably do us no good */
605 if (is_root) {
606 item = nautilus_menu_item_new ("ubuntuone-noshare-root",
607 _("_Share..."),
608 _("Sorry, you can't share the root of a Ubuntu One volume"),
609 "ubuntuone");
610 } else if (!(is_managed || is_udf)) {
611 item = nautilus_menu_item_new ("ubuntuone-noshare-unmanaged",
612 _("_Share..."),
613 _("Sorry, you can't share folders not managed by Ubuntu One"),
614 "ubuntuone");
615 } else {
616 item = nautilus_menu_item_new ("ubuntuone-noshare-unmanaged",
617 _("_Share..."),
618 _("Sorry, you can only share folders"),
619 "ubuntuone");
620 }
621 g_object_set (item, "sensitive", FALSE, NULL);
622 }
623
624 nautilus_menu_append_item (submenu, item);
625 }
626
627 if ((is_managed && is_shared) && !is_root && is_dir) {
628 NautilusMenuItem * item;
629
630 item = nautilus_menu_item_new ("ubuntuone-unshare",
631 _("Stop _Sharing"),
632 _("Stop sharing this folder on Ubuntu One"),
633 "ubuntuone");
634 if (is_pending)
635 g_object_set (item, "sensitive", FALSE, NULL);
636
637 g_signal_connect (item, "activate",
638 G_CALLBACK (ubuntuone_nautilus_unshare_folder),
639 cb_data);
640 nautilus_menu_append_item (submenu, item);
641 }
642
643 {
644 /* UDF logic
645 *
646 * XXX: clean this up and separate the logic out and reuse this
647 * and locationbar somewhere (libsd?)
648 */
649 NautilusMenuItem * item = NULL;
650 if (is_dir && is_inhome) {
651 /* UDFs could be happening */
652 if (is_managed) {
653 if (strcmp (path, uon->managed) == 0) {
654 /* the Ubuntu One directory, no UDFs */
655 item = nautilus_menu_item_new ("ubuntuone-no-disable-u1",
656 _("Stop Synchronizing This _Folder"),
657 _("Sorry, you can't stop synchronizing ~/Ubuntu One"),
658 "ubuntuone");
659 g_object_set (item, "sensitive", FALSE, NULL);
660 } else if (is_root) {
661 /* the root of a UDF: disabling possible */
662
663 item = nautilus_menu_item_new ("ubuntuone-disable-udf",
664 _("Stop Synchronizing This _Folder"),
665 _("Stop synchronizing this folder with Ubuntu One"),
666 "ubuntuone");
667
668 g_signal_connect (item, "activate",
669 G_CALLBACK (ubuntuone_nautilus_unsubscribe_folder),
670 cb_data);
671 }
672 } else {
673 /* unmanaged */
674
675 item = nautilus_menu_item_new ("ubuntuone-enable-udf",
676 _("Synchronize This _Folder"),
677 _("Start synchronizing this folder with Ubuntu One"),
678 "ubuntuone");
679
680 g_signal_connect (item, "activate",
681 G_CALLBACK (ubuntuone_nautilus_subscribe_folder),
682 cb_data);
683 }
684 } else {
685 if (is_dir) {
686 item = nautilus_menu_item_new ("ubuntuone-no-disable-u1",
687 _("Synchronize This _Folder"),
688 _("Sorry, you can only synchronize folders within your home folder"),
689 "ubuntuone");
690 } else {
691 item = nautilus_menu_item_new ("ubuntuone-no-disable-u1",
692 _("Synchronize This _Folder"),
693 _("Sorry, you can only synchronize folders"),
694 "ubuntuone");
695 }
696 g_object_set (item, "sensitive", FALSE, NULL);
697 }
698 if (!item) {
699 item = nautilus_menu_item_new ("ubuntuone-no-udf-operation-possible",
700 _("Synchronize This _Folder"),
701 _("Synchronization not possible for this folder"),
702 "ubuntuone");
703 g_object_set (item, "sensitive", FALSE, NULL);
704 }
705 nautilus_menu_append_item (submenu, item);
706 }
707
708 /* public files */
709 {
710 NautilusMenuItem * item = NULL, * urlitem = NULL;
711
712 if (is_managed && is_regular) {
713
714 if (is_public) {
715 urlitem = nautilus_menu_item_new ("ubuntuone-geturl",
716 _("Copy Web _Link"),
717 _("Copy the Ubuntu One public URL for this file to the clipboard."),
718 "ubuntuone");
719 if (is_pending)
720 g_object_set (urlitem, "sensitive", FALSE, NULL);
721
722 g_signal_connect (urlitem, "activate",
723 G_CALLBACK (ubuntuone_nautilus_copy_public_url),
724 cb_data);
725 item = nautilus_menu_item_new ("ubuntuone-unpublish",
726 _("Stop _Publishing"),
727 _("No longer share this file with everyone via Ubuntu One."),
728 "ubuntuone");
729 if (is_pending)
730 g_object_set (item, "sensitive", FALSE, NULL);
731
732 cb_data->make_public = FALSE;
733 } else {
734 item = nautilus_menu_item_new ("ubuntuone-publish",
735 _("_Publish"),
736 _("Make this file available to anyone via Ubuntu One."),
737 "ubuntuone");
738 cb_data->make_public = TRUE;
739 }
740 g_signal_connect (item, "activate",
741 G_CALLBACK (ubuntuone_nautilus_toggle_publicity),
742 cb_data);
743 }
744 if (!urlitem) {
745 urlitem = nautilus_menu_item_new ("ubuntuone-geturl",
746 _("Copy Web _Link"),
747 _("Sorry, no public URL for this file via Ubuntu One."),
748 "ubuntuone");
749 g_object_set (urlitem, "sensitive", FALSE, NULL);
750 }
751 if (!item) {
752 item = nautilus_menu_item_new ("ubuntuone-publish",
753 _("_Publish"),
754 _("Sorry, unable to publish via Ubuntu One."),
755 "ubuntuone");
756 g_object_set (item, "sensitive", FALSE, NULL);
757 }
758
759 nautilus_menu_append_item (submenu, item);
760 nautilus_menu_append_item (submenu, urlitem);
761 }
762
763 /* location bar enable/disable */
764 {
765 NautilusMenuItem * item;
766 if (show_location()) {
767 item = nautilus_menu_item_new ("ubuntuone-location-hide",
768 _("Hide _Ribbon"),
769 _("Do not show the Ubuntu One ribbon"
770 " in selected folders"),
771 "ubuntuone");
772 } else {
773 item = nautilus_menu_item_new ("ubuntuone-location-show",
774 _("Show _Ribbon in Some Folders"),
775 _("Show the Ubuntu One ribbon"
776 " in selected folders"),
777 "ubuntuone");
778 }
779 g_signal_connect (item, "activate",
780 G_CALLBACK (toggle_location),
781 cb_data);
782 nautilus_menu_append_item (submenu, item);
783 }
784
785 done:
786 g_free (path);
787350
788 return items;351 return items;
789}352}
@@ -876,8 +439,6 @@
876static void ubuntuone_nautilus_finalize(GObject * object) {439static void ubuntuone_nautilus_finalize(GObject * object) {
877 UbuntuOneNautilus * uon = UBUNTUONE_NAUTILUS(object);440 UbuntuOneNautilus * uon = UBUNTUONE_NAUTILUS(object);
878441
879 __cb_data_free (uon->cb_data);
880
881 if (uon->syncdaemon)442 if (uon->syncdaemon)
882 g_object_unref (uon->syncdaemon);443 g_object_unref (uon->syncdaemon);
883444
884445
=== modified file 'nautilus/ubuntuone-nautilus.h'
--- nautilus/ubuntuone-nautilus.h 2010-08-25 14:00:10 +0000
+++ nautilus/ubuntuone-nautilus.h 2010-09-22 11:18:40 +0000
@@ -31,8 +31,8 @@
31#define UBUNTUONE_TYPE_NAUTILUS (ubuntuone_nautilus_get_type ())31#define UBUNTUONE_TYPE_NAUTILUS (ubuntuone_nautilus_get_type ())
32#define UBUNTUONE_NAUTILUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTUONE_TYPE_NAUTILUS, UbuntuOneNautilus))32#define UBUNTUONE_NAUTILUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTUONE_TYPE_NAUTILUS, UbuntuOneNautilus))
3333
34/* Magical struct for passing data in callbacks */34/* This is used when a change is pending */
35typedef struct _CBData CBData;35#define UPDATE_PENDING "pending"
3636
37typedef struct {37typedef struct {
38 GObject parent_slot;38 GObject parent_slot;
@@ -65,33 +65,24 @@
6565
66 /* List of files that are observed for changes */66 /* List of files that are observed for changes */
67 GHashTable * observed;67 GHashTable * observed;
68
69 /* Extra data we need to free on finalization */
70 CBData * cb_data;
71} UbuntuOneNautilus;68} UbuntuOneNautilus;
7269
73typedef struct {70typedef struct {
74 GObjectClass parent_slot;71 GObjectClass parent_slot;
75} UbuntuOneNautilusClass;72} UbuntuOneNautilusClass;
7673
77struct _CBData {
78 UbuntuOneNautilus * uon;
79 gchar * path;
80 GtkWidget * parent;
81
82 /* Whether to make a file public or private */
83 gboolean make_public;
84};
85
86GType ubuntuone_nautilus_get_type (void);74GType ubuntuone_nautilus_get_type (void);
8775
88/* Utility functions */76/* Utility functions */
89gboolean ubuntuone_is_storagefs (UbuntuOneNautilus * uon,77gboolean ubuntuone_is_storagefs (UbuntuOneNautilus * uon,
90 const char * path,78 const char * path,
91 gboolean * is_root);79 gboolean * is_root);
80gboolean ubuntuone_is_location_bar_enabled (void);
81
92gboolean ubuntuone_nautilus_check_shares_and_public_files (UbuntuOneNautilus *uon,82gboolean ubuntuone_nautilus_check_shares_and_public_files (UbuntuOneNautilus *uon,
93 SyncdaemonFolderInfo *folder_info,83 SyncdaemonFolderInfo *folder_info,
94 GtkWidget *widget);84 GtkWidget *widget);
85void ubuntuone_nautilus_reset_emblem (UbuntuOneNautilus * uon, const char * path);
9586
96void ubuntuone_show_error_dialog (UbuntuOneNautilus *uon, const gchar *title, const gchar *error_message, ...);87void ubuntuone_show_error_dialog (UbuntuOneNautilus *uon, const gchar *title, const gchar *error_message, ...);
9788
9889
=== modified file 'nautilus/utils.c'
--- nautilus/utils.c 2010-09-01 17:50:47 +0000
+++ nautilus/utils.c 2010-09-22 11:18:40 +0000
@@ -20,8 +20,10 @@
20 */20 */
2121
22#include <glib/gi18n.h>22#include <glib/gi18n.h>
23#include <libnautilus-extension/nautilus-file-info.h>
23#include <libsyncdaemon/syncdaemon-shares-interface.h>24#include <libsyncdaemon/syncdaemon-shares-interface.h>
24#include "ubuntuone-nautilus.h"25#include "ubuntuone-nautilus.h"
26#include "location-widget.h"
2527
26/* this is the wrong place for this, but it'll have to do for now */28/* this is the wrong place for this, but it'll have to do for now */
27gboolean29gboolean
@@ -98,3 +100,40 @@
98100
99 return result;101 return result;
100}102}
103
104gboolean
105ubuntuone_is_location_bar_enabled (void)
106{
107 GConfClient *conf_client;
108 GConfValue * show_location_value;
109 gboolean show_location;
110
111 conf_client = gconf_client_get_default ();
112 show_location_value = gconf_client_get (conf_client, EXPANDER_SHOWN_KEY, NULL);
113 g_object_unref (conf_client);
114
115 if (show_location_value == NULL)
116 show_location = TRUE;
117 else
118 show_location = gconf_value_get_bool (show_location_value);
119
120 gconf_value_free (show_location_value);
121
122 return show_location;
123}
124
125void
126ubuntuone_nautilus_reset_emblem (UbuntuOneNautilus *uon, const char *path)
127{
128 GHashTableIter iter;
129 gchar *key;
130 NautilusFileInfo *file;
131
132 /* Remove emblems from all files in the specified path */
133 g_hash_table_iter_init (&iter, uon->observed);
134 while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &file)) {
135 if (g_str_has_prefix (key, path) || g_strcmp0 (key, path) == 0) {
136 nautilus_file_info_invalidate_extension_info (file);
137 }
138 }
139}
101140
=== modified file 'po/POTFILES.in'
--- po/POTFILES.in 2010-08-25 20:00:32 +0000
+++ po/POTFILES.in 2010-09-22 11:18:40 +0000
@@ -7,6 +7,7 @@
7nautilus/add-contact-dialog.c7nautilus/add-contact-dialog.c
8nautilus/ubuntuone-nautilus.c8nautilus/ubuntuone-nautilus.c
9nautilus/contacts-view.c9nautilus/contacts-view.c
10nautilus/context-menu.c
10nautilus/u1-contacts-picker.c11nautilus/u1-contacts-picker.c
11nautilus/location-widget.c12nautilus/location-widget.c
12nautilus/share-dialog.c13nautilus/share-dialog.c

Subscribers

People subscribed via source and target branches