Merge lp:~ivaldi/midori/smart-fallback into lp:midori

Proposed by André Stösel
Status: Merged
Approved by: Cris Dywan
Approved revision: 6253
Merged at revision: 6260
Proposed branch: lp:~ivaldi/midori/smart-fallback
Merge into: lp:midori
Diff against target: 41 lines (+12/-4)
1 file modified
midori/midori-session.c (+12/-4)
To merge this branch: bzr merge lp:~ivaldi/midori/smart-fallback
Reviewer Review Type Date Requested Status
Cris Dywan Approve
gue5t gue5t Approve
Review via email: mp+173535@code.launchpad.net

Commit message

If an url is specified the fallback url should not be loaded

To post a comment you must log in.
lp:~ivaldi/midori/smart-fallback updated
6253. By André Stösel

clarified comment

Revision history for this message
gue5t gue5t (gue5t) wrote :

This fixes the behavior; we now only show a homepage/blank page if there's no session and no command-line urls; r+.

However, in a common (default preferences) use case such as "midori www.example.com", oftentimes the session might provide a single blank tab or a single tab containing the homepage (because closing all tabs leaves the session in such a state). This may not be desirable for users that, but there's no way to avoid it for now without also discarding useful tabs from the session. That can be addressed in a separate patch, probably; this doesn't introduce a regression.

review: Approve
Revision history for this message
Cris Dywan (kalikiana) wrote :

I like the fix. It's the correct behavior to avoid opening the homepage/ blank.

I'm not sure the case of a session containing these pages is at all trivial. Preferrably let's deal with that in a follow up and clarify what's actually expected there.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-session.c'
2--- midori/midori-session.c 2013-06-19 20:28:39 +0000
3+++ midori/midori-session.c 2013-07-11 08:43:31 +0000
4@@ -458,6 +458,8 @@
5 gint64 current;
6 gchar** open_uris = g_object_get_data (G_OBJECT (app), "open-uris");
7 gchar** execute_commands = g_object_get_data (G_OBJECT (app), "execute-commands");
8+ gchar* uri;
9+ guint i = 0;
10 #ifdef G_ENABLE_DEBUG
11 gboolean startup_timer = midori_debug ("startup");
12 GTimer* timer = startup_timer ? g_timer_new () : NULL;
13@@ -486,7 +488,13 @@
14 if (katze_array_is_empty (saved_session))
15 {
16 item = katze_item_new ();
17- if (load_on_startup == MIDORI_STARTUP_BLANK_PAGE)
18+ if (open_uris)
19+ {
20+ uri = sokoke_magic_uri (open_uris[i], TRUE, TRUE);
21+ katze_item_set_uri (item, uri);
22+ g_free (uri);
23+ i++;
24+ } else if (load_on_startup == MIDORI_STARTUP_BLANK_PAGE)
25 katze_item_set_uri (item, "about:new");
26 else
27 katze_item_set_uri (item, "about:home");
28@@ -515,10 +523,10 @@
29 if (midori_uri_is_blank (katze_item_get_uri (item)))
30 midori_browser_activate_action (browser, "Location");
31
32- guint i = 0;
33- for (i = 0; open_uris && open_uris[i]; i++)
34+ /* `i` also used above; in that case we won't re-add the same URLs here */
35+ for (; open_uris && open_uris[i]; i++)
36 {
37- gchar* uri = sokoke_magic_uri (open_uris[i], TRUE, TRUE);
38+ uri = sokoke_magic_uri (open_uris[i], TRUE, TRUE);
39 midori_browser_add_uri (browser, uri);
40 g_free (uri);
41 }

Subscribers

People subscribed via source and target branches

to all changes: