Diffusion Baloo a632a72a354e

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

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

Description

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

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

Reviewers: Baloo, Frameworks, bruns, astippich

Reviewed By: Baloo, bruns, astippich

Subscribers: bruns, kde-frameworks-devel

Tags: Frameworks, Baloo

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

Details

Committed
poboikoDec 18 2018, 2:06 PM
Reviewer
Baloo
Differential Revision
D15960: Don't check if file is directory based on mime-type
Parents
R293:5d9f4415f7a8: Fixed link to the coding style wiki page
Branches
Unknown
Tags
Unknown