]> git.sur5r.net Git - minitube/commitdiff
Autocompleter refinements
authorFlavio Tordini <flavio.tordini@gmail.com>
Wed, 29 Jul 2009 08:52:00 +0000 (10:52 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Wed, 29 Jul 2009 08:52:00 +0000 (10:52 +0200)
src/searchlineedit.cpp
src/searchlineedit.h

index 3c4e1faa79040555fd2bd565092d8ca81751d7b2..01b8fc2fa4c92b643676a159d0639a73f11da72e 100644 (file)
@@ -176,7 +176,7 @@ m_searchButton(new SearchButton(this))
     setSizePolicy(QSizePolicy::Preferred, policy.verticalPolicy());
 
     // completion
-    completion = new GSuggestCompletion(m_lineEdit);
+    completion = new GSuggestCompletion(this, m_lineEdit);
 }
 
 void SearchLineEdit::paintEvent(QPaintEvent *event)
@@ -246,3 +246,11 @@ void SearchLineEdit::returnPressed()
     completion->preventSuggest();
     emit search(lineEdit()->text());
 }
+
+void SearchLineEdit::enableSuggest() {
+    completion->enableSuggest();
+}
+
+void SearchLineEdit::preventSuggest() {
+    completion->preventSuggest();
+}
index 99ab26678c052ba86a95840294e5c088b4db4f8e..36c8fe1ef9010615998d7af387f92275cbd5b85b 100644 (file)
@@ -86,6 +86,8 @@ public:
     QMenu *menu() const;
     void setMenu(QMenu *menu);
     void updateGeometries();
+    void enableSuggest();
+    void preventSuggest();
 
 protected:
     void resizeEvent(QResizeEvent *event);