Commit 7206fd57 authored by Yerrey Dev's avatar Yerrey Dev Committed by Fushan Wen
Browse files

kcms/baloo: Fix state checking and button behaviour

Currently `currentlyIndexing` function always returns `true` as `monitor.IndexerState` isn't a thing. This causes the button to always show "Pause Indexer".

This MR fixes the issue of the `IndexerState state` enum being checked incorrectly in the switch statement, and also the `QQC2.Button` text being show incorrectly no matter whether the indexing is suspended or not. The reason `currentlyIndexing` function cannot be used in the button text is because it also has values of `Idle`, `LowPowerIdle`, `Unavailable`, `Startup` that should show "Pause Indexer" as the indexer is still enabled even if it has nothing to do at the moment.
parent a4dcef99
Pipeline #118158 passed with stage
in 5 minutes and 46 seconds
......@@ -23,14 +23,14 @@ KCM.SimpleKCM {
Baloo.Monitor {
id: monitor
readonly property bool currentlyIndexing: switch(monitor.IndexerState) {
case Baloo.FirstRun:
case Baloo.NewFiles:
case Baloo.ModifiedFiles:
case Baloo.XAttrFiles:
case Baloo.ContentIndexing:
case Baloo.UnindexedFileCheck:
case Baloo.StaleIndexEntriesClean:
readonly property bool currentlyIndexing: switch(monitor.state) {
case Baloo.Global.FirstRun:
case Baloo.Global.NewFiles:
case Baloo.Global.ModifiedFiles:
case Baloo.Global.XAttrFiles:
case Baloo.Global.ContentIndexing:
case Baloo.Global.UnindexedFileCheck:
case Baloo.Global.StaleIndexEntriesClean:
return true;
......@@ -142,7 +142,7 @@ KCM.SimpleKCM {
QQC2.Button {
text: monitor.currentlyIndexing ? i18n("Pause Indexer") : i18n("Resume Indexer")
text: monitor.state !== Baloo.Global.Suspended ? i18n("Pause Indexer") : i18n("Resume Indexer")
onClicked: monitor.toggleSuspendState()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment