D11753: baloodb: Add clean command

Michael Heidelbach noreply at phabricator.kde.org
Sat Mar 31 12:19:51 UTC 2018


michaelh marked an inline comment as done.
michaelh added inline comments.

INLINE COMMENTS

> bruns wrote in databasesanitizer.cpp:316
> I think it is better to use
> QT_FSTAT(info.symlink.toLocal8Bit().constData(), ...) here, avoids lots of calls to the database, and guarantees more consistent results - symlinkTarget() works on the filesystem, so should the lookup here

I've tried it. Sadly your suggestion does not work. With `fi = filePathToStat(info.symlink.toLocal8Bit())` fi._st_dev is == 0 when the symlink target does not exist. Hence it does tell me **why** the link can't be followed. baloo's db otoh knows about this. As `deviceIdFilter` does never contain 0 symlinks would be removed when they should be ignored. With `If(id != 0)` truly "dead" symlinks will not be removed.
Maybe I didn't understand what you're suggesting?

`filePathToStat` returns `QT_STATBUF`. My guess is that is essentially the same as `QT_FSTAT`, at least `man fstat.2` says so.

REPOSITORY
  R293 Baloo

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

To: michaelh, #baloo, #frameworks
Cc: bruns, cfeck, smithjd, ashaposhnikov, michaelh, astippich, spoorun, ngraham, alexeymin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180331/a8eb9df9/attachment.html>


More information about the Kde-frameworks-devel mailing list