X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/4f24794fc32cd94dfbd473fa8dbc4b504c20bcb3..233a08164f79d9909693c5de438f856467ad5b76:/src/search/dolphinsearchbox.cpp diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index c9a86111f..1dcb381dd 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -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"