[dconf-editor] Fix errors when copying path during search.



commit 5ad5ccb66c156c62d6f0724da5a951bd0a8d6f4a
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Feb 17 18:20:11 2018 +0100

    Fix errors when copying path during search.

 editor/dconf-window.vala    |    2 +-
 editor/registry-search.vala |   11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 3919a67..1ab49a7 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -524,7 +524,7 @@ class DConfWindow : ApplicationWindow
 
         if (search_bar.search_mode_enabled)
         {
-            string selected_row_text = browser_view.get_copy_path_text () ?? current_path;
+            string selected_row_text = browser_view.get_copy_path_text () ?? saved_view;
             ((ConfigurationEditor) get_application ()).copy (selected_row_text);
         }
         else
diff --git a/editor/registry-search.vala b/editor/registry-search.vala
index 531dd8b..e2d7112 100644
--- a/editor/registry-search.vala
+++ b/editor/registry-search.vala
@@ -203,8 +203,17 @@ class RegistrySearch : RegistryList
         ListBoxRow? selected_row = key_list_box.get_selected_row ();
         if (selected_row == null)
             return null;
+
+        Variant variant = ((!) selected_row).get_action_target_value ();
+        string action_target;
+        if (((!) variant).get_type_string () == "s")    // directory
+            action_target = ((!) variant).get_string ();
         else
-            return ((!) selected_row).get_action_target_value ().get_string ();
+        {
+            string unused;
+            ((!) variant).get ("(ss)", out action_target, out unused);
+        }
+        return action_target;
     }
 
     /*\


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