Merge lp:~artem-anufrij/audience/Bugfix-1386040 into lp:~audience-members/audience/trunk

Proposed by Artem Anufrij
Status: Superseded
Proposed branch: lp:~artem-anufrij/audience/Bugfix-1386040
Merge into: lp:~audience-members/audience/trunk
Diff against target: 57 lines (+17/-2)
1 file modified
src/Audience.vala (+17/-2)
To merge this branch: bzr merge lp:~artem-anufrij/audience/Bugfix-1386040
Reviewer Review Type Date Requested Status
Audience Members Pending
Review via email: mp+241448@code.launchpad.net

This proposal has been superseded by a proposal from 2015-10-15.

Description of the change

Check privacy mode. IF ENABLED: don't save the settings (last videos, current video, process, last folder).

To post a comment you must log in.
Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

I think this process of defining what to save and what to open is a really complex task. As we see in the switchboard we have a blacklisting based on file path and what open it.

Checking this gsettings might be not enough and we need a more sophisticated process involving Zeitgeist , Gtk.RecentManager, etc. And it might be useful for other project too, it would be awesome if it can be a part of Granite.

I don't know about how Security and Privacy is designed in pantheon, and i think it need to be discussed in a bigger forum.

Revision history for this message
Danielle Foré (danrabbit) wrote :

I think for the purpose of this bug report, it would be acceptable to just not write any changes to gsettings while privacy mode is active.

Unmerged revisions

460. By artem-anufrij

Check privacy mode. IF ENABLE: don't save the settings (last videos, current video, process, last folder).

459. By artem-anufrij

Check privacy mode. IF ENABLE: don't save the settings (last videos, current video, process).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Audience.vala'
2--- src/Audience.vala 2014-11-02 19:13:36 +0000
3+++ src/Audience.vala 2014-11-11 19:21:39 +0000
4@@ -583,6 +583,12 @@
5 }
6
7 private void on_destroy () {
8+
9+ if (is_privacy_mode_enabled ()) {
10+ clear_video_settings ();
11+ return;
12+ }
13+
14 if (video_player.uri.has_prefix ("dvd://")) {
15 clear_video_settings ();
16 return;
17@@ -642,9 +648,9 @@
18 settings.last_stopped = 0;
19 settings.last_played_videos = null;
20 settings.current_video = "";
21+ settings.last_folder = "";
22 }
23
24-
25 private void restore_playlist () {
26 foreach (var filename in settings.last_played_videos) {
27 playlist.add_item (File.new_for_uri (filename));
28@@ -802,6 +808,10 @@
29 //the application started
30 public override void activate () {
31 build ();
32+
33+ if (is_privacy_mode_enabled ())
34+ return;
35+
36 if (settings.resume_videos == true
37 && settings.last_played_videos.length > 0
38 && settings.current_video != ""
39@@ -838,6 +848,11 @@
40 } else
41 open_file(files[0].get_uri ());
42 }
43+
44+ public bool is_privacy_mode_enabled () {
45+ var privacy_settings = new GLib.Settings ("org.gnome.desktop.privacy");
46+ return privacy_settings.get_boolean ("remember-recent-files") || privacy_settings.get_boolean ("remember-app-usage");
47+ }
48 }
49 }
50
51@@ -854,4 +869,4 @@
52 var app = Audience.App.get_instance ();
53
54 app.run (args);
55-}
56\ No newline at end of file
57+}

Subscribers

People subscribed via source and target branches