Merge lp:~dobey/ubuntuone-client/get-published-race into lp:ubuntuone-client/stable-1-4

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 750
Merged at revision: 750
Proposed branch: lp:~dobey/ubuntuone-client/get-published-race
Merge into: lp:ubuntuone-client/stable-1-4
Diff against target: 43 lines (+16/-0)
2 files modified
nautilus/ubuntuone-nautilus.c (+15/-0)
nautilus/ubuntuone-nautilus.h (+1/-0)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/get-published-race
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
John O'Brien (community) Approve
Review via email: mp+52142@code.launchpad.net

Commit message

Add a timeout if we haven't loaded the published files list to avoid a race
condition where this callback gets called before sd is online, and never again

To post a comment you must log in.
Revision history for this message
John O'Brien (jdobrien) wrote :

Looks good.

review: Approve
Revision history for this message
Roberto Alsina (ralsina) wrote :

+1

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 2011-02-14 14:35:26 +0000
3+++ nautilus/ubuntuone-nautilus.c 2011-03-03 22:43:57 +0000
4@@ -1037,6 +1037,15 @@
5 }
6 }
7
8+static gboolean
9+_ubuntuone_ready_timeout_cb (gpointer data)
10+{
11+ UbuntuOneNautilus * uon = UBUNTUONE_NAUTILUS (data);
12+ ubuntuone_nautilus_daemon_ready (uon->syncdaemon, uon);
13+
14+ return FALSE;
15+}
16+
17 static void
18 ubuntuone_nautilus_daemon_ready (SyncdaemonDaemon *daemon, gpointer user_data)
19 {
20@@ -1076,6 +1085,12 @@
21 }
22
23 g_slist_free (folders);
24+ } else {
25+ if (uon->public_id != 0) {
26+ g_source_remove (uon->public_id);
27+ uon->public_id = 0;
28+ }
29+ uon->public_id = g_timeout_add_seconds (5, (GSourceFunc) _ubuntuone_ready_timeout_cb, uon);
30 }
31 }
32
33
34=== modified file 'nautilus/ubuntuone-nautilus.h'
35--- nautilus/ubuntuone-nautilus.h 2010-08-25 14:00:10 +0000
36+++ nautilus/ubuntuone-nautilus.h 2011-03-03 22:43:57 +0000
37@@ -56,6 +56,7 @@
38 GHashTable * shares;
39
40 /* Lists of public files and user defined folders */
41+ guint public_id;
42 GHashTable * public;
43 GHashTable * udfs;
44

Subscribers

People subscribed via source and target branches

to all changes: