X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c161b895ffd8d62371ec288cf4105386350a8a3c..e19aa49a082076d5ae69931893c1d47b98f85e30:/src/search/dolphinsearchbox.cpp diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 9143ddcb7..26c78c111 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -9,14 +9,14 @@ #include "dolphin_searchsettings.h" #include "dolphinfacetswidget.h" +#include "dolphinplacesmodelsingleton.h" #include "dolphinquery.h" -#include "panels/places/placesitemmodel.h" #include -#include +#include #include -#include -#ifdef HAVE_BALOO +#include "config-dolphin.h" +#if HAVE_BALOO #include #include #endif @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -288,11 +287,8 @@ void DolphinSearchBox::slotSearchSaved() { const QUrl searchURL = urlForSearching(); if (searchURL.isValid()) { - PlacesItemModel model; const QString label = i18n("Search for %1 in %2", text(), searchPath().fileName()); - model.createPlacesItem(label, - searchURL, - QStringLiteral("folder-saved-search-symbolic")); + DolphinPlacesModelSingleton::instance().placesModel()->addPlace(label, searchURL, QStringLiteral("folder-saved-search-symbolic")); } } @@ -443,7 +439,7 @@ void DolphinSearchBox::init() m_optionsScrollArea->setWidgetResizable(true); m_topLayout = new QVBoxLayout(this); - m_topLayout->setContentsMargins(0, 0, 0, 0); + m_topLayout->setContentsMargins(0, Dolphin::LAYOUT_SPACING_SMALL, 0, 0); m_topLayout->setSpacing(Dolphin::LAYOUT_SPACING_SMALL); m_topLayout->addLayout(searchInputLayout); m_topLayout->addWidget(m_optionsScrollArea); @@ -467,7 +463,7 @@ QString DolphinSearchBox::queryTitle(const QString& text) const QUrl DolphinSearchBox::balooUrlForSearching() const { -#ifdef HAVE_BALOO +#if HAVE_BALOO const QString text = m_searchInput->text(); Baloo::Query query; @@ -537,7 +533,7 @@ void DolphinSearchBox::updateFacetsVisible() bool DolphinSearchBox::isIndexingEnabled() const { -#ifdef HAVE_BALOO +#if HAVE_BALOO const Baloo::IndexerConfig searchInfo; return searchInfo.fileIndexingEnabled() && !searchPath().isEmpty() && searchInfo.shouldBeIndexed(searchPath().toLocalFile()); #else