[epiphany/mcatanzaro/search-provider: 27/27] Fix search provider results
- From: Jan-Michael Brummer <jbrummer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/search-provider: 27/27] Fix search provider results
- Date: Sat, 6 Apr 2019 13:07:05 +0000 (UTC)
commit 742b84530353923431e43fbc98924b5d3cf69005
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Fri Apr 5 11:43:14 2019 -0500
Fix search provider results
We're displaying XML in the search provider results because the
unescaped-title property is not being set properly.
lib/ephy-suggestion.c | 14 ++++++++------
lib/ephy-suggestion.h | 6 ++++--
src/ephy-suggestion-model.c | 6 +++---
3 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/lib/ephy-suggestion.c b/lib/ephy-suggestion.c
index 09199f362..317485b21 100644
--- a/lib/ephy-suggestion.c
+++ b/lib/ephy-suggestion.c
@@ -127,7 +127,8 @@ ephy_suggestion_init (EphySuggestion *self)
}
EphySuggestion *
-ephy_suggestion_new (const char *title,
+ephy_suggestion_new (const char *title_markup,
+ const char *unescaped_title,
const char *uri)
{
EphySuggestion *suggestion;
@@ -138,8 +139,8 @@ ephy_suggestion_new (const char *title,
"icon-name", "web-browser-symbolic",
"id", uri,
"subtitle", escaped_uri,
- "title", title,
- "unescaped-title", title,
+ "title", title_markup,
+ "unescaped-title", unescaped_title,
NULL);
g_free (decoded_uri);
@@ -149,7 +150,8 @@ ephy_suggestion_new (const char *title,
}
EphySuggestion *
-ephy_suggestion_new_without_subtitle (const char *title,
+ephy_suggestion_new_without_subtitle (const char *title_markup,
+ const char *unescaped_title,
const char *uri)
{
EphySuggestion *suggestion;
@@ -157,8 +159,8 @@ ephy_suggestion_new_without_subtitle (const char *title,
suggestion = g_object_new (EPHY_TYPE_SUGGESTION,
"icon-name", "web-browser-symbolic",
"id", uri,
- "title", title,
- "unescaped-title", title,
+ "title", title_markup,
+ "unescaped-title", unescaped_title,
NULL);
return suggestion;
diff --git a/lib/ephy-suggestion.h b/lib/ephy-suggestion.h
index 943b6bf2b..3994f2340 100644
--- a/lib/ephy-suggestion.h
+++ b/lib/ephy-suggestion.h
@@ -27,9 +27,11 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (EphySuggestion, ephy_suggestion, EPHY, SUGGESTION, DzlSuggestion)
-EphySuggestion *ephy_suggestion_new (const char *title,
+EphySuggestion *ephy_suggestion_new (const char *title_markup,
+ const char *unescaped_title,
const char *uri);
-EphySuggestion *ephy_suggestion_new_without_subtitle (const char *title,
+EphySuggestion *ephy_suggestion_new_without_subtitle (const char *title_markup,
+ const char *unescaped_title,
const char *uri);
const char *ephy_suggestion_get_unescaped_title (EphySuggestion *self);
const char *ephy_suggestion_get_uri (EphySuggestion *self);
diff --git a/src/ephy-suggestion-model.c b/src/ephy-suggestion-model.c
index 6c5211c9f..0426add80 100644
--- a/src/ephy-suggestion-model.c
+++ b/src/ephy-suggestion-model.c
@@ -300,7 +300,7 @@ add_bookmarks (EphySuggestionModel *self,
escaped_title = g_markup_escape_text (title, -1);
markup = dzl_fuzzy_highlight (escaped_title, query, FALSE);
- suggestion = ephy_suggestion_new (markup, url);
+ suggestion = ephy_suggestion_new (markup, title, url);
load_favicon (self, suggestion, url);
g_sequence_append (self->items, suggestion);
@@ -331,7 +331,7 @@ add_history (EphySuggestionModel *self,
escaped_title = g_markup_escape_text (title, -1);
markup = dzl_fuzzy_highlight (escaped_title, query, FALSE);
- suggestion = ephy_suggestion_new (markup, url->url);
+ suggestion = ephy_suggestion_new (markup, title, url->url);
load_favicon (self, suggestion, url->url);
g_sequence_append (self->items, suggestion);
@@ -363,7 +363,7 @@ add_search_engines (EphySuggestionModel *self,
address = ephy_search_engine_manager_build_search_address (manager, engines[i], query);
escaped_title = g_markup_escape_text (engines[i], -1);
markup = dzl_fuzzy_highlight (escaped_title, query, FALSE);
- suggestion = ephy_suggestion_new_without_subtitle (markup, address);
+ suggestion = ephy_suggestion_new_without_subtitle (markup, engines[i], address);
load_favicon (self, suggestion, address);
g_sequence_append (self->items, suggestion);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]