[gnome-builder] search: add directory in second row of result.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] search: add directory in second row of result.
- Date: Mon, 19 Jan 2015 08:00:43 +0000 (UTC)
commit 2b9d941ec085c1680b2aa5c6ec7c034dbdc05405
Author: Christian Hergert <christian hergert me>
Date: Mon Jan 19 00:00:24 2015 -0800
search: add directory in second row of result.
Clean up the style of the search results a little bit. I still want to
highlight matching characters though.
src/git/gb-git-search-provider.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/git/gb-git-search-provider.c b/src/git/gb-git-search-provider.c
index ca4e56b..dd659e6 100644
--- a/src/git/gb-git-search-provider.c
+++ b/src/git/gb-git-search-provider.c
@@ -348,12 +348,15 @@ gb_git_search_provider_populate (GbSearchProvider *provider,
if (gb_search_reducer_accepts (&reducer, match->score))
{
GbSearchResult *result;
+ gchar *markup;
parts = split_path (match->value, &shortname);
for (j = 0; parts [j]; j++)
g_string_append_printf (str, " / %s", parts [j]);
- result = gb_search_result_new (match->value, match->score);
+ markup = g_strdup_printf ("%s\n<span color='#a8a8a8'>%s</span>",
+ shortname, str->str);
+ result = gb_search_result_new (markup, match->score);
g_object_set_qdata_full (G_OBJECT (result), gQuarkPath,
g_strdup (match->value), g_free);
g_signal_connect (result,
@@ -363,6 +366,7 @@ gb_git_search_provider_populate (GbSearchProvider *provider,
gb_search_reducer_push (&reducer, result);
g_object_unref (result);
+ g_free (markup);
g_free (shortname);
g_strfreev (parts);
g_string_truncate (str, truncate_len);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]