[Baloo KCM] Purge index when disabling indexing
Needs ReviewPublic

Authored by ngraham on Tue, Nov 12, 10:16 PM.

Details

Reviewers
tcanabrava
davidedmundson
Group Reviewers
Plasma
VDG
Baloo
Summary

The only reason why a user would want to entirely disable file indexing is because they
don't want their files indexed. This implies that if their files are already indexed,
they would like the index deleted. Ergo, disabling indexing in the KCM should delete
the index too.

This patch does that. The balooctl command-line tool offers more granular options for
disabling without deleting the index, but those should be considered expert options for
power users who know what they're doing. For users using the KCM, deleting the index
after disabling indexing makes the most sense.

BUG: 414077
FIXED-IN: 5.18.0

Depends on D25447

Test Plan

  1. Run balooctl monitor
  2. Disable indexing in the KCM, see warning message
  3. See that indexing has been turned off and the database deleted
  4. Re-enable indexing in the KCM
  5. See that files are being indexed as with a first run.

Diff Detail

Repository
R119 Plasma Desktop
Branch
purge-index-when-disabling (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18829
Build 18847: arc lint + arc unit
ngraham created this revision.Tue, Nov 12, 10:16 PM
Restricted Application added a project: Plasma. · View Herald TranscriptTue, Nov 12, 10:16 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Tue, Nov 12, 10:16 PM
davidedmundson requested changes to this revision.Tue, Nov 12, 11:24 PM
davidedmundson added a subscriber: davidedmundson.

Baloo covers tags and activities, regardless of indexer. Wiping the index does not make sense.

What you want to achieve is what baloo_file_cleaner does.

This revision now requires changes to proceed.Tue, Nov 12, 11:24 PM

I thought tags were stored in extended attributes on the tagged files, not in the database. And can you clarify regarding what's stored in the database for activities?

I do see code calling baloo_file_cleaner but that executable does not seem to exist anymore. Maybe that's why this isn't working?

Tags are stored as xattr, but indexed and cached in the baloo DB. The tags IO slave only searches the cache.

I had a recollection that adding a tag in dolphin/whatever forced a basic index of that file. However, I can't find any reference to that anymore. My knowledge of Baloo comes from late KDE4 days. It seems I was talking nonsense.

cfeck added a subscriber: cfeck.Wed, Nov 13, 7:57 AM

Shouldn't there be a warning message "delete yes/no?"

davidedmundson resigned from this revision.Wed, Nov 13, 10:07 AM

In theory it's all just a cache of data elsewhere.

The downside of this patch is that if a user temporarily disables the indexer, when it's re-enabled we're triggering an entire first scan reset of everything.

If we did this patch, does the config value "first run" need resetting to true?

ngraham updated this revision to Diff 69781.Fri, Nov 15, 5:11 AM
  • Invoke first run logic when indexing is turned on again after previously being turned off
  • Show warning message when the user goes to turn it off, but before hitting "Apply"
ngraham edited the test plan for this revision. (Show Details)Fri, Nov 15, 5:12 AM
ngraham updated this revision to Diff 69809.Fri, Nov 15, 2:49 PM

Improve string

ngraham edited the test plan for this revision. (Show Details)Fri, Nov 15, 2:51 PM
ngraham added a reviewer: VDG.

I gree with david's questioning, sometimes I disable indexing when I'm about to do something heavy, to re-enable it later. I don't want to lose all my data.
perhaps there should be a box purge database data instead of purging on disable?

kcms/baloo/package/contents/ui/main.qml
43

stray newline

bruns added a subscriber: bruns.Thu, Nov 21, 4:13 PM

Agree with David/Thomas, first we need a "Suspend" button or similar.

Agree with David/Thomas, first we need a "Suspend" button or similar.

In fact there's already a bug report asking for this: https://bugs.kde.org/show_bug.cgi?id=374474

I'll do that first, then we can revisit this patch.

Here's a patch that does that: D25447