X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/5d63b9a111e6ae76ff7b9f5ba9cd26be873aa115..2b75a555caa81a992a289a13119dca5cce79d4cc:/src/search/dolphinsearchbox.cpp diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 46ca01a4c..ae93030ac 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -41,9 +42,9 @@ #include #ifdef HAVE_BALOO - #include - #include - #include + #include + #include + #include #endif DolphinSearchBox::DolphinSearchBox(QWidget* parent) : @@ -287,7 +288,7 @@ void DolphinSearchBox::initButton(QToolButton* button) button->setAutoExclusive(true); button->setAutoRaise(true); button->setCheckable(true); - connect(button, SIGNAL(clicked(bool)), this, SLOT(slotConfigurationChanged())); + connect(button, &QToolButton::clicked, this, &DolphinSearchBox::slotConfigurationChanged); } void DolphinSearchBox::loadSettings() @@ -322,7 +323,7 @@ void DolphinSearchBox::init() closeButton->setAutoRaise(true); closeButton->setIcon(KIcon("dialog-close")); closeButton->setToolTip(i18nc("@info:tooltip", "Quit searching")); - connect(closeButton, SIGNAL(clicked()), this, SLOT(emitCloseRequest())); + connect(closeButton, &QToolButton::clicked, this, &DolphinSearchBox::emitCloseRequest); // Create search label m_searchLabel = new QLabel(this); @@ -333,10 +334,10 @@ void DolphinSearchBox::init() m_searchInput->setClearButtonShown(true); m_searchInput->setFont(KGlobalSettings::generalFont()); setFocusProxy(m_searchInput); - connect(m_searchInput, SIGNAL(returnPressed(QString)), - this, SLOT(slotReturnPressed(QString))); - connect(m_searchInput, SIGNAL(textChanged(QString)), - this, SLOT(slotSearchTextChanged(QString))); + connect(m_searchInput, static_cast(&KLineEdit::returnPressed), + this, &DolphinSearchBox::slotReturnPressed); + connect(m_searchInput, &KLineEdit::textChanged, + this, &DolphinSearchBox::slotSearchTextChanged); // Apply layout for the search input QHBoxLayout* searchInputLayout = new QHBoxLayout(); @@ -377,12 +378,12 @@ void DolphinSearchBox::init() m_facetsToggleButton = new QToolButton(this); m_facetsToggleButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); initButton(m_facetsToggleButton); - connect(m_facetsToggleButton, SIGNAL(clicked()), this, SLOT(slotFacetsButtonToggled())); + connect(m_facetsToggleButton, &QToolButton::clicked, this, &DolphinSearchBox::slotFacetsButtonToggled); m_facetsWidget = new DolphinFacetsWidget(this); m_facetsWidget->installEventFilter(this); m_facetsWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); - connect(m_facetsWidget, SIGNAL(facetChanged()), this, SLOT(slotFacetChanged())); + connect(m_facetsWidget, &DolphinFacetsWidget::facetChanged, this, &DolphinSearchBox::slotFacetChanged); // Apply layout for the options QHBoxLayout* optionsLayout = new QHBoxLayout(); @@ -422,7 +423,7 @@ void DolphinSearchBox::init() m_startSearchTimer = new QTimer(this); m_startSearchTimer->setSingleShot(true); m_startSearchTimer->setInterval(1000); - connect(m_startSearchTimer, SIGNAL(timeout()), this, SLOT(emitSearchRequest())); + connect(m_startSearchTimer, &QTimer::timeout, this, &DolphinSearchBox::emitSearchRequest); updateFacetsToggleButton(); } @@ -472,7 +473,7 @@ void DolphinSearchBox::fromBalooSearchUrl(const KUrl& url) // while we adjust the search text and the facet widget. blockSignals(true); - const QVariantHash customOptions = query.customOptions(); + const QVariantMap customOptions = query.customOptions(); if (customOptions.contains("includeFolder")) { setSearchPath(customOptions.value("includeFolder").toString()); } else { @@ -512,4 +513,3 @@ void DolphinSearchBox::updateFacetsToggleButton() m_facetsToggleButton->setText(facetsIsVisible ? i18nc("action:button", "Fewer Options") : i18nc("action:button", "More Options")); } -#include "dolphinsearchbox.moc"