[epiphany] prefs/search-engine-row: Also split words on "(" for bang generation



commit 5990bb5133f391da14c7b4f5fcb5430d6d15785e
Author: vanadiae <vanadiae35 gmail com>
Date:   Sun Dec 26 15:39:36 2021 +0100

    prefs/search-engine-row: Also split words on "(" for bang generation
    
    It allows properly handling of search engines with a name like "Wikipedia
    (en)", where the bang will end up as !we instead of !w(.
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1052>

 src/preferences/ephy-search-engine-row.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/preferences/ephy-search-engine-row.c b/src/preferences/ephy-search-engine-row.c
index 3c286200c..1953454a7 100644
--- a/src/preferences/ephy-search-engine-row.c
+++ b/src/preferences/ephy-search-engine-row.c
@@ -373,7 +373,10 @@ update_bang_for_name (EphySearchEngineRow *row,
   if (g_strcmp0 (search_engine_name, "") == 0)
     return;
 
-  words = g_strsplit (search_engine_name, " ", 0);
+  /* We ignore both the space character and opening parenthesis, as that
+   * allows us to get !we as bang with "Wikipedia (en)" as name.
+   */
+  words = g_strsplit_set (search_engine_name, " (", 0);
 
   for (; words[i] != NULL; ++i) {
     g_autofree char *uppercase_chars = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]