diff options
author | vanadiae <vanadiae35@gmail.com> | 2021-12-27 23:51:27 +0100 |
---|---|---|
committer | vanadiae <vanadiae35@gmail.com> | 2021-12-28 00:26:06 +0100 |
commit | f84891c92c0b56bcaf2d971c3b36f8926b31f7dd (patch) | |
tree | 87182ef83d2468796e3ec178aed023ccb2078b90 | |
parent | a25f4f6836145e12f7b9cc3b79995ee4d7db96be (diff) | |
download | epiphany-f84891c92c0b56bcaf2d971c3b36f8926b31f7dd.tar.gz |
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>
-rw-r--r-- | src/preferences/ephy-search-engine-row.c | 9 |
1 files changed, 8 insertions, 1 deletions
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, |