File 0001-kcm_baloofile-Add-option-to-disable-file-content-ind.patch of Package plasma5-desktop

From a818d2f0ad30bb14718f296690a95ef55ed5a9db Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Sat, 8 Apr 2017 16:02:49 +0200
Subject: [PATCH] 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
---
 kcms/baloo/configwidget.ui |    7 +++++++
 kcms/baloo/kcm.cpp         |   11 +++++++++++
 kcms/baloo/kcm.h           |    1 +
 3 files changed, 19 insertions(+)

Index: plasma-desktop-5.8.6/kcms/baloo/configwidget.ui
===================================================================
--- plasma-desktop-5.8.6.orig/kcms/baloo/configwidget.ui
+++ plasma-desktop-5.8.6/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>
Index: plasma-desktop-5.8.6/kcms/baloo/kcm.cpp
===================================================================
--- plasma-desktop-5.8.6.orig/kcms/baloo/kcm.cpp
+++ plasma-desktop-5.8.6/kcms/baloo/kcm.cpp
@@ -73,6 +73,8 @@ ServerConfigModule::ServerConfigModule(Q
             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());
Index: plasma-desktop-5.8.6/kcms/baloo/kcm.h
===================================================================
--- plasma-desktop-5.8.6.orig/kcms/baloo/kcm.h
+++ plasma-desktop-5.8.6/kcms/baloo/kcm.h
@@ -38,6 +38,7 @@ public Q_SLOTS:
     void load();
     void save();
     void defaults();
+    void indexingEnabledChanged();
 
     void onDirectoryListChanged();
 private:
openSUSE Build Service is sponsored by