瀏覽代碼

LibGUI: Remove barely used AbstractView::is_searching()

Dawid Wolosowicz 3 年之前
父節點
當前提交
cc93736f21
共有 2 個文件被更改,包括 2 次插入3 次删除
  1. 2 2
      Userland/Libraries/LibGUI/AbstractView.cpp
  2. 0 1
      Userland/Libraries/LibGUI/AbstractView.h

+ 2 - 2
Userland/Libraries/LibGUI/AbstractView.cpp

@@ -562,7 +562,7 @@ void AbstractView::keydown_event(KeyEvent& event)
 
     if (is_searchable()) {
         if (event.key() == KeyCode::Key_Backspace) {
-            if (is_searching()) {
+            if (!m_highlighted_search.is_null()) {
                 //if (event.modifiers() == Mod_Ctrl) {
                 // TODO: delete last word
                 //}
@@ -587,7 +587,7 @@ void AbstractView::keydown_event(KeyEvent& event)
                 return;
             }
         } else if (event.key() == KeyCode::Key_Escape) {
-            if (is_searching()) {
+            if (!m_highlighted_search.is_null()) {
                 stop_highlighted_search_timer();
 
                 event.accept();

+ 0 - 1
Userland/Libraries/LibGUI/AbstractView.h

@@ -162,7 +162,6 @@ protected:
     void activate_selected();
     void update_edit_widget_position();
 
-    bool is_searching() const { return !m_highlighted_search.is_null(); }
     void stop_highlighted_search_timer();
     void start_highlighted_search_timer();
     void do_search(String&&);