After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728536 - Add a desktop action to create a new incognito window
Add a desktop action to create a new incognito window
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Interface
unspecified
Other All
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
: 745522 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-04-19 00:48 UTC by Gustavo Noronha (kov)
Modified: 2015-03-03 15:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a desktop action to create a new incognito window (1.57 KB, patch)
2014-04-19 00:48 UTC, Gustavo Noronha (kov)
needs-work Details | Review
Fix incognito mode desktop action (900 bytes, patch)
2015-02-06 14:00 UTC, Michael Catanzaro
committed Details | Review
Free profile_directory before quitting (625 bytes, patch)
2015-02-06 14:00 UTC, Michael Catanzaro
committed Details | Review

Description Gustavo Noronha (kov) 2014-04-19 00:48:26 UTC
So you don't need to have an instance opened before going into netbank mode.
Comment 1 Gustavo Noronha (kov) 2014-04-19 00:48:28 UTC
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.
Comment 2 Carlos Garcia Campos 2015-02-03 13:36:06 UTC
Review of attachment 274722 [details] [review]:

Cool, thanks!
Comment 3 Michael Catanzaro 2015-02-06 13:58:42 UTC
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.
Comment 4 Michael Catanzaro 2015-02-06 14:00:51 UTC
Created attachment 296272 [details] [review]
Fix incognito mode desktop action

Solution by Gustavo Noronha
Comment 5 Michael Catanzaro 2015-02-06 14:00:54 UTC
Created attachment 296273 [details] [review]
Free profile_directory before quitting
Comment 6 Gustavo Noronha (kov) 2015-02-11 11:31:54 UTC
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 =)
Comment 7 Michael Catanzaro 2015-03-03 15:49:55 UTC
*** Bug 745522 has been marked as a duplicate of this bug. ***