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
1=== modified file 'extensions/tabby.vala'
2--- extensions/tabby.vala 2013-09-26 11:00:38 +0000
3+++ extensions/tabby.vala 2013-09-26 16:26:40 +0000
4@@ -75,12 +75,12 @@
5
6 public void attach (Midori.Browser browser) {
7 browser.add_tab.connect (this.tab_added);
8- browser.add_tab.connect (this.helper_uri_changed);
9+ browser.add_tab.connect (this.helper_data_changed);
10 browser.remove_tab.connect (this.tab_removed);
11
12 foreach (Midori.View view in browser.get_tabs ()) {
13 this.tab_added (browser, view);
14- this.helper_uri_changed (browser, view);
15+ this.helper_data_changed (browser, view);
16 }
17 }
18
19@@ -94,7 +94,7 @@
20 }
21
22 browser.add_tab.connect (this.tab_added);
23- browser.add_tab.connect (this.helper_uri_changed);
24+ browser.add_tab.connect (this.helper_data_changed);
25 browser.remove_tab.connect (this.tab_removed);
26
27 GLib.List<unowned Katze.Item> items = tabs.get_items ();
28@@ -125,13 +125,22 @@
29 });
30 }
31
32- private void helper_uri_changed (Midori.Browser browser, Midori.View view) {
33- /* FixMe: skip first event while restoring the session */
34- view.web_view.notify["uri"].connect ( () => {
35- this.uri_changed (view, view.web_view.uri);
36- });
37- view.web_view.notify["title"].connect ( () => {
38- this.data_changed (view);
39+ private void helper_data_changed (Midori.Browser browser, Midori.View view) {
40+ ulong sig_id = 0;
41+ sig_id = view.web_view.load_started.connect (() => {
42+ unowned Katze.Item item = view.get_proxy_item ();
43+
44+ int64 delay = item.get_meta_integer ("delay");
45+ if (delay == Midori.Delay.UNDELAYED) {
46+ view.web_view.notify["uri"].connect ( () => {
47+ this.uri_changed (view, view.web_view.uri);
48+ });
49+ view.web_view.notify["title"].connect ( () => {
50+ this.data_changed (view);
51+ });
52+
53+ GLib.SignalHandler.disconnect (view.web_view, sig_id);
54+ }
55 });
56 }
57 }

Subscribers

People subscribed via source and target branches

to all changes: