Don't check if file is directory based on mime-type
ClosedPublic

Authored by poboiko on Oct 5 2018, 8:23 AM.

Details

Summary

If a filename doesn't have a trailing slash, and we use QMimeDatabase::matchTypeForFile(MatchExtension) to guess its mimetype,
it results in application/octet-stream (generic type returned if QMimeDatabase wasn't able to guess) instead of inode/directory.
Because of that, indexer does try to index folders (not a big problem, but still...)

Since we've already use QFileInfo, use isDir check instead.

Test Plan

It builds. My home directory no longer pops up in UnindexedFileIterator

Diff Detail

Repository
R293 Baloo
Branch
check-dir (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 3514
Build 3532: arc lint + arc unit
poboiko created this revision.Oct 5 2018, 8:23 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptOct 5 2018, 8:23 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
poboiko requested review of this revision.Oct 5 2018, 8:23 AM
bruns added a subscriber: bruns.EditedOct 16 2018, 11:14 PM

The reference to QDirIterator in the summary is misleading, as it applies only to the UnIndexedFileIterator, the ModifiedFileIndexer just receives paths.

bruns requested changes to this revision.Oct 28 2018, 3:54 PM

Can you update the summary? Code wise its good to go.

This revision now requires changes to proceed.Oct 28 2018, 3:54 PM
poboiko edited the summary of this revision. (Show Details)Oct 30 2018, 7:29 AM
astippich accepted this revision.Dec 1 2018, 10:41 AM
bruns accepted this revision.Dec 11 2018, 10:30 PM

Sorry, fell through the cracks - give a ping next time something is blocked for no apparent reason ...

This revision is now accepted and ready to land.Dec 11 2018, 10:30 PM
poboiko closed this revision.Dec 18 2018, 2:06 PM

Sorry, fell through the cracks - give a ping next time something is blocked for no apparent reason ...

Nevermind, I also didn't have much spare time for KDE lately :(

aacid added a subscriber: aacid.Dec 18 2018, 6:52 PM

@poboiko You broke the build, please fix it.

@poboiko You broke the build, please fix it.

Sorry! Apparently, I've messed up while did git rebase on current master.
Should be fixed by c7416a41.