mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-02-03 20:37:15 +08:00
added patch to be able to disable baloo (https://bugs.kde.org/show_bug.cgi?id=331932#c59)
This commit is contained in:
parent
6caf747c2e
commit
3a5688418b
@ -7,7 +7,7 @@ source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
|
||||
pkgname="baloo"
|
||||
arch=('x86_64')
|
||||
pkgver=${_kdever}
|
||||
pkgrel=2
|
||||
pkgrel=3
|
||||
pkgdesc="The core baloo system"
|
||||
url="http://www.kde.org"
|
||||
license=('GPL'
|
||||
@ -27,8 +27,16 @@ makedepends=('pkg-config'
|
||||
'doxygen')
|
||||
optdepends=("nepomuk-core: To migrate nepomuk metadata to baloo")
|
||||
install="baloo.install"
|
||||
source=($_mirror/${pkgname}-$_kdever.tar.xz)
|
||||
sha256sums=(`grep ${pkgname}-$_kdever.tar.xz ../checksums.txt | cut -d" " -f1`)
|
||||
source=($_mirror/${pkgname}-$_kdever.tar.xz
|
||||
'add_disable_kcm.diff')
|
||||
sha256sums=(`grep ${pkgname}-$_kdever.tar.xz ../checksums.txt | cut -d" " -f1`
|
||||
'e524850a76bc9e7499c8f2702e186c8fba978b670d9b6cb45902fe93cc133f2d')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
# https://bugs.kde.org/show_bug.cgi?id=331932#c59
|
||||
patch -p1 -i "${srcdir}/add_disable_kcm.diff"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
|
109
baloo/add_disable_kcm.diff
Normal file
109
baloo/add_disable_kcm.diff
Normal file
@ -0,0 +1,109 @@
|
||||
commit 77a4ec2cd7e59035efe895e12912c0695b11deef
|
||||
Author: Vishesh Handa <me@vhanda.in>
|
||||
Date: Tue Apr 22 16:29:12 2014 +0200
|
||||
|
||||
Add an explicit disable checkbox for Baloo
|
||||
|
||||
This adds a new string "Enable Desktop Search"
|
||||
|
||||
FEATURE: 331932
|
||||
FIXED-IN: 4.13.1
|
||||
CCMAIL: kde-i18n-doc@kde.org
|
||||
|
||||
diff --git a/src/file/kcm/configwidget.ui b/src/file/kcm/configwidget.ui
|
||||
index 484ec2c..0d12432 100644
|
||||
--- a/src/file/kcm/configwidget.ui
|
||||
+++ b/src/file/kcm/configwidget.ui
|
||||
@@ -55,6 +55,13 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
+ <widget class="QCheckBox" name="m_enableCheckbox">
|
||||
+ <property name="text">
|
||||
+ <string>Enable Desktop Search</string>
|
||||
+ </property>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
+ <item>
|
||||
<spacer name="bottomSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
diff --git a/src/file/kcm/kcm.cpp b/src/file/kcm/kcm.cpp
|
||||
index f40d365..10a242e 100644
|
||||
--- a/src/file/kcm/kcm.cpp
|
||||
+++ b/src/file/kcm/kcm.cpp
|
||||
@@ -70,6 +70,10 @@ ServerConfigModule::ServerConfigModule(QWidget* parent, const QVariantList& args
|
||||
|
||||
connect(m_folderSelectionWidget, SIGNAL(changed()),
|
||||
this, SLOT(changed()));
|
||||
+ connect(m_folderSelectionWidget, SIGNAL(changed()),
|
||||
+ this, SLOT(folderSelectionChanged()));
|
||||
+ connect(m_enableCheckbox, SIGNAL(stateChanged(int)),
|
||||
+ this, SLOT(changed()));
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +88,10 @@ void ServerConfigModule::load()
|
||||
KConfig config("baloofilerc");
|
||||
KConfigGroup group = config.group("General");
|
||||
|
||||
+ KConfigGroup basicSettings = config.group("Basic Settings");
|
||||
+ m_previouslyEnabled = basicSettings.readEntry("Indexing-Enabled", true);
|
||||
+ m_enableCheckbox->setChecked(m_previouslyEnabled);
|
||||
+
|
||||
QStringList includeFolders = group.readPathEntry("folders", defaultFolders());
|
||||
QStringList excludeFolders = group.readPathEntry("exclude folders", QStringList());
|
||||
m_folderSelectionWidget->setFolders(includeFolders, excludeFolders);
|
||||
@@ -102,15 +110,24 @@ void ServerConfigModule::save()
|
||||
KConfig config("baloofilerc");
|
||||
KConfigGroup basicSettings = config.group("Basic Settings");
|
||||
|
||||
- bool indexingEnabled = !m_folderSelectionWidget->allMountPointsExcluded();
|
||||
- basicSettings.writeEntry("Indexing-Enabled", indexingEnabled);
|
||||
+ bool mountPointsEx = m_folderSelectionWidget->allMountPointsExcluded();
|
||||
+
|
||||
+ bool enabled = m_enableCheckbox->isChecked();
|
||||
+ if (mountPointsEx)
|
||||
+ enabled = false;
|
||||
+
|
||||
+ basicSettings.writeEntry("Indexing-Enabled", enabled);
|
||||
|
||||
// 2.2 Update normals paths
|
||||
config.group("General").writePathEntry("folders", includeFolders);
|
||||
config.group("General").writePathEntry("exclude folders", excludeFolders);
|
||||
|
||||
+ if (m_previouslyEnabled != enabled) {
|
||||
+ config.group("General").deleteEntry("first run");
|
||||
+ }
|
||||
+
|
||||
// Start Baloo
|
||||
- if (indexingEnabled) {
|
||||
+ if (enabled) {
|
||||
const QString exe = KStandardDirs::findExe(QLatin1String("baloo_file"));
|
||||
QProcess::startDetached(exe);
|
||||
}
|
||||
@@ -137,4 +154,10 @@ void ServerConfigModule::defaults()
|
||||
m_folderSelectionWidget->setFolders(defaultFolders(), QStringList());
|
||||
}
|
||||
|
||||
+void ServerConfigModule::folderSelectionChanged()
|
||||
+{
|
||||
+ bool disabled = m_folderSelectionWidget->allMountPointsExcluded();
|
||||
+ m_enableCheckbox->setChecked(!disabled);
|
||||
+}
|
||||
+
|
||||
#include "kcm.moc"
|
||||
diff --git a/src/file/kcm/kcm.h b/src/file/kcm/kcm.h
|
||||
index 440849d..6ff5813 100644
|
||||
--- a/src/file/kcm/kcm.h
|
||||
+++ b/src/file/kcm/kcm.h
|
||||
@@ -39,7 +39,9 @@ public Q_SLOTS:
|
||||
void save();
|
||||
void defaults();
|
||||
|
||||
+ void folderSelectionChanged();
|
||||
private:
|
||||
+ bool m_previouslyEnabled;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user