[dconf-editor] Use an empty summary if there is none.



commit 80167c8d8d849942ec9eba4c3b1e8db913a23d0d
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Oct 12 22:22:32 2015 +0200

    Use an empty summary if there is none.

 editor/ca.desrt.dconf-editor.gschema.xml |    2 +-
 editor/dconf-editor.vala                 |    2 +-
 editor/dconf-model.vala                  |    8 ++++----
 editor/dconf-view.vala                   |    7 ++-----
 editor/dconf-window.vala                 |    8 +++-----
 5 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/editor/ca.desrt.dconf-editor.gschema.xml b/editor/ca.desrt.dconf-editor.gschema.xml
index 5416562..ad978a9 100644
--- a/editor/ca.desrt.dconf-editor.gschema.xml
+++ b/editor/ca.desrt.dconf-editor.gschema.xml
@@ -88,7 +88,7 @@ If you are not interacting with D-Bus, then there is no reason to make use of th
     <key name="dbus-object-path-array" type="ao">
       <default>['/ca/desrt/dconf_editor/menus/appmenu', '/ca/desrt/dconf_editor/window/1']</default>
       <summary>A D-Bus object path array, type "ao"</summary>
-      <description>An object path array could contain any number of object paths (including 0: "[]").
+      <description>An object path array could contain any number of object paths (including none: "[]").
 
 If you are not interacting with D-Bus, then there is no reason to make use of this type.</description>
     </key>
diff --git a/editor/dconf-editor.vala b/editor/dconf-editor.vala
index 6c7bd88..d8b41bd 100644
--- a/editor/dconf-editor.vala
+++ b/editor/dconf-editor.vala
@@ -17,7 +17,7 @@
 
 class ConfigurationEditor : Gtk.Application
 {
-    private const OptionEntry option_entries [] =
+    private const OptionEntry [] option_entries =
     {
         { "version", 'v', 0, OptionArg.NONE, null, N_("Print release version and exit"), null },
         { null }
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index 9d27682..7ad8dcd 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -19,8 +19,8 @@ public struct SchemaKey
 {
     public string schema_id;
     public string name;
-    public string? summary;
-    public string? description;
+    public string summary;
+    public string description;
     public Variant default_value;
     public string type;
     public string range_type;
@@ -319,8 +319,8 @@ public class SettingsModel : Object, Gtk.TreeModel
             SchemaKey key = SchemaKey () {
                     schema_id = schema_id,
                     name = key_id,
-                    summary = settings_schema_key.get_summary (),
-                    description = settings_schema_key.get_description (),
+                    summary = (settings_schema_key.get_summary () ?? "").strip (),
+                    description = (settings_schema_key.get_description () ?? "").strip (),
                     default_value = settings_schema_key.get_default_value (),
                     type = type,
                     range_type = range_type,
diff --git a/editor/dconf-view.vala b/editor/dconf-view.vala
index 85d8393..cd743db 100644
--- a/editor/dconf-view.vala
+++ b/editor/dconf-view.vala
@@ -225,12 +225,9 @@ private class KeyEditor : KeyEditorDialog
 
         // infos
 
-        string summary = key.schema.summary ?? "";
-        string description = key.schema.description ?? "";
-
         schema_label.set_text (key.schema.schema_id);
-        summary_label.set_text (summary.strip ());
-        description_label.set_text (description.strip ());
+        summary_label.set_text (key.schema.summary);
+        description_label.set_text (key.schema.description);
         type_label.set_text (key_to_description ());
         default_label.set_text (Key.cool_text_value_from_variant (key.schema.default_value, 
key.schema.type));
 
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index fc7e318..2492be3 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -252,9 +252,9 @@ class DConfWindow : ApplicationWindow
         /* Check key schema (description) */
         if (key.has_schema)
         {
-            if (((GSettingsKey) key).schema.summary != null && ((GSettingsKey) key).schema.summary.index_of 
(text) >= 0)
+            if (((GSettingsKey) key).schema.summary.index_of (text) >= 0)
                 return true;
-            if (((GSettingsKey) key).schema.description != null && ((GSettingsKey) 
key).schema.description.index_of (text) >= 0)
+            if (((GSettingsKey) key).schema.description.index_of (text) >= 0)
                 return true;
         }
 
@@ -472,9 +472,7 @@ private class KeyListBoxRowEditable : KeyListBoxRow
         key_value_label.set_attributes (attr_list);
         update ();      // sets key_name_label attributes and key_value_label label
         key_name_label.label = key.name;
-
-        string summary = key.schema.summary ?? "";
-        key_info_label.label = summary.strip ();
+        key_info_label.label = key.schema.summary;
 
         key.value_changed.connect (() => { update (); if (popover != null) popover.destroy (); });
     }


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