Merge lp:~dobey/ubuntuone-client/nautilus-bad-emblems into lp:ubuntuone-client

Proposed by dobey
Status: Merged
Approved by: Nicola Larosa
Approved revision: 252
Merged at revision: not available
Proposed branch: lp:~dobey/ubuntuone-client/nautilus-bad-emblems
Merge into: lp:ubuntuone-client
Diff against target: 84 lines
1 file modified
nautilus/ubuntuone-nautilus.c (+26/-27)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/nautilus-bad-emblems
Reviewer Review Type Date Requested Status
Nicola Larosa (community) Approve
Rick McBride (community) Approve
Review via email: mp+13282@code.launchpad.net

Commit message

Only set emblems on files *in* the Ubuntu One managed folder

To post a comment you must log in.
Revision history for this message
Rick McBride (rmcbride) wrote :

+1

review: Approve
Revision history for this message
Nicola Larosa (teknico) wrote :

Looks good (goto usage notwithstanding ;-P ).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nautilus/ubuntuone-nautilus.c'
2--- nautilus/ubuntuone-nautilus.c 2009-10-09 18:28:44 +0000
3+++ nautilus/ubuntuone-nautilus.c 2009-10-13 14:25:17 +0000
4@@ -43,6 +43,7 @@
5 #include <string.h>
6 #include <sys/stat.h>
7 #include <sys/types.h>
8+#include <utime.h>
9
10 #define UBUNTUONE_TYPE_NAUTILUS (ubuntuone_nautilus_get_type ())
11 #define UBUNTUONE_NAUTILUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTUONE_TYPE_NAUTILUS, UbuntuOneNautilus))
12@@ -158,40 +159,39 @@
13 GClosure * update_complete,
14 NautilusOperationHandle ** handle) {
15 UbuntuOneNautilus * uon;
16- gchar * share_status = NULL;
17 char * path = NULL;
18- int size = 0, ret = 0;
19
20 uon = UBUNTUONE_NAUTILUS(provider);
21
22 path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);
23
24- if (path) {
25- if (!g_hash_table_lookup (uon->updated, path) &&
26- !g_hash_table_lookup (uon->needsupdating, path)) {
27- /* Add the synchronized emblem anyway, and update later */
28- nautilus_file_info_add_emblem (file, "ubuntuone-synchronized");
29- dbus_g_proxy_begin_call (uon->u1_fs, "get_metadata",
30- ubuntuone_nautilus_update_meta, uon,
31- NULL, G_TYPE_STRING, path, G_TYPE_INVALID);
32- goto updating_meta;
33- }
34-
35- if (g_hash_table_lookup (uon->uploads, path) ||
36- g_hash_table_lookup (uon->downloads, path))
37- nautilus_file_info_add_emblem (file, "ubuntuone-updating");
38- else if (g_hash_table_lookup (uon->updated, path))
39- nautilus_file_info_add_emblem (file, "ubuntuone-synchronized");
40- else if (g_hash_table_lookup (uon->needsupdating, path))
41- nautilus_file_info_add_emblem (file, "ubuntuone-unsynchronized");
42-
43- if (g_hash_table_lookup (uon->shares, path))
44- nautilus_file_info_add_emblem (file, "shared");
45-
46- updating_meta:
47- g_free (path);
48+ if (!path || !ubuntuone_is_storagefs (uon, path))
49+ goto updating_meta;
50+
51+ if (!g_hash_table_lookup (uon->updated, path) &&
52+ !g_hash_table_lookup (uon->needsupdating, path)) {
53+ /* Add the synchronized emblem anyway, and update later */
54+ nautilus_file_info_add_emblem (file, "ubuntuone-synchronized");
55+ dbus_g_proxy_begin_call (uon->u1_fs, "get_metadata",
56+ ubuntuone_nautilus_update_meta, uon,
57+ NULL, G_TYPE_STRING, path, G_TYPE_INVALID);
58+ goto updating_meta;
59 }
60
61+ if (g_hash_table_lookup (uon->uploads, path) ||
62+ g_hash_table_lookup (uon->downloads, path))
63+ nautilus_file_info_add_emblem (file, "ubuntuone-updating");
64+ else if (g_hash_table_lookup (uon->updated, path))
65+ nautilus_file_info_add_emblem (file, "ubuntuone-synchronized");
66+ else if (g_hash_table_lookup (uon->needsupdating, path))
67+ nautilus_file_info_add_emblem (file, "ubuntuone-unsynchronized");
68+
69+ if (g_hash_table_lookup (uon->shares, path))
70+ nautilus_file_info_add_emblem (file, "shared");
71+
72+ updating_meta:
73+ g_free (path);
74+
75 return NAUTILUS_OPERATION_COMPLETE;
76 }
77
78@@ -675,7 +675,6 @@
79
80 static void ubuntuone_nautilus_finalize(GObject * object) {
81 UbuntuOneNautilus * uon = UBUNTUONE_NAUTILUS(object);
82- GSList * l;
83
84 __share_cb_data_free (uon->share_cb_data);
85

Subscribers

People subscribed via source and target branches