[dconf-editor] Allow searching even when a Directory and a Key has the same name.



commit 5775a7ec8b425cab39a57cf45b3e4a9c6879d5bc
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Aug 20 14:35:23 2016 +0200

    Allow searching even when a Directory and a Key has the same name.

 editor/pathbar.vala       |    2 +-
 editor/registry-view.vala |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/editor/pathbar.vala b/editor/pathbar.vala
index 97a0584..c937f84 100644
--- a/editor/pathbar.vala
+++ b/editor/pathbar.vala
@@ -127,7 +127,7 @@ public class PathBar : Box, PathElement
         if (!complete_path.has_prefix (current_path) || complete_path == current_path)
             return null;
         int index_of_last_slash = complete_path.index_of ("/", current_path.length);
-        return complete_path.slice (current_path.length, index_of_last_slash == -1 ? complete_path.length : 
index_of_last_slash);
+        return index_of_last_slash == -1 ? complete_path : complete_path.slice (0, index_of_last_slash + 1);
     }
 
     /*\
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index 792143d..8be9d9b 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -101,7 +101,7 @@ class RegistryView : Grid, PathElement
         while (position < ((!) key_model).get_n_items ())
         {
             SettingObject object = (SettingObject) ((!) key_model).get_object (position);
-            if (object.name == selected)
+            if (object.full_name == selected)
                 return (int) position;
             position++;
         }
@@ -190,7 +190,7 @@ class RegistryView : Grid, PathElement
         }
         if (((!) key) is DConfKey && ((DConfKey) ((!) key)).is_ghost)
         {
-            show_browse_view (folder_name, key_name);
+            show_browse_view (folder_name, folder_name + key_name);
             get_dconf_window ().show_notification (_("Key \"%s\" has been removed.").printf (key_name));
             return;
         }
@@ -526,7 +526,7 @@ class RegistryView : Grid, PathElement
                 {
                     dir_tree_selection.select_iter (iter);
                     key_list_box.select_row (key_list_box.get_row_at_index (position));
-                    show_browse_view (dir.full_name, object.name, false);
+                    show_browse_view (dir.full_name, object.full_name, false);
                     return;
                 }
                 else if (object is Key)


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