[gnome-software] Move the GSetting for the usage to gsettings-desktop-schemas



commit 6dccb4e9eda89e48ce2f99c4b37172a974910f87
Author: Richard Hughes <richard hughsie com>
Date:   Tue Feb 4 17:19:06 2014 +0000

    Move the GSetting for the usage to gsettings-desktop-schemas
    
    This allows us to get and set the value from gnome-control-center.

 configure.ac                                |    2 +-
 data/org.gnome.software.gschema.xml         |    9 ---------
 src/gs-plugin-loader.c                      |    2 --
 src/gs-plugin.h                             |    1 -
 src/plugins/gs-plugin-fedora-tagger-usage.c |   15 ++++++++++-----
 5 files changed, 11 insertions(+), 18 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6999f8a..2248da7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,7 +77,7 @@ PKG_CHECK_MODULES(PACKAGEKIT, packagekit-glib2 >= 0.8.12)
 PKG_CHECK_MODULES(SQLITE, sqlite3)
 PKG_CHECK_MODULES(NOTIFY, libnotify)
 PKG_CHECK_MODULES(SOUP, libsoup-2.4)
-PKG_CHECK_MODULES(GSETTINGS_DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.11.4)
+PKG_CHECK_MODULES(GSETTINGS_DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.11.5)
 AC_ARG_ENABLE(man,
               [AS_HELP_STRING([--enable-man],
                               [generate man pages [default=auto]])],,
diff --git a/data/org.gnome.software.gschema.xml b/data/org.gnome.software.gschema.xml
index 8e9e14c..e182d99 100644
--- a/data/org.gnome.software.gschema.xml
+++ b/data/org.gnome.software.gschema.xml
@@ -10,15 +10,6 @@
       <summary>Applications require AppData to be shown in the search results</summary>
       <description>If enabled applications require a long description before they are shown to the user in 
the search results.</description>
     </key>
-    <key name="enable-usage" type="b">
-      <default>false</default>
-      <summary>Enable collection of user data</summary>
-      <description>
-        If enabled the application will send an report to your distribution
-        noting the application that was installed or removed to provide better
-        suggestions for other users.
-      </description>
-    </key>
     <key name="check-timestamp" type="x">
       <default>0</default>
       <summary>The last update check timestamp</summary>
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 8f2d66b..4c45508 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2504,7 +2504,6 @@ gs_plugin_loader_open_plugin (GsPluginLoader *plugin_loader,
        plugin->pixbuf_size = 64;
        plugin->priority = 0.f;
        plugin->deps = plugin_deps != NULL ? plugin_deps (plugin) : NULL;
-       plugin->settings = g_object_ref (plugin_loader->priv->settings);
        plugin->name = g_strdup (plugin_name ());
        plugin->status_update_fn = gs_plugin_loader_status_update_cb;
        plugin->status_update_user_data = plugin_loader;
@@ -2706,7 +2705,6 @@ gs_plugin_loader_plugin_free (GsPlugin *plugin)
        g_free (plugin->name);
        g_object_unref (plugin->profile);
        g_hash_table_unref (plugin->icon_cache);
-       g_object_unref (plugin->settings);
        g_module_close (plugin->module);
        g_slice_free (GsPlugin, plugin);
 }
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index fb663fe..1b41e48 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -72,7 +72,6 @@ struct GsPlugin {
        gpointer                 updates_changed_user_data;
        GsProfile               *profile;
        GHashTable              *icon_cache;    /* key is the id.desktop */
-       GSettings               *settings;
 };
 
 typedef enum {
diff --git a/src/plugins/gs-plugin-fedora-tagger-usage.c b/src/plugins/gs-plugin-fedora-tagger-usage.c
index 345e9fc..3be2284 100644
--- a/src/plugins/gs-plugin-fedora-tagger-usage.c
+++ b/src/plugins/gs-plugin-fedora-tagger-usage.c
@@ -50,22 +50,27 @@ gs_plugin_get_name (void)
 void
 gs_plugin_initialize (GsPlugin *plugin)
 {
+       GSettings *settings;
+
        plugin->priv = GS_PLUGIN_GET_PRIVATE (GsPluginPrivate);
 
        /* this is opt-in, and turned off by default */
-       if (!g_settings_get_boolean (plugin->settings, "enable-usage")) {
+       settings = g_settings_new ("org.gnome.desktop.privacy");
+       if (!g_settings_get_boolean (settings, "send-software-usage-stats")) {
                gs_plugin_set_enabled (plugin, FALSE);
-               g_debug ("disabling '%s' as 'enable-usage' disabled in GSettings",
-                        plugin->name);
-               return;
+               g_debug ("disabling '%s' as 'send-software-usage-stats' "
+                        "disabled in GSettings", plugin->name);
+               goto out;
        }
 
        /* check that we are running on Fedora */
        if (!gs_plugin_check_distro_id (plugin, "fedora")) {
                gs_plugin_set_enabled (plugin, FALSE);
                g_debug ("disabling '%s' as we're not Fedora", plugin->name);
-               return;
+               goto out;
        }
+out:
+       g_object_unref (settings);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]