D21706: [ModifiedFileIndexer] Use correct mimetype for folders, delay until needed

2019-06-12 Thread Stefan Brüns
This revision was automatically updated to reflect the committed changes.
Closed by commit R293:4fcbfee9b669: [ModifiedFileIndexer] Use correct mimetype 
for folders, delay until needed (authored by bruns).

REPOSITORY
  R293 Baloo

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D21706?vs=59564=59680

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

AFFECTED FILES
  src/file/modifiedfileindexer.cpp

To: bruns, #baloo, ngraham, astippich, poboiko
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21706: [ModifiedFileIndexer] Use correct mimetype for folders, delay until needed

2019-06-12 Thread Alexander Stippich
astippich accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R293 Baloo

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

To: bruns, #baloo, ngraham, astippich, poboiko
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21706: [ModifiedFileIndexer] Use correct mimetype for folders, delay until needed

2019-06-10 Thread Stefan Brüns
bruns marked an inline comment as done.

REPOSITORY
  R293 Baloo

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

To: bruns, #baloo, ngraham, astippich, poboiko
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21706: [ModifiedFileIndexer] Use correct mimetype for folders, delay until needed

2019-06-10 Thread Stefan Brüns
bruns updated this revision to Diff 59564.
bruns marked an inline comment as done.
bruns added a comment.


  update comment

REPOSITORY
  R293 Baloo

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D21706?vs=59470=59564

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

AFFECTED FILES
  src/file/modifiedfileindexer.cpp

To: bruns, #baloo, ngraham, astippich, poboiko
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21706: [ModifiedFileIndexer] Use correct mimetype for folders, delay until needed

2019-06-10 Thread Alexander Stippich
astippich added inline comments.

INLINE COMMENTS

> modifiedfileindexer.cpp:82
> +if (fileInfo.isDir()) {
> +// The folder ctime changes when the file is created, when the 
> folder is
> +// renamed, or when the xattrs (tags, comments, ...) change

"when the folder is created,..." or "when a file is created,..."?

REPOSITORY
  R293 Baloo

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

To: bruns, #baloo, ngraham, astippich, poboiko
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21706: [ModifiedFileIndexer] Use correct mimetype for folders, delay until needed

2019-06-10 Thread Stefan Brüns
bruns marked an inline comment as done.
bruns added inline comments.

INLINE COMMENTS

> poboiko wrote in modifiedfileindexer.cpp:68
> Does it also changes behavior of ModifiedFileIndexer? What happened to 
> symlinks before?

It depends on the state of the PendingFileQueue:

- when an item is not in the list of recent files, and is new, an 
`indexNewFile` signal is emitted, we end up in the NewFileIndexer
- otherwise, on a 'created' event a `indexModifiedFile` signal is emitted -> 
ModifiedFileIndexer

so, on

  mkdir target; mkdir test; sleep ...
  rmdir test; ln -s target test

we get a deleted and a created event, where the latter ends up in the 
ModifiedFileIndexer, adding a symlink to the index.

For e.g. the UnindexedFileIndexer, symlinks are omitted using 
`QDir::NoSymlinks`.

That said, NewFileIndexer should also check for symlinks.

REPOSITORY
  R293 Baloo

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

To: bruns, #baloo, ngraham, astippich, poboiko
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21706: [ModifiedFileIndexer] Use correct mimetype for folders, delay until needed

2019-06-10 Thread Igor Poboiko
poboiko added inline comments.

INLINE COMMENTS

> modifiedfileindexer.cpp:68
>  QFileInfo fileInfo(filePath);
> -
> -// A folders mtime is updated when a new file is added / removed / 
> renamed
> -// we don't really need to reindex a folder when that happens
> -// In fact, we never need to reindex a folder
> -if (timeInfo.mTime && fileInfo.isDir()) {
> +if (fileInfo.isSymLink()) {
>  continue;

Does it also changes behavior of ModifiedFileIndexer? What happened to symlinks 
before?

REPOSITORY
  R293 Baloo

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

To: bruns, #baloo, ngraham, astippich, poboiko
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams


D21706: [ModifiedFileIndexer] Use correct mimetype for folders, delay until needed

2019-06-09 Thread Stefan Brüns
bruns created this revision.
bruns added reviewers: Baloo, ngraham, astippich, poboiko.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
bruns requested review of this revision.

REVISION SUMMARY
  mimeTypeForFile is quite expensive (much more than QFileInfo and fetching
  the timestamps from the DB), and yields the wrong type for folders.

REPOSITORY
  R293 Baloo

BRANCH
  cleanup

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

AFFECTED FILES
  src/file/modifiedfileindexer.cpp

To: bruns, #baloo, ngraham, astippich, poboiko
Cc: kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, 
astippich, spoorun, ngraham, bruns, abrahams