Replace 'enable-app-monitoring' setting
The org.gnome.desktop.privacy schema gained a 'remember-app-usage' key, use that instead of our own preference. https://bugzilla.gnome.org/show_bug.cgi?id=699714
This commit is contained in:
parent
f88d9c06f5
commit
731e8bfe2b
@ -21,16 +21,6 @@
|
|||||||
EnableExtension and DisableExtension DBus methods on org.gnome.Shell.
|
EnableExtension and DisableExtension DBus methods on org.gnome.Shell.
|
||||||
</_description>
|
</_description>
|
||||||
</key>
|
</key>
|
||||||
<key name="enable-app-monitoring" type="b">
|
|
||||||
<default>true</default>
|
|
||||||
<_summary>Whether to collect stats about applications usage</_summary>
|
|
||||||
<_description>
|
|
||||||
The shell normally monitors active applications in order to present
|
|
||||||
the most used ones (e.g. in launchers). While this data will be
|
|
||||||
kept private, you may want to disable this for privacy reasons.
|
|
||||||
Please note that doing so won't remove already saved data.
|
|
||||||
</_description>
|
|
||||||
</key>
|
|
||||||
<key name="favorite-apps" type="as">
|
<key name="favorite-apps" type="as">
|
||||||
<default>[ 'epiphany.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop' ]</default>
|
<default>[ 'epiphany.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop' ]</default>
|
||||||
<_summary>List of desktop file IDs for favorite applications</_summary>
|
<_summary>List of desktop file IDs for favorite applications</_summary>
|
||||||
|
@ -343,7 +343,8 @@ const AppDisplay = new Lang.Class({
|
|||||||
global.settings.connect('changed::app-folder-categories', Lang.bind(this, function() {
|
global.settings.connect('changed::app-folder-categories', Lang.bind(this, function() {
|
||||||
Main.queueDeferredWork(this._allAppsWorkId);
|
Main.queueDeferredWork(this._allAppsWorkId);
|
||||||
}));
|
}));
|
||||||
global.settings.connect('changed::enable-app-monitoring',
|
this._privacySettings = new Gio.Settings({ schema: 'org.gnome.desktop.privacy' });
|
||||||
|
this._privacySettings.connect('changed::remember-app-usage',
|
||||||
Lang.bind(this, this._updateFrequentVisibility));
|
Lang.bind(this, this._updateFrequentVisibility));
|
||||||
|
|
||||||
this._views = [];
|
this._views = [];
|
||||||
@ -419,7 +420,7 @@ const AppDisplay = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_updateFrequentVisibility: function() {
|
_updateFrequentVisibility: function() {
|
||||||
let enabled = global.settings.get_boolean('enable-app-monitoring');
|
let enabled = this._privacySettings.get_boolean('remember-app-usage');
|
||||||
this._views[Views.FREQUENT].control.visible = enabled;
|
this._views[Views.FREQUENT].control.visible = enabled;
|
||||||
|
|
||||||
let visibleViews = this._views.filter(function(v) {
|
let visibleViews = this._views.filter(function(v) {
|
||||||
|
@ -39,7 +39,8 @@
|
|||||||
* minutes to signify idle.
|
* minutes to signify idle.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ENABLE_MONITORING_KEY "enable-app-monitoring"
|
#define PRIVACY_SCHEMA "org.gnome.desktop.privacy"
|
||||||
|
#define ENABLE_MONITORING_KEY "remember-app-usage"
|
||||||
|
|
||||||
#define FOCUS_TIME_MIN_SECONDS 7 /* Need 7 continuous seconds of focus */
|
#define FOCUS_TIME_MIN_SECONDS 7 /* Need 7 continuous seconds of focus */
|
||||||
|
|
||||||
@ -82,10 +83,10 @@ struct _ShellAppUsage
|
|||||||
GFile *configfile;
|
GFile *configfile;
|
||||||
GDBusProxy *session_proxy;
|
GDBusProxy *session_proxy;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
|
GSettings *privacy_settings;
|
||||||
gulong last_idle;
|
gulong last_idle;
|
||||||
guint idle_focus_change_id;
|
guint idle_focus_change_id;
|
||||||
guint save_id;
|
guint save_id;
|
||||||
guint settings_notify;
|
|
||||||
gboolean currently_idle;
|
gboolean currently_idle;
|
||||||
gboolean enable_monitoring;
|
gboolean enable_monitoring;
|
||||||
|
|
||||||
@ -426,7 +427,8 @@ shell_app_usage_init (ShellAppUsage *self)
|
|||||||
restore_from_file (self);
|
restore_from_file (self);
|
||||||
|
|
||||||
|
|
||||||
self->settings_notify = g_signal_connect (shell_global_get_settings (global),
|
self->privacy_settings = g_settings_new(PRIVACY_SCHEMA);
|
||||||
|
g_signal_connect (self->privacy_settings,
|
||||||
"changed::" ENABLE_MONITORING_KEY,
|
"changed::" ENABLE_MONITORING_KEY,
|
||||||
G_CALLBACK (on_enable_monitoring_key_changed),
|
G_CALLBACK (on_enable_monitoring_key_changed),
|
||||||
self);
|
self);
|
||||||
@ -436,15 +438,12 @@ shell_app_usage_init (ShellAppUsage *self)
|
|||||||
static void
|
static void
|
||||||
shell_app_usage_finalize (GObject *object)
|
shell_app_usage_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
ShellGlobal *global;
|
|
||||||
ShellAppUsage *self = SHELL_APP_USAGE (object);
|
ShellAppUsage *self = SHELL_APP_USAGE (object);
|
||||||
|
|
||||||
if (self->save_id > 0)
|
if (self->save_id > 0)
|
||||||
g_source_remove (self->save_id);
|
g_source_remove (self->save_id);
|
||||||
|
|
||||||
global = shell_global_get ();
|
g_object_unref (self->privacy_settings);
|
||||||
g_signal_handler_disconnect (shell_global_get_settings (global),
|
|
||||||
self->settings_notify);
|
|
||||||
|
|
||||||
g_object_unref (self->configfile);
|
g_object_unref (self->configfile);
|
||||||
|
|
||||||
@ -956,11 +955,9 @@ out:
|
|||||||
static void
|
static void
|
||||||
update_enable_monitoring (ShellAppUsage *self)
|
update_enable_monitoring (ShellAppUsage *self)
|
||||||
{
|
{
|
||||||
ShellGlobal *global;
|
|
||||||
gboolean enable;
|
gboolean enable;
|
||||||
|
|
||||||
global = shell_global_get ();
|
enable = g_settings_get_boolean (self->privacy_settings,
|
||||||
enable = g_settings_get_boolean (shell_global_get_settings (global),
|
|
||||||
ENABLE_MONITORING_KEY);
|
ENABLE_MONITORING_KEY);
|
||||||
|
|
||||||
/* Be sure not to start the timers if they were already set */
|
/* Be sure not to start the timers if they were already set */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user