Merge lp:~ivaldi/midori/tabby-delayed-change-events into lp:midori

Proposed by André Stösel
Status: Merged
Approved by: Cris Dywan
Approved revision: 6413
Merged at revision: 6413
Proposed branch: lp:~ivaldi/midori/tabby-delayed-change-events
Merge into: lp:midori
Diff against target: 57 lines (+19/-10)
1 file modified
extensions/tabby.vala (+19/-10)
To merge this branch: bzr merge lp:~ivaldi/midori/tabby-delayed-change-events
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+187838@code.launchpad.net

Commit message

don't change uri/title if the tab isn't loaded

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice to get that fixed! I switched to only some of the tabs in a session with restarts after that to verfiy and the titles appear where they should.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'extensions/tabby.vala'
--- extensions/tabby.vala 2013-09-26 11:00:38 +0000
+++ extensions/tabby.vala 2013-09-26 16:26:40 +0000
@@ -75,12 +75,12 @@
7575
76 public void attach (Midori.Browser browser) {76 public void attach (Midori.Browser browser) {
77 browser.add_tab.connect (this.tab_added);77 browser.add_tab.connect (this.tab_added);
78 browser.add_tab.connect (this.helper_uri_changed);78 browser.add_tab.connect (this.helper_data_changed);
79 browser.remove_tab.connect (this.tab_removed);79 browser.remove_tab.connect (this.tab_removed);
8080
81 foreach (Midori.View view in browser.get_tabs ()) {81 foreach (Midori.View view in browser.get_tabs ()) {
82 this.tab_added (browser, view);82 this.tab_added (browser, view);
83 this.helper_uri_changed (browser, view);83 this.helper_data_changed (browser, view);
84 }84 }
85 }85 }
8686
@@ -94,7 +94,7 @@
94 }94 }
9595
96 browser.add_tab.connect (this.tab_added);96 browser.add_tab.connect (this.tab_added);
97 browser.add_tab.connect (this.helper_uri_changed);97 browser.add_tab.connect (this.helper_data_changed);
98 browser.remove_tab.connect (this.tab_removed);98 browser.remove_tab.connect (this.tab_removed);
9999
100 GLib.List<unowned Katze.Item> items = tabs.get_items ();100 GLib.List<unowned Katze.Item> items = tabs.get_items ();
@@ -125,13 +125,22 @@
125 });125 });
126 }126 }
127127
128 private void helper_uri_changed (Midori.Browser browser, Midori.View view) {128 private void helper_data_changed (Midori.Browser browser, Midori.View view) {
129 /* FixMe: skip first event while restoring the session */129 ulong sig_id = 0;
130 view.web_view.notify["uri"].connect ( () => {130 sig_id = view.web_view.load_started.connect (() => {
131 this.uri_changed (view, view.web_view.uri);131 unowned Katze.Item item = view.get_proxy_item ();
132 });132
133 view.web_view.notify["title"].connect ( () => {133 int64 delay = item.get_meta_integer ("delay");
134 this.data_changed (view);134 if (delay == Midori.Delay.UNDELAYED) {
135 view.web_view.notify["uri"].connect ( () => {
136 this.uri_changed (view, view.web_view.uri);
137 });
138 view.web_view.notify["title"].connect ( () => {
139 this.data_changed (view);
140 });
141
142 GLib.SignalHandler.disconnect (view.web_view, sig_id);
143 }
135 });144 });
136 }145 }
137 }146 }

Subscribers

People subscribed via source and target branches

to all changes: