- m_searchInput = new KLineEdit(this);
- m_searchInput->setClearButtonShown(true);
- m_searchInput->setFont(KGlobalSettings::generalFont());
+#ifdef HAVE_BALOO
+ m_queryParser.reset(new Baloo::NaturalFileQueryParser);
+ m_searchInput = new Baloo::QueryBuilder(m_queryParser.data(), this);
+ connect(m_searchInput, &Baloo::QueryBuilder::editingFinished,
+ this, &DolphinSearchBox::slotReturnPressed);
+ connect(m_searchInput, &Baloo::QueryBuilder::textChanged,
+ this, &DolphinSearchBox::slotSearchTextChanged);
+#else
+ m_searchInput = new QLineEdit(this);
+ m_searchInput->installEventFilter(this);
+ m_searchInput->setClearButtonEnabled(true);
+ m_searchInput->setFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont));
+ connect(m_searchInput, &QLineEdit::returnPressed,
+ this, &DolphinSearchBox::slotReturnPressed);
+ connect(m_searchInput, &QLineEdit::textChanged,
+ this, &DolphinSearchBox::slotSearchTextChanged);
+#endif