[UserMetaData] Consolidate UserMetaData conversion to common implementation
ClosedPublic

Authored by bruns on May 2 2019, 10:34 AM.

Details

Summary

The conversion from UserMetaData tags/rating etc. was implemented in both
the standalone temporary extractor and for the baloo DB cached code path,
although the standalone implementation lacked support for the originUrl
entry.

Consolidate the implementations to a common helper, and move the call
from the standalone extractor process to its calling job. This avoids
the need to serialize the data, doing it from the job context avoids
blocking the UI.

Test Plan

ctest

Diff Detail

Repository
R824 Baloo Widgets
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.May 2 2019, 10:34 AM
Restricted Application added a project: Baloo. · View Herald TranscriptMay 2 2019, 10:34 AM
bruns requested review of this revision.May 2 2019, 10:34 AM
astippich accepted this revision.May 2 2019, 7:13 PM

Is there any chance to additionally remove
https://phabricator.kde.org/source/baloo-widgets/browse/master/src/filemetadatawidget.cpp$309
within the same function?

This revision is now accepted and ready to land.May 2 2019, 7:13 PM
bruns added a comment.May 2 2019, 7:56 PM

Is there any chance to additionally remove
https://phabricator.kde.org/source/baloo-widgets/browse/master/src/filemetadatawidget.cpp$309
within the same function?

That location (the whole loop) is quite bogus:

  • it checks for url.isLocalFile() and pushes only the local files to the filemetadataprovider - where each item is checked for isLocalFile() again ...
  • having XAttr support is reqired for the attributes, but for being editable, the file also requires write access (we currently fail silently when trying to edit e.g. tags of a RO file)

So this needs some cleanup, but this is out of scope here (though I will do a small change for this patch as a prep).

bruns updated this revision to Diff 57401.May 2 2019, 8:14 PM

move KFM::UserMetaData instantiation out of the helper
add some const's

This revision was automatically updated to reflect the committed changes.