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
=== modified file 'midori/midori-session.c'
--- midori/midori-session.c 2013-06-19 20:28:39 +0000
+++ midori/midori-session.c 2013-07-11 08:43:31 +0000
@@ -458,6 +458,8 @@
458 gint64 current;458 gint64 current;
459 gchar** open_uris = g_object_get_data (G_OBJECT (app), "open-uris");459 gchar** open_uris = g_object_get_data (G_OBJECT (app), "open-uris");
460 gchar** execute_commands = g_object_get_data (G_OBJECT (app), "execute-commands");460 gchar** execute_commands = g_object_get_data (G_OBJECT (app), "execute-commands");
461 gchar* uri;
462 guint i = 0;
461 #ifdef G_ENABLE_DEBUG463 #ifdef G_ENABLE_DEBUG
462 gboolean startup_timer = midori_debug ("startup");464 gboolean startup_timer = midori_debug ("startup");
463 GTimer* timer = startup_timer ? g_timer_new () : NULL;465 GTimer* timer = startup_timer ? g_timer_new () : NULL;
@@ -486,7 +488,13 @@
486 if (katze_array_is_empty (saved_session))488 if (katze_array_is_empty (saved_session))
487 {489 {
488 item = katze_item_new ();490 item = katze_item_new ();
489 if (load_on_startup == MIDORI_STARTUP_BLANK_PAGE)491 if (open_uris)
492 {
493 uri = sokoke_magic_uri (open_uris[i], TRUE, TRUE);
494 katze_item_set_uri (item, uri);
495 g_free (uri);
496 i++;
497 } else if (load_on_startup == MIDORI_STARTUP_BLANK_PAGE)
490 katze_item_set_uri (item, "about:new");498 katze_item_set_uri (item, "about:new");
491 else499 else
492 katze_item_set_uri (item, "about:home");500 katze_item_set_uri (item, "about:home");
@@ -515,10 +523,10 @@
515 if (midori_uri_is_blank (katze_item_get_uri (item)))523 if (midori_uri_is_blank (katze_item_get_uri (item)))
516 midori_browser_activate_action (browser, "Location");524 midori_browser_activate_action (browser, "Location");
517525
518 guint i = 0;526 /* `i` also used above; in that case we won't re-add the same URLs here */
519 for (i = 0; open_uris && open_uris[i]; i++)527 for (; open_uris && open_uris[i]; i++)
520 {528 {
521 gchar* uri = sokoke_magic_uri (open_uris[i], TRUE, TRUE);529 uri = sokoke_magic_uri (open_uris[i], TRUE, TRUE);
522 midori_browser_add_uri (browser, uri);530 midori_browser_add_uri (browser, uri);
523 g_free (uri);531 g_free (uri);
524 }532 }

Subscribers

People subscribed via source and target branches

to all changes: