[dconf-editor] Allow to disable the periodic SSS reload.



commit c4418f0d32e540b2d53218f83d9c2e1c02def213
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Jan 17 18:06:27 2018 +0100

    Allow to disable the periodic SSS reload.

 editor/ca.desrt.dconf-editor.gschema.xml |    5 +++++
 editor/dconf-model.vala                  |    4 +++-
 editor/dconf-window.vala                 |    2 ++
 3 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/editor/ca.desrt.dconf-editor.gschema.xml b/editor/ca.desrt.dconf-editor.gschema.xml
index 966e701..cee383f 100644
--- a/editor/ca.desrt.dconf-editor.gschema.xml
+++ b/editor/ca.desrt.dconf-editor.gschema.xml
@@ -178,6 +178,11 @@
       <summary>Mouse button to activate the “Forward” command in browser window</summary>
       <description>For users with mice that have buttons for “Forward” and “Back”, this key will set which 
button activates the “Forward” command in a browser window. Possible values range between 6 and 
14.</description>
     </key>
+    <key type="b" name="refresh-settings-schema-source">
+      <default>true</default>
+      <summary>A flag to check for added or removed schemas</summary>
+      <description>Dconf Editor can monitor if schemas are added or removed from the multiple possible 
locations. That’s done by checking every three seconds if the schemas list has changed. As this way to do is 
suboptimal, this function can be disabled by setting this flag to “false”. Note that this option will be 
removed when a better way to do things is found.</description>
+    </key>
     <key name="relocatable-schemas-enabled-mappings" 
flags="ca.desrt.dconf-editor.RelocatableSchemasEnabledMappings">
       <default>['User', 'Built-in', 'Internal', 'Startup']</default>
       <summary>Enabled relocatable schema mapping facilities</summary>
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index 2c321db..4c6cfe3 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -18,6 +18,7 @@
 public class SettingsModel : Object
 {
     private SourceManager source_manager = new SourceManager ();
+    public bool refresh_source { get; set; default = true; }
 
     private DConf.Client client = new DConf.Client ();
     private string? last_change_tag = null;
@@ -47,7 +48,8 @@ public class SettingsModel : Object
         source_manager.paths_changed.connect ((modified_path_specs) => { paths_changed (modified_path_specs, 
false); });
         source_manager.refresh_schema_source ();
         Timeout.add (3000, () => {
-                source_manager.refresh_schema_source ();
+                if (refresh_source) // TODO better: stops the I/O, but not the wakeup
+                    source_manager.refresh_schema_source ();
                 return true;
             });
 
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index d52f3b4..e75bbdc 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -188,6 +188,8 @@ class DConfWindow : ApplicationWindow
                                                 RelocatableSchemasEnabledMappings.INTERNAL in 
enabled_mappings_flags,
                                                 RelocatableSchemasEnabledMappings.STARTUP  in 
enabled_mappings_flags,
                                                 settings.get_value ("relocatable-schemas-user-paths"));
+
+        settings.bind ("refresh-settings-schema-source", model, "refresh-source", 
SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
         model.finalize_model ();
 
         model.paths_changed.connect ((_model, modified_path_specs, internal_changes) => {


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