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
=== modified file 'nautilus/ubuntuone-nautilus.c'
--- nautilus/ubuntuone-nautilus.c 2009-10-09 18:28:44 +0000
+++ nautilus/ubuntuone-nautilus.c 2009-10-13 14:25:17 +0000
@@ -43,6 +43,7 @@
43#include <string.h>43#include <string.h>
44#include <sys/stat.h>44#include <sys/stat.h>
45#include <sys/types.h>45#include <sys/types.h>
46#include <utime.h>
4647
47#define UBUNTUONE_TYPE_NAUTILUS (ubuntuone_nautilus_get_type ())48#define UBUNTUONE_TYPE_NAUTILUS (ubuntuone_nautilus_get_type ())
48#define UBUNTUONE_NAUTILUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTUONE_TYPE_NAUTILUS, UbuntuOneNautilus))49#define UBUNTUONE_NAUTILUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UBUNTUONE_TYPE_NAUTILUS, UbuntuOneNautilus))
@@ -158,40 +159,39 @@
158 GClosure * update_complete,159 GClosure * update_complete,
159 NautilusOperationHandle ** handle) {160 NautilusOperationHandle ** handle) {
160 UbuntuOneNautilus * uon;161 UbuntuOneNautilus * uon;
161 gchar * share_status = NULL;
162 char * path = NULL;162 char * path = NULL;
163 int size = 0, ret = 0;
164163
165 uon = UBUNTUONE_NAUTILUS(provider);164 uon = UBUNTUONE_NAUTILUS(provider);
166165
167 path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);166 path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);
168167
169 if (path) {168 if (!path || !ubuntuone_is_storagefs (uon, path))
170 if (!g_hash_table_lookup (uon->updated, path) &&169 goto updating_meta;
171 !g_hash_table_lookup (uon->needsupdating, path)) {170
172 /* Add the synchronized emblem anyway, and update later */171 if (!g_hash_table_lookup (uon->updated, path) &&
173 nautilus_file_info_add_emblem (file, "ubuntuone-synchronized");172 !g_hash_table_lookup (uon->needsupdating, path)) {
174 dbus_g_proxy_begin_call (uon->u1_fs, "get_metadata",173 /* Add the synchronized emblem anyway, and update later */
175 ubuntuone_nautilus_update_meta, uon,174 nautilus_file_info_add_emblem (file, "ubuntuone-synchronized");
176 NULL, G_TYPE_STRING, path, G_TYPE_INVALID);175 dbus_g_proxy_begin_call (uon->u1_fs, "get_metadata",
177 goto updating_meta;176 ubuntuone_nautilus_update_meta, uon,
178 }177 NULL, G_TYPE_STRING, path, G_TYPE_INVALID);
179178 goto updating_meta;
180 if (g_hash_table_lookup (uon->uploads, path) ||
181 g_hash_table_lookup (uon->downloads, path))
182 nautilus_file_info_add_emblem (file, "ubuntuone-updating");
183 else if (g_hash_table_lookup (uon->updated, path))
184 nautilus_file_info_add_emblem (file, "ubuntuone-synchronized");
185 else if (g_hash_table_lookup (uon->needsupdating, path))
186 nautilus_file_info_add_emblem (file, "ubuntuone-unsynchronized");
187
188 if (g_hash_table_lookup (uon->shares, path))
189 nautilus_file_info_add_emblem (file, "shared");
190
191 updating_meta:
192 g_free (path);
193 }179 }
194180
181 if (g_hash_table_lookup (uon->uploads, path) ||
182 g_hash_table_lookup (uon->downloads, path))
183 nautilus_file_info_add_emblem (file, "ubuntuone-updating");
184 else if (g_hash_table_lookup (uon->updated, path))
185 nautilus_file_info_add_emblem (file, "ubuntuone-synchronized");
186 else if (g_hash_table_lookup (uon->needsupdating, path))
187 nautilus_file_info_add_emblem (file, "ubuntuone-unsynchronized");
188
189 if (g_hash_table_lookup (uon->shares, path))
190 nautilus_file_info_add_emblem (file, "shared");
191
192 updating_meta:
193 g_free (path);
194
195 return NAUTILUS_OPERATION_COMPLETE;195 return NAUTILUS_OPERATION_COMPLETE;
196}196}
197197
@@ -675,7 +675,6 @@
675675
676static void ubuntuone_nautilus_finalize(GObject * object) {676static void ubuntuone_nautilus_finalize(GObject * object) {
677 UbuntuOneNautilus * uon = UBUNTUONE_NAUTILUS(object);677 UbuntuOneNautilus * uon = UBUNTUONE_NAUTILUS(object);
678 GSList * l;
679678
680 __share_cb_data_free (uon->share_cb_data);679 __share_cb_data_free (uon->share_cb_data);
681680

Subscribers

People subscribed via source and target branches