]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/search/dolphinsearchbox.cpp
* Adjust code to use the improved KUrlNavigator API.
[dolphin.git] / src / search / dolphinsearchbox.cpp
index c9a86111f643e5611678af7340c1250998731082..1dcb381ddeea91f23f6f343842f891c902228c67 100644 (file)
@@ -61,8 +61,8 @@ DolphinSearchCompleter::DolphinSearchCompleter(KLineEdit* linedit) :
         foreach (const Nepomuk::Tag& tag, tags) {
             const QString tagText = tag.label();
             addCompletionItem(tagText,
-                              "tag:\"" + tagText + '\"',
-                              i18nc("Tag as in Nepomuk::Tag", "Tag"),
+                              "hasTag:\"" + tagText + '\"',
+                              i18nc("Tag as in Nepomuk::Tag", "Tag"), // TODO: change to "hasTag" after msg freeze
                               QString(),
                               KIcon("mail-tagged"));
         }
@@ -236,7 +236,6 @@ void DolphinSearchCompleter::highlighted(const QModelIndex& index)
 DolphinSearchBox::DolphinSearchBox(QWidget* parent) :
     QWidget(parent),
     m_searchInput(0),
-    m_searchButton(0),
     m_completer(0)
 {
     QHBoxLayout* hLayout = new QHBoxLayout(this);
@@ -251,20 +250,19 @@ DolphinSearchBox::DolphinSearchBox(QWidget* parent) :
     hLayout->addWidget(m_searchInput);
     connect(m_searchInput, SIGNAL(returnPressed()),
             this, SLOT(emitSearchSignal()));
-
-    m_searchButton = new QToolButton(this);
-    m_searchButton->setAutoRaise(true);
-    m_searchButton->setIcon(KIcon("edit-find"));
-    m_searchButton->setToolTip(i18nc("@info:tooltip", "Click to begin the search"));
-    hLayout->addWidget(m_searchButton);
-    connect(m_searchButton, SIGNAL(clicked()),
-            this, SLOT(emitSearchSignal()));
+    connect(m_searchInput, SIGNAL(textChanged(QString)),
+            this, SIGNAL(searchTextChanged(QString)));
 }
 
 DolphinSearchBox::~DolphinSearchBox()
 {
 }
 
+QString DolphinSearchBox::text() const
+{
+    return m_searchInput->text();
+}
+
 bool DolphinSearchBox::event(QEvent* event)
 {
     if (event->type() == QEvent::Polish) {
@@ -295,7 +293,7 @@ bool DolphinSearchBox::eventFilter(QObject* watched, QEvent* event)
 
 void DolphinSearchBox::emitSearchSignal()
 {
-    emit search(KUrl("nepomuksearch:/" + m_searchInput->text()));
+    emit search(m_searchInput->text());
 }
 
 #include "dolphinsearchbox.moc"