D21509: [baloo_file] Index renamed folders inside UnindexedFileIndexer

Stefan BrĂ¼ns noreply at phabricator.kde.org
Mon Jun 3 18:46:45 BST 2019


bruns added inline comments.

INLINE COMMENTS

> unindexedfileiteratortest.cpp:100
> +    Database* m_db;
> +    QTemporaryDir* m_dbdir;
> +    QTemporaryDir* m_testDir;

Make this plain members, not pointers.
Also, one temporary dir is enough, you can put the db and the test tree side-by-side.

> unindexedfileiterator.cpp:122
>  
> +    if (m_mTimeChanged) {
> +        // Since documentUrl is pretty expensive, we want to calculate it only

thats wrong:

  $:/tmp> touch dir
  $:/tmp> stat dir
    File: dir
    Size: 0               Blocks: 0          IO Block: 4096   regular empty file
  Device: 3fh/63d Inode: 1892961     Links: 1
  Access: (0644/-rw-r--r--)  Uid: ( 1000/ sbruens)   Gid: (  100/   users)
  Access: 2019-06-03 19:21:57.764626372 +0200
  Modify: 2019-06-03 19:21:57.764626372 +0200
  Change: 2019-06-03 19:21:57.764626372 +0200
   Birth: 2019-06-03 19:21:57.764626372 +0200
  $:/tmp> mv dir  dir_renamed
  $:/tmp> stat dir_renamed 
    File: dir_renamed
    Size: 0               Blocks: 0          IO Block: 4096   regular empty file
  Device: 3fh/63d Inode: 1892961     Links: 1
  Access: (0644/-rw-r--r--)  Uid: ( 1000/ sbruens)   Gid: (  100/   users)
  Access: 2019-06-03 19:21:57.764626372 +0200
  Modify: 2019-06-03 19:21:57.764626372 +0200
  Change: 2019-06-03 19:22:07.096601727 +0200
   Birth: 2019-06-03 19:21:57.764626372 +0200

> unindexedfileiterator.cpp:130
> +        }
> +        // 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

The comment does not match - the mtime changes when something **in** the directory is modified, when the directory is renamed, the ctime changes.

> unindexedfileiterator.cpp:142
>              << timeInfo.cTime << fileMTime;
> +
>          return true;

unrelated whitespace change

> poboiko wrote in unindexedfileiterator.cpp:126
> Did you mean `m_mTimeChanged`?

obviously not ...

REPOSITORY
  R293 Baloo

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

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


More information about the Kde-frameworks-devel mailing list