[FileIndexScheduler] Ensure indexer is not run in suspended state
Summary:
After commit b13453360685 ("Use flag to track when a runner is going idle")
the scheduler may be triggered from the finished content indexer thread,
picking up any remaining work and overwriting the "Suspended" state.
Use a flag variable for the suspend state, and determine the current
state in the scheduler loop, like it is done for e.g. the onBattery
state.
Test Plan:
feed some files into the content indexer
suspend using balooctl suspend, content indexer stops and stays stopped
Reviewers: Baloo, ngraham, astippich, poboiko
Reviewed By: poboiko
Subscribers: kde-frameworks-devel
Tags: Frameworks, Baloo
Differential Revision: https://phabricator.kde.org/D21673