Merge lp:~dobey/libubuntuone/crash-workaround into lp:libubuntuone

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 138
Merged at revision: 139
Proposed branch: lp:~dobey/libubuntuone/crash-workaround
Merge into: lp:libubuntuone
Diff against target: 84 lines (+11/-28)
1 file modified
libubuntuone/u1-music-store.c (+11/-28)
To merge this branch: bzr merge lp:~dobey/libubuntuone/crash-workaround
Reviewer Review Type Date Requested Status
Roman Yepishev (community) fieldtest Approve
Review via email: mp+77583@code.launchpad.net

Commit message

Work around a crash introduced by changes in WebKit 1.4.3

To post a comment you must log in.
Revision history for this message
Roman Yepishev (rye) wrote :

Looks good!

review: Approve (fieldtest)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libubuntuone/u1-music-store.c'
2--- libubuntuone/u1-music-store.c 2011-09-09 15:11:47 +0000
3+++ libubuntuone/u1-music-store.c 2011-09-29 18:32:23 +0000
4@@ -58,7 +58,6 @@
5 gchar *base_url;
6
7 GtkWidget *scroll;
8- GtkWidget *initial_web_viewer;
9 GtkWidget *web_viewer;
10 WebKitWebFrame *frame_to_use;
11 GtkWidget *progress;
12@@ -867,16 +866,6 @@
13
14 uri = soup_uri_new (webkit_web_view_get_uri (web_view));
15
16- /* Remove the initial view if still around */
17- if (music_store->priv->initial_web_viewer != NULL) {
18- gtk_widget_destroy (music_store->priv->initial_web_viewer);
19- music_store->priv->initial_web_viewer = NULL;
20-
21- /* And show the real store viewer */
22- gtk_widget_show (music_store->priv->web_viewer);
23- gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->web_viewer);
24- }
25-
26 /* Inject some JavaScript to enable previews and hide the Flash player */
27 execute_script (web_view, "u1-preview.js", NULL);
28
29@@ -1231,19 +1220,13 @@
30 folder_info = syncdaemon_daemon_get_folder_info (music_store->priv->syncdaemon, u1_music_store_get_library_location (music_store));
31 music_store->priv->folder_subscribed = syncdaemon_folder_info_get_subscribed (folder_info);
32
33- /* Create a hidden progress bar */
34- music_store->priv->progress = gtk_progress_bar_new ();
35-
36 g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "notify",
37 G_CALLBACK (viewer_property_changed_cb), music_store);
38
39 /* And load the real store in the background */
40 music_store->priv->idle_cb = g_idle_add ((GSourceFunc) load_real_store_cb, music_store);
41
42- gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->alertbar, FALSE, FALSE, 6);
43- gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 0);
44- gtk_box_pack_end (GTK_BOX (music_store), music_store->priv->progress, FALSE, FALSE, 0);
45-
46+ /* Rescan the purchased music folder */
47 _u1_music_store_rescan_purchased_folder (music_store);
48
49 return FALSE;
50@@ -1323,17 +1306,10 @@
51 G_CALLBACK (load_error_cb), music_store);
52
53 /* Show a temp view when loading the initial store page */
54- music_store->priv->initial_web_viewer = webkit_web_view_new ();
55- g_object_set (G_OBJECT (webkit_web_view_get_settings (WEBKIT_WEB_VIEW (music_store->priv->initial_web_viewer))),
56- "user-agent", new_user_agent,
57- "default-encoding", DEFAULT_ENCODING,
58- "enable-default-context-menu", g_getenv ("U1SHOWCONTEXTMENU") != NULL,
59- "enable-plugins", FALSE,
60- NULL);
61- load_internal_html_page (WEBKIT_WEB_VIEW (music_store->priv->initial_web_viewer),
62+ load_internal_html_page (WEBKIT_WEB_VIEW (music_store->priv->web_viewer),
63 U1_CONNECTING_PAGE, NULL);
64- gtk_widget_show (music_store->priv->initial_web_viewer);
65- gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->initial_web_viewer);
66+ gtk_widget_show (music_store->priv->web_viewer);
67+ gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->web_viewer);
68
69 /* Create the alert bar */
70 music_store->priv->alertbar = gtk_hbox_new (FALSE, 12);
71@@ -1370,6 +1346,13 @@
72 g_signal_connect (G_OBJECT (music_store->priv->subscribe_btn), "clicked",
73 G_CALLBACK (subscribe_purchased_folder), music_store);
74
75+ /* Create a hidden progress bar */
76+ music_store->priv->progress = gtk_progress_bar_new ();
77+
78+ gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->alertbar, FALSE, FALSE, 6);
79+ gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 0);
80+ gtk_box_pack_end (GTK_BOX (music_store), music_store->priv->progress, FALSE, FALSE, 0);
81+
82 g_timeout_add_seconds(10, (GSourceFunc) _u1_music_store_delayed_init,
83 music_store);
84 }

Subscribers

People subscribed via source and target branches