[gnome-builder] file-search: index directory names



commit 7e3edaf05d0c77eb00a0257eb5cef09f9aebb841
Author: Christian Hergert <chergert redhat com>
Date:   Thu Apr 25 17:44:17 2019 -0700

    file-search: index directory names
    
    This allows quickly opening the file-browser for a directory by searching
    for foo/

 src/plugins/file-search/gbp-file-search-index.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/file-search/gbp-file-search-index.c b/src/plugins/file-search/gbp-file-search-index.c
index 6ae41798e..4e519a6f5 100644
--- a/src/plugins/file-search/gbp-file-search-index.c
+++ b/src/plugins/file-search/gbp-file-search-index.c
@@ -172,11 +172,17 @@ populate_from_dir (DzlFuzzyMutableIndex *fuzzy,
   if (ide_vcs_is_ignored (vcs, directory, NULL))
     return;
 
+  if (relpath != NULL)
+    {
+      g_autofree gchar *with_slash = g_strdup_printf ("%s%s", relpath, G_DIR_SEPARATOR_S);
+      dzl_fuzzy_mutable_index_insert (fuzzy, with_slash, NULL);
+    }
+
   enumerator = g_file_enumerate_children (directory,
                                           G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK","
                                           G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME","
                                           G_FILE_ATTRIBUTE_STANDARD_TYPE,
-                                          G_FILE_QUERY_INFO_NONE,
+                                          G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
                                           cancellable,
                                           NULL);
 


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