Konqueror: Ask for session restore ONLY on plain startup (not for every window)

Review Request #101850 - Created July 4, 2011 and updated

Marcel Partap
This patch stops asking for session restore for EVERY new window (popups!) and does so ONLY when initial konqueror process is started, and called without URL. Because i didn't want to loose all my crashed sessions and the 'import crashed sessions as bookmarks' feature disappeared sometime, i had been clicking on 'ask again later' 42 bazillion times. Restoring all the crashed sessions always brought down the process (imho each session should restore as individual process, but that is another patch).
Tryed out and traced everything with GDB, does as says. Finally no huge crashed-session-parsing-delay for every stupid popup ^^
Marcel Partap
Uhhmm.. so can i commit this? David? .. (:
David Faure

konqueror/src/konqmain.cpp (Diff revision 1)
So it won't ask when logging into a new KDE session? Seems to me that this could be kept here, no? It's not what you have been annoyed with ("on every popup").
  1. Ok, although i consider it superfluous to ask for restoring crashed sessions in case a valid session can be restored, but that's just my personal preference.
  2. I think you are forgetting one very common case that can happen:
    on day 1, you browse lots of sites, logout, that's your saved session in the session management stuff.
    on day 2, you browse different sites, but then the computer crashes, or you run out of batteries, or you type shutdown -h now.
    on day 3, when you log into KDE again, standard session management will restore the windows from day 1, and crashed-session-restoring will offer to restore the windows from day 2, which are even more important to you, they are the ones you were viewing last.
konqueror/src/konqmisc.cpp (Diff revision 1)
If you don't offer restoration when opening a new URL, then offering that only on process startup is not enough. When using preloading (and especially if one sets the use of preloading to "always"), then there is never a new process started, it's all in one process, and kfmclient simply talks to the running konqueror. So you would never offer restoration.

It seems to me that you would like it to run when "clicking on the konqueror icon only", but that icon is usually wired to kfmclient, not to konqueror directly. So it's kind of hard to make a difference, unless you add a different command-line switch to kfmclient which could then, when talking to a running konqueror, start by calling the "ask user" via DBus...
  1. > /usr/share/kde4/services/konqueror.desktop:Exec=konqueror %U
    > /usr/share/applications/kde4/Home.desktop:Exec=kfmclient openProfile filemanagement
    > /usr/share/autostart/konqy_preload.desktop:Exec=konqueror --preload
    I always use the first but i see your point (i do not use preload because of past stability issues)...
    So how about a static 'userHasBeenAsked' var in KonqMisc::createBrowserWindowFromProfile? 
    Imho this window really should be shown only once, and as you mentioned only when konqy is launched by itself...
  2. So if you have konqueror-1 and konqueror-2 (two processes), and konqueror-2 crashes, and then you click on a link which calls kfmclient, it wouldn't offer to restore konqueror-2 urls, if you already did this once in the past...
    I think the real issue here is that procrastination ("ask again later") is not a valid option in life :-)
David Faure

Any plans to update the patch according to our discussion?