Merge lp:~midori/midori/notifyBrowser into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: André Stösel
Approved revision: 6599
Merged at revision: 6655
Proposed branch: lp:~midori/midori/notifyBrowser
Merge into: lp:midori
Diff against target: 90 lines (+19/-11)
1 file modified
midori/midori-browser.c (+19/-11)
To merge this branch: bzr merge lp:~midori/midori/notifyBrowser
Reviewer Review Type Date Requested Status
André Stösel Approve
Review via email: mp+211140@code.launchpad.net

Commit message

Clean up browser tab/ uri/ title notify

Description of the change

To post a comment you must log in.
lp:~midori/midori/notifyBrowser updated
6599. By Cris Dywan

Move notify for URI out of commit condition

Revision history for this message
Paweł Forysiuk (tuxator) wrote :

Looks sensible from just reading the code but i would leave it for another round maybe.
Could potentially change something subtly so i am wary to get this in just before relase.

Looks like nice unification but could use some testing.

Revision history for this message
André Stösel (ivaldi) wrote :

It seems to work ;)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-browser.c'
2--- midori/midori-browser.c 2014-03-10 22:54:10 +0000
3+++ midori/midori-browser.c 2014-03-16 13:09:19 +0000
4@@ -673,7 +673,6 @@
5 GtkAction* action = _action_by_name (browser, "Location");
6 midori_location_action_set_text (
7 MIDORI_LOCATION_ACTION (action), uri);
8- g_object_notify (G_OBJECT (browser), "uri");
9 }
10
11 _midori_browser_update_interface (browser, view);
12@@ -709,6 +708,7 @@
13 midori_location_action_set_text (MIDORI_LOCATION_ACTION (action), uri);
14 _action_set_sensitive (browser, "Back", midori_view_can_go_back (view));
15 _action_set_sensitive (browser, "Forward", midori_tab_can_go_forward (MIDORI_TAB (view)));
16+ g_object_notify (G_OBJECT (browser), "uri");
17 }
18 }
19
20@@ -736,7 +736,10 @@
21 {
22 MidoriView* view = MIDORI_VIEW (widget);
23 if (widget == midori_browser_get_current_tab (browser))
24+ {
25 midori_browser_set_title (browser, midori_view_get_display_title (view));
26+ g_object_notify (G_OBJECT (browser), "title");
27+ }
28 midori_browser_step_history (browser, view);
29 }
30
31@@ -4950,18 +4953,25 @@
32 if (midori_paths_get_runtime_mode () == MIDORI_RUNTIME_MODE_APP)
33 gtk_window_set_icon (GTK_WINDOW (browser), midori_view_get_icon (new_view));
34
35- g_object_freeze_notify (G_OBJECT (browser));
36- g_object_notify (G_OBJECT (browser), "uri");
37- g_object_notify (G_OBJECT (browser), "tab");
38- g_object_thaw_notify (G_OBJECT (browser));
39 g_signal_emit (browser, signals[SWITCH_TAB], 0, old_widget, new_view);
40-
41 _midori_browser_set_statusbar_text (browser, new_view, NULL);
42 _midori_browser_update_interface (browser, new_view);
43 _midori_browser_update_progress (browser, new_view);
44 }
45
46 static void
47+midori_browser_notify_tab_cb (GtkWidget* notebook,
48+ GParamSpec* pspec,
49+ MidoriBrowser* browser)
50+{
51+ g_object_freeze_notify (G_OBJECT (browser));
52+ g_object_notify (G_OBJECT (browser), "uri");
53+ g_object_notify (G_OBJECT (browser), "title");
54+ g_object_notify (G_OBJECT (browser), "tab");
55+ g_object_thaw_notify (G_OBJECT (browser));
56+}
57+
58+static void
59 midori_browser_tab_moved_cb (GtkWidget* notebook,
60 MidoriView* view,
61 guint page_num,
62@@ -4969,7 +4979,6 @@
63 {
64 KatzeItem* item = midori_view_get_proxy_item (view);
65 katze_array_move_item (browser->proxy_array, item, page_num);
66- g_object_notify (G_OBJECT (browser), "tab");
67 }
68
69 static void
70@@ -6083,6 +6092,8 @@
71 g_signal_connect (browser->notebook, "tab-switched",
72 G_CALLBACK (midori_browser_switched_tab_cb),
73 browser);
74+ g_signal_connect (browser->notebook, "notify::tab",
75+ G_CALLBACK (midori_browser_notify_tab_cb), browser);
76 g_signal_connect (browser->notebook, "tab-moved",
77 G_CALLBACK (midori_browser_tab_moved_cb),
78 browser);
79@@ -7384,10 +7395,7 @@
80 else
81 gtk_widget_grab_focus (view);
82
83- g_object_freeze_notify (G_OBJECT (browser));
84- g_object_notify (G_OBJECT (browser), "uri");
85- g_object_notify (G_OBJECT (browser), "tab");
86- g_object_thaw_notify (G_OBJECT (browser));
87+ midori_browser_notify_tab_cb (browser->notebook, NULL, browser);
88 }
89
90 /**

Subscribers

People subscribed via source and target branches

to all changes: