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

Igor Poboiko noreply at phabricator.kde.org
Fri Oct 5 09:24:01 BST 2018


poboiko created this revision.
poboiko added reviewers: Baloo, Frameworks.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
poboiko requested review of this revision.

REVISION SUMMARY
  `QDirIterator` returns URLs for directories without trailing slash. We're using `QMimeDatabase::matchTypeForFile(MatchExtension)`,
  which tries to guess mimetype based on file name only; and since we don't have trailing slash, it guesses it as `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`

REPOSITORY
  R293 Baloo

BRANCH
  check-dir (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D15960

AFFECTED FILES
  src/file/modifiedfileindexer.cpp
  src/file/unindexedfileiterator.cpp

To: poboiko, #baloo, #frameworks
Cc: kde-frameworks-devel, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181005/cc20dbc8/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list