summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2017-06-22 23:24:27 +0200
committerFlorian Müllner <fmuellner@gnome.org>2017-08-07 15:15:34 +0200
commit25631200f79df674a526f556f8251ba6366d8a26 (patch)
tree9d2bc32d1a44a93b1edf68bfdc3a7c990d30a648
parent767c7ad95aa9476e13b6947c9d24fa21d67ec151 (diff)
downloadnautilus-25631200f79df674a526f556f8251ba6366d8a26.tar.gz
shell-search-provider: Only use location in description
The filename is likely to match the display name, which is already prominently used as the result name, so including it in the description doesn't add any information. In fact, as gnome-shell is about to display name and description on a single line[0], duplicating the filename increases the chances of less information being displayed due to ellipsization. [0] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/shell/search/search-list-layout.png https://bugzilla.gnome.org/show_bug.cgi?id=784105
-rw-r--r--src/nautilus-shell-search-provider.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c
index f1a610c19..cdadc08d3 100644
--- a/src/nautilus-shell-search-provider.c
+++ b/src/nautilus-shell-search-provider.c
@@ -566,7 +566,7 @@ result_list_attributes_ready_cb (GList *file_list,
GFile *file_location;
GList *l;
gchar *uri, *display_name;
- gchar *description;
+ gchar *path, *description;
gchar *thumbnail_path;
GIcon *gicon;
GFile *location;
@@ -583,7 +583,8 @@ result_list_attributes_ready_cb (GList *file_list,
uri = nautilus_file_get_uri (file);
display_name = get_display_name (data->self, file);
file_location = nautilus_file_get_location (file);
- description = g_file_get_path (file_location);
+ path = g_file_get_path (file_location);
+ description = path ? g_path_get_dirname (path) : NULL;
g_variant_builder_add (&meta, "{sv}",
"id", g_variant_new_string (uri));
@@ -625,6 +626,7 @@ result_list_attributes_ready_cb (GList *file_list,
g_strdup (uri), g_variant_ref_sink (meta_variant));
g_free (display_name);
+ g_free (path);
g_free (description);
g_free (uri);
}