Merge lp:~ivaldi/midori/tabby-delay-after-crash into lp:midori

Proposed by André Stösel
Status: Merged
Approved by: Cris Dywan
Approved revision: 6534
Merged at revision: 6534
Proposed branch: lp:~ivaldi/midori/tabby-delay-after-crash
Merge into: lp:midori
Diff against target: 59 lines (+16/-1)
3 files modified
extensions/tabby.vala (+5/-0)
midori/midori-app.c (+10/-1)
midori/midori.vapi (+1/-0)
To merge this branch: bzr merge lp:~ivaldi/midori/tabby-delay-after-crash
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+201314@code.launchpad.net

Commit message

delay tab loading after midori crashed

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

Very smart one that. I aritifically created some scenarios where something "crashed" and found it to behave quite nicely making sure whatever was active wouldn't load - unless I reload or purposely switch back and forth to open it, which seems sensible to me.

Ideally this would be tested somehow but as I was struggling to make all tests pass let's leave that for later.

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 2014-01-06 21:01:25 +0000
3+++ extensions/tabby.vala 2014-01-12 18:28:51 +0000
4@@ -170,6 +170,11 @@
5 APP.settings.get ("load-on-startup", out load_on_startup);
6 should_delay = load_on_startup == Midori.MidoriStartup.DELAYED_PAGES;
7
8+ if (APP.crashed == true) {
9+ delay = true;
10+ should_delay = true;
11+ }
12+
13 this.state = SessionState.RESTORING;
14
15 GLib.Idle.add (() => {
16
17=== modified file 'midori/midori-app.c'
18--- midori/midori-app.c 2013-09-07 20:38:45 +0000
19+++ midori/midori-app.c 2014-01-12 18:28:51 +0000
20@@ -615,6 +615,11 @@
21 gboolean
22 midori_app_get_crashed (MidoriApp* app)
23 {
24+ static gint cache = -1;
25+
26+ if (cache != -1)
27+ return (gboolean) cache;
28+
29 if (!midori_paths_is_readonly ())
30 {
31 /* We test for the presence of a dummy file which is created once
32@@ -624,10 +629,14 @@
33 if (!crashed)
34 g_file_set_contents (config_file, "RUNNING", -1, NULL);
35 g_free (config_file);
36- if (crashed)
37+ if (crashed) {
38+ cache = 1;
39 return TRUE;
40+ }
41 }
42
43+ cache = 0;
44+
45 return FALSE;
46 }
47
48
49=== modified file 'midori/midori.vapi'
50--- midori/midori.vapi 2013-12-12 14:20:49 +0000
51+++ midori/midori.vapi 2014-01-12 18:28:51 +0000
52@@ -51,6 +51,7 @@
53 [NoAccessorMethod]
54 public Katze.Array browsers { get; }
55 public Browser? browser { get; }
56+ public bool crashed { get; }
57
58 [HasEmitter]
59 public signal void add_browser (Browser browser);

Subscribers

People subscribed via source and target branches

to all changes: