[nautilus] shell-search-provider: Only use location in description
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] shell-search-provider: Only use location in description
- Date: Mon, 7 Aug 2017 13:16:38 +0000 (UTC)
commit 25631200f79df674a526f556f8251ba6366d8a26
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jun 22 23:24:27 2017 +0200
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
src/nautilus-shell-search-provider.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c
index f1a610c..cdadc08 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]