[epiphany] prefs/search-engine-row: Only update bang from name when there isn't one already



commit f84891c92c0b56bcaf2d971c3b36f8926b31f7dd
Author: vanadiae <vanadiae35 gmail com>
Date:   Mon Dec 27 23:51:27 2021 +0100

    prefs/search-engine-row: Only update bang from name when there isn't one already
    
    Because it's just annoying otherwise. See comment in code for details.
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1052>

 src/preferences/ephy-search-engine-row.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/preferences/ephy-search-engine-row.c b/src/preferences/ephy-search-engine-row.c
index ac80d1950..4b76469d7 100644
--- a/src/preferences/ephy-search-engine-row.c
+++ b/src/preferences/ephy-search-engine-row.c
@@ -444,7 +444,14 @@ on_name_entry_text_changed_cb (EphySearchEngineRow *row,
         g_strcmp0 (new_name, EMPTY_NEW_SEARCH_ENGINE_NAME) != 0)
       ephy_search_engine_list_box_set_can_add_engine (search_engine_list_box, TRUE);
 
-    update_bang_for_name (row, new_name);
+    /* Let's not overwrite any existing bang, as that's likely not what is wanted.
+     * For example when I wanted to rename my "wiktionary en" search engine that
+     * had the !wte bang, it replaced the bang with !we, which is the one for
+     * "Wikipedia (en)". That's just annoying, so only do it when there hasn't
+     * been any bang added yet.
+     */
+    if (g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (row->bang_entry)), "") == 0)
+      update_bang_for_name (row, new_name);
 
     ephy_search_engine_manager_rename (row->manager,
                                        row->saved_name,


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