[epiphany/gnome-3-32] Do not show search entries without title first
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-32] Do not show search entries without title first
- Date: Sun, 17 Mar 2019 16:05:26 +0000 (UTC)
commit ac3a361416d5753a236919a501849473b50588f3
Author: Jan-Michael Brummer <jan brummer tabos org>
Date: Sun Mar 17 13:17:38 2019 +0000
Do not show search entries without title first
In case page title is not set, use url instead for search queries.
Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/579
(cherry picked from commit dcc94d3287618f6c3eed94517a6cdd9fd17c2de8)
src/ephy-suggestion-model.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/ephy-suggestion-model.c b/src/ephy-suggestion-model.c
index 364f85159..6c5211c9f 100644
--- a/src/ephy-suggestion-model.c
+++ b/src/ephy-suggestion-model.c
@@ -290,6 +290,9 @@ add_bookmarks (EphySuggestionModel *self,
url = ephy_bookmark_get_url (bookmark);
title = ephy_bookmark_get_title (bookmark);
+ if (strlen (title) == 0)
+ title = url;
+
if (should_add_bookmark_to_model (self, query, title, url)) {
EphySuggestion *suggestion;
g_autofree gchar *escaped_title = NULL;
@@ -320,8 +323,13 @@ add_history (EphySuggestionModel *self,
EphySuggestion *suggestion;
g_autofree gchar *escaped_title = NULL;
g_autofree gchar *markup = NULL;
+ const gchar *title = url->title;
+
+ if (strlen (url->title) == 0)
+ title = url->url;
+
+ escaped_title = g_markup_escape_text (title, -1);
- escaped_title = g_markup_escape_text (url->title, -1);
markup = dzl_fuzzy_highlight (escaped_title, query, FALSE);
suggestion = ephy_suggestion_new (markup, url->url);
load_favicon (self, suggestion, url->url);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]