[devhelp] Sidebar: remove old, no longer relevant feature, pressing Enter in entry



commit 5496799c45953985e80c8845a8f84dfbc0571297
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat May 19 12:26:58 2018 +0200

    Sidebar: remove old, no longer relevant feature, pressing Enter in entry
    
    In Devhelp at commit 455440a93d1b55d5a1e53ecabb2ee33093eec965 (in 2003),
    dh_keyword_model_filter() returns a DhLink only if the DhKeywordModel
    contains only one element.
    
    Now dh_keyword_model_filter() (which still exists!) returns the exact
    match if it found one, even if the DhKeywordModel contains several
    elements.
    
    In both cases (in 2003 and now), when dh_keyword_model_filter() returns
    a DhLink, the HTML web view jumps to that link.
    (dh_keyword_model_filter() is used to launch the search).
    
    So back then in 2003, it made sense to add the feature in the GtkEntry
    to press Enter to select the first search result. But now I think it
    doesn't make sense anymore. If you disagree with me, please open a bug
    and explain your use-case precisely, why you relied on that feature.

 devhelp/dh-sidebar.c |   40 ----------------------------------------
 1 files changed, 0 insertions(+), 40 deletions(-)
---
diff --git a/devhelp/dh-sidebar.c b/devhelp/dh-sidebar.c
index 1c4c206..9a13397 100644
--- a/devhelp/dh-sidebar.c
+++ b/devhelp/dh-sidebar.c
@@ -282,46 +282,6 @@ entry_key_press_event_cb (GtkEntry    *entry,
                 return GDK_EVENT_STOP;
         }
 
-        if (event->keyval == GDK_KEY_Return ||
-            event->keyval == GDK_KEY_KP_Enter) {
-                GtkTreeIter iter;
-                DhLink *link;
-                gchar *name;
-
-                /* Get the first entry found.
-                 *
-                 * FIXME: is it really useful to do that? If there is an exact
-                 * match it already gets selected, so it seems that the feature
-                 * here just selects a random symbol (the one that appears to be
-                 * the first in the list).
-                 * I've never used this feature -- swilmet.
-                 * This has been implemented in
-                 * commit 455440a93d1b55d5a1e53ecabb2ee33093eec965
-                 * and https://bugzilla.gnome.org/show_bug.cgi?id=114558
-                 * but maybe at that time the search didn't jump to the exact
-                 * match if there was one.
-                 */
-                if (gtk_widget_is_visible (GTK_WIDGET (priv->hitlist_view)) &&
-                    gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->hitlist_model), &iter)) {
-                        gtk_tree_model_get (GTK_TREE_MODEL (priv->hitlist_model),
-                                            &iter,
-                                            DH_KEYWORD_MODEL_COL_LINK, &link,
-                                            DH_KEYWORD_MODEL_COL_NAME, &name,
-                                            -1);
-
-                        gtk_entry_set_text (entry, name);
-                        g_free (name);
-
-                        gtk_editable_select_region (GTK_EDITABLE (entry), 0, 0);
-                        gtk_editable_set_position (GTK_EDITABLE (entry), -1);
-
-                        g_signal_emit (sidebar, signals[SIGNAL_LINK_SELECTED], 0, link);
-                        dh_link_unref (link);
-
-                        return GDK_EVENT_STOP;
-                }
-        }
-
         return GDK_EVENT_PROPAGATE;
 }
 


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