GNOME Bugzilla – Bug 728536
Add a desktop action to create a new incognito window
Last modified: 2015-03-03 15:49:55 UTC
So you don't need to have an instance opened before going into netbank mode.
Created attachment 274722 [details] [review] Add a desktop action to create a new incognito window This change also makes it ok to start incognito mode without specifying a profile to steal from - it defaults to the main profile.
Review of attachment 274722 [details] [review]: Cool, thanks!
Review of attachment 274722 [details] [review]: We already have the changes to the desktop file from my earlier patch, but it doesn't work because that patched missed the change in ephy-main. I think I must not have tested it at all. I need to be better than that, sorry. Anyway, we only need the change to ephy-main.c. ::: data/epiphany.desktop.in.in @@ +17,3 @@ Categories=Network;GNOME;GTK;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https; +Actions=Incognito;ReopenClosedTab The RopenClosedTab action here is an accident, right? @@ +21,3 @@ +[Desktop Action Incognito] +_Name=New Incognito Window +Exec=epiphany --incognito-mode %U And the %U here is also spurious, right? ::: src/ephy-main.c @@ +355,3 @@ + if (incognito_mode && profile_directory == NULL) + profile_directory = ephy_dot_dir (); So this is the only change we need. This adds a compiler warning for conversion from const char * to char *, revealing that this should be g_strdup (ephy_dot_dir ()) because profile_directory is normally allocated by g_option_context_parse(). However, we never free profile_directory normally; it's just leaked if set, which is why this didn't introduce a crash. This hardly matters much, but we seem to free all the other arguments allocated by g_option_context_parse() unless we terminate early, so we might as well free this too.
Created attachment 296272 [details] [review] Fix incognito mode desktop action Solution by Gustavo Noronha
Created attachment 296273 [details] [review] Free profile_directory before quitting
Hah. I was like "hmm, I remember writing a patch for that" when I saw the incognito entry going in. Your fixes to the code that landed look pretty straight-forward, I'd say go ahead with them =)
*** Bug 745522 has been marked as a duplicate of this bug. ***