[gnome-documents] sources: remove 'active-source' GSetting



commit 1bef7063893f1fd17ac160aa112e01f49a41b2cc
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sat Apr 21 12:21:20 2012 -0400

    sources: remove 'active-source' GSetting
    
    The active source should have never been saved into GSettings, more so
    now that we use the same code for the shell search provider. Also, this
    code handling it was broken anyway.

 data/org.gnome.documents.gschema.xml.in |    5 -----
 src/sources.js                          |   13 +------------
 2 files changed, 1 insertions(+), 17 deletions(-)
---
diff --git a/data/org.gnome.documents.gschema.xml.in b/data/org.gnome.documents.gschema.xml.in
index 3be5597..302c84f 100644
--- a/data/org.gnome.documents.gschema.xml.in
+++ b/data/org.gnome.documents.gschema.xml.in
@@ -5,11 +5,6 @@
       <_summary>View as</_summary>
       <_description>View as type</_description>
     </key>
-    <key name="active-source" type="s">
-      <default>'all'</default>
-      <_summary>The active source filter</_summary>
-      <_description>The last active source filter</_description>
-    </key>
     <key name="window-size" type="ai">
       <default>[768, 600]</default>
       <_summary>Window size</_summary>
diff --git a/src/sources.js b/src/sources.js
index d326f1f..c2e5331 100644
--- a/src/sources.js
+++ b/src/sources.js
@@ -106,6 +106,7 @@ SourceManager.prototype = {
         Global.goaClient.connect('account-removed', Lang.bind(this, this._refreshGoaAccounts));
 
         this._refreshGoaAccounts();
+        this.setActiveItemById(SourceStock.ALL);
     },
 
     _refreshGoaAccounts: function() {
@@ -125,17 +126,5 @@ SourceManager.prototype = {
             }));
 
         this.processNewItems(newItems);
-
-        let activeItemId = Global.settings.get_string('active-source');
-
-        // fallback to 'all' if we never saved any source, or if the saved
-        // source disappeared in the meantime
-        if (!this.setActiveItemById(activeItemId))
-            this.setActiveItemById(SourceStock.ALL);
-    },
-
-    setActiveItem: function(item) {
-        if (Manager.BaseManager.prototype.setActiveItem.call(this, item))
-            Global.settings.set_string('active-source', item.id);
     }
 };



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