summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Vogt <[email protected]>2017-04-08 16:02:49 +0200
committerFabian Vogt <[email protected]>2017-04-12 14:58:13 +0200
commita818d2f0ad30bb14718f296690a95ef55ed5a9db (patch)
treefc851fac25ff16d0b0cddd7c2cf5bb9ac6766c43
parent373fd101c77fd7969f8b9e9683657219d8d13224 (diff)
kcm_baloofile: Add option to disable file content indexing
Summary: Baloo supports "only basic indexing" since version 5.15, which causes it to only store file names into the database: https://community.kde.org/Baloo/Configuration Test Plan: Ran "balooctl config show contentIndexing" after changing the option. Reviewers: #plasma, mart Reviewed By: mart Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5351
-rw-r--r--CMakeLists.txt2
-rw-r--r--kcms/baloo/configwidget.ui7
-rw-r--r--kcms/baloo/kcm.cpp11
-rw-r--r--kcms/baloo/kcm.h1
4 files changed, 20 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e8ef25..04c1309 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,7 +69,7 @@ set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Appstream integration
TYPE RECOMMENDED
PURPOSE "Needed to allow appstream integration from application menus"
)
-find_package(KF5Baloo)
+find_package(KF5Baloo 5.15)
set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "File Searching"
TYPE RECOMMENDED
PURPOSE "Needed to build the File Search KCM"
diff --git a/kcms/baloo/configwidget.ui b/kcms/baloo/configwidget.ui
index 63103f0..bd13169 100644
--- a/kcms/baloo/configwidget.ui
+++ b/kcms/baloo/configwidget.ui
@@ -40,6 +40,13 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="m_enableContentIndexing">
+ <property name="text">
+ <string>Also index file content</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QGroupBox" name="m_excludeFolders_GB">
<property name="title">
<string>Do not search in these locations</string>
diff --git a/kcms/baloo/kcm.cpp b/kcms/baloo/kcm.cpp
index 9657496..a192ad5 100644
--- a/kcms/baloo/kcm.cpp
+++ b/kcms/baloo/kcm.cpp
@@ -73,6 +73,8 @@ ServerConfigModule::ServerConfigModule(QWidget* parent, const QVariantList& args
this, &ServerConfigModule::onDirectoryListChanged);
connect(m_enableCheckbox, SIGNAL(stateChanged(int)),
this, SLOT(changed()));
+ connect(m_enableCheckbox, SIGNAL(stateChanged(int)),
+ this, SLOT(indexingEnabledChanged()));
}
@@ -88,6 +90,9 @@ void ServerConfigModule::load()
m_previouslyEnabled = config.fileIndexingEnabled();
m_enableCheckbox->setChecked(m_previouslyEnabled);
+ m_enableContentIndexing->setChecked(!config.onlyBasicIndexing());
+ m_enableContentIndexing->setEnabled(m_enableCheckbox->isChecked());
+
QStringList includeFolders = config.includeFolders();
QStringList excludeFolders = config.excludeFolders();
m_excludeFolders_FSW->setDirectoryList(includeFolders, excludeFolders);
@@ -112,6 +117,7 @@ void ServerConfigModule::save()
config.setFileIndexingEnabled(enabled);
config.setIncludeFolders(includeFolders);
config.setExcludeFolders(excludeFolders);
+ config.setOnlyBasicIndexing(!m_enableContentIndexing->isChecked());
if (m_previouslyEnabled != enabled) {
config.setFirstRun(true);
@@ -148,6 +154,11 @@ void ServerConfigModule::defaults()
m_excludeFolders_FSW->setDirectoryList(defaultFolders(), QStringList());
}
+void ServerConfigModule::indexingEnabledChanged()
+{
+ m_enableContentIndexing->setEnabled(m_enableCheckbox->isChecked());
+}
+
void ServerConfigModule::onDirectoryListChanged()
{
m_enableCheckbox->setChecked(!allMountPointsExcluded());
diff --git a/kcms/baloo/kcm.h b/kcms/baloo/kcm.h
index 829610a..f093d02 100644
--- a/kcms/baloo/kcm.h
+++ b/kcms/baloo/kcm.h
@@ -38,6 +38,7 @@ public Q_SLOTS:
void load();
void save();
void defaults();
+ void indexingEnabledChanged();
void onDirectoryListChanged();
private: