]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/search/dolphinsearchbox.cpp
Merge remote-tracking branch 'origin/master' into frameworks
[dolphin.git] / src / search / dolphinsearchbox.cpp
index 0fb1e41d7c1c129f215dc454cbac247a5bb60918..b8b1dbbca403a5f0afc20c597d1eefca96c54aa7 100644 (file)
@@ -47,6 +47,7 @@
     #include <Baloo/Term>
     #include <Baloo/IndexerConfig>
 #endif
+#include <QFontDatabase>
 
 DolphinSearchBox::DolphinSearchBox(QWidget* parent) :
     QWidget(parent),
@@ -324,7 +325,7 @@ void DolphinSearchBox::saveSettings()
     SearchSettings::setLocation(m_fromHereButton->isChecked() ? "FromHere" : "Everywhere");
     SearchSettings::setWhat(m_fileNameButton->isChecked() ? "FileName" : "Content");
     SearchSettings::setShowFacetsWidget(m_facetsToggleButton->isChecked());
-    SearchSettings::self()->writeConfig();
+    SearchSettings::self()->save();
 }
 
 void DolphinSearchBox::init()
@@ -351,7 +352,7 @@ void DolphinSearchBox::init()
     m_searchInput = new KLineEdit(this);
     m_searchInput->installEventFilter(this);
     m_searchInput->setClearButtonShown(true);
-    m_searchInput->setFont(KGlobalSettings::generalFont());
+    m_searchInput->setFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont));
     connect(m_searchInput, &KLineEdit::returnPressed,
             this, &DolphinSearchBox::slotReturnPressed);
     connect(m_searchInput, &KLineEdit::textChanged,
@@ -478,7 +479,7 @@ KUrl DolphinSearchBox::balooUrlForSearching() const
     }
 
     if (m_fromHereButton->isChecked()) {
-        query.addCustomOption("includeFolder", m_searchPath.toLocalFile());
+        query.setIncludeFolder(m_searchPath.toLocalFile());
     }
 
     return query.toSearchUrl(i18nc("@title UDS_DISPLAY_NAME for a KIO directory listing. %1 is the query the user entered.",
@@ -498,9 +499,9 @@ void DolphinSearchBox::fromBalooSearchUrl(const KUrl& url)
     // while we adjust the search text and the facet widget.
     blockSignals(true);
 
-    const QVariantMap customOptions = query.customOptions();
-    if (customOptions.contains("includeFolder")) {
-        setSearchPath(customOptions.value("includeFolder").toString());
+    const QString customDir = query.includeFolder();
+    if (!customDir.isEmpty()) {
+        setSearchPath(customDir);
     } else {
         setSearchPath(QDir::homePath());
     }