Diffusion Baloo db4aac4b6317

[Extractor] Handle documents correctly where mimetype should not be indexed

Authored by bruns on Oct 15 2018, 9:22 PM.

Description

[Extractor] Handle documents correctly where mimetype should not be indexed

Summary:
The BasicIndexingJob started from the UnindexedFileIndexer only has
the file extension based mimetype and thus can not determine if a file
should be indexed.

Remove the document only from the indexingleveldb, otherwise the
document can not be found e.g. by name or type, and the basic indexer is
run on the file again on each session start.

This is typical for e.g. xml files, which may come with various file
extensions based on the application, e.g. XMP sidecar files.

Test Plan:
start balooctl monitor
save some metadata to an XMP sidecar file, e.g. from digikam
Current behavior with content indexing enabled:

  • the file is added to the index and immediately removed again.

When content indexing is switched off:

  • the file stays in the index.

After the change, the file (name, attributes) stays in the index.

Reviewers: Baloo, Frameworks, ngraham

Reviewed By: Baloo, ngraham

Subscribers: ngraham, kde-frameworks-devel

Tags: Frameworks, Baloo

Differential Revision: https://phabricator.kde.org/D16236