Merge lp:~dobey/libubuntuone/update-from-trunk into lp:libubuntuone/stable-3-0

Proposed by dobey on 2012-04-03
Status: Merged
Approved by: dobey on 2012-04-03
Approved revision: no longer in the source branch.
Merged at revision: 155
Proposed branch: lp:~dobey/libubuntuone/update-from-trunk
Merge into: lp:libubuntuone/stable-3-0
Diff against target: 80 lines (+0/-64)
1 file modified
libubuntuoneui/u1-music-store.c (+0/-64)
To merge this branch: bzr merge lp:~dobey/libubuntuone/update-from-trunk
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve on 2012-04-03
Eric Casteleijn (community) 2012-04-03 Approve on 2012-04-03
Review via email: mp+100658@code.launchpad.net

Commit Message

Remove the rescanning of purchased folder on startup to avoid potential race

To post a comment you must log in.
Eric Casteleijn (thisfred) wrote :

+1 machete

review: Approve
review: Approve
155. By dobey on 2012-04-03

Remove the rescanning of purchased folder on startup to avoid potential race

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libubuntuoneui/u1-music-store.c'
2--- libubuntuoneui/u1-music-store.c 2012-03-06 21:26:43 +0000
3+++ libubuntuoneui/u1-music-store.c 2012-04-03 17:44:25 +0000
4@@ -1151,67 +1151,6 @@
5 syncdaemon_folder_info_get_volume_id (folder_info));
6 }
7
8-static void
9-_u1_purchased_enumerate (GObject *source, GAsyncResult *result,
10- gpointer user_data)
11-{
12- U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
13- GFile *dir = G_FILE (source);
14- GFileEnumerator *files;
15- GFileInfo *info;
16- GError *error = NULL;
17-
18- files = g_file_enumerate_children_finish (dir, result, &error);
19-
20- if (error != NULL) {
21- g_warning ("Error rescanning Purchased Music: %s", error->message);
22- g_error_free (error);
23- return;
24- }
25-
26- while ((info = g_file_enumerator_next_file (files, NULL, NULL)) != NULL) {
27- gchar *path;
28-
29- path = g_build_filename (g_file_get_path (dir),
30- g_file_info_get_name (info),
31- NULL);
32- if (g_file_test (path, G_FILE_TEST_IS_DIR)) {
33- GFile *subdir = g_file_new_for_path (path);
34- g_file_enumerate_children_async (subdir,
35- G_FILE_ATTRIBUTE_STANDARD_NAME,
36- G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
37- G_PRIORITY_DEFAULT, NULL,
38- (GAsyncReadyCallback) _u1_purchased_enumerate,
39- music_store);
40- } else if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) {
41- g_signal_emit (music_store,
42- u1_music_store_signals[DOWNLOAD_FINISHED_SIGNAL], 0,
43- (const gchar *) path);
44- }
45-
46- g_free (path);
47- g_object_unref (info);
48- }
49- g_file_enumerator_close (files, NULL, NULL);
50- g_object_unref (dir);
51-}
52-
53-static void
54-_u1_music_store_rescan_purchased_folder (U1MusicStore *music_store)
55-{
56- GFile *dir;
57- const gchar *path;
58-
59- path = u1_music_store_get_library_location (music_store);
60- dir = g_file_new_for_path (path);
61- g_file_enumerate_children_async (dir,
62- G_FILE_ATTRIBUTE_STANDARD_NAME,
63- G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
64- G_PRIORITY_DEFAULT, NULL,
65- (GAsyncReadyCallback) _u1_purchased_enumerate,
66- music_store);
67-}
68-
69 static gboolean
70 _u1_music_store_delayed_init (gpointer user_data)
71 {
72@@ -1222,9 +1161,6 @@
73 folder_info = syncdaemon_daemon_get_folder_info (music_store->priv->syncdaemon, u1_music_store_get_library_location (music_store));
74 music_store->priv->folder_subscribed = syncdaemon_folder_info_get_subscribed (folder_info);
75
76- /* Rescan the purchased music folder */
77- _u1_music_store_rescan_purchased_folder (music_store);
78-
79 return FALSE;
80 }
81

Subscribers

People subscribed via source and target branches

to all changes: