D18601: Rewrite taglib writer to use property interface

Stefan BrĂ¼ns noreply at phabricator.kde.org
Mon Feb 4 21:31:54 GMT 2019


bruns added inline comments.

INLINE COMMENTS

> taglibwriter.cpp:70
>  
> -    if (properties.contains(Property::Title)) {
> -        title = QStringToTString(properties.value(Property::Title).toString());
> -        tags->setTitle(title);
> +void writeGenericProperties(TagLib::PropertyMap &oldProperties, const PropertyMap &newProperties)
> +{

When you make this
`void writeGenericProperties(Taglib::File *file, const PropertyMap &newProperties)`, you can do `file->properties(); {/* merge */}; file->setProperties(...);` here, saving most of the duplicate code below.

dito for the specializations in D18604 <https://phabricator.kde.org/D18604>, just pass in `Taglib::File*`, and call `auto tags = dynamic_cast<FooTag*>(file->tag());` there.

REPOSITORY
  R286 KFileMetaData

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

To: astippich, bruns, mgallien, broulik, cfeck
Cc: kde-frameworks-devel, #baloo, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190204/7d545409/attachment.html>


More information about the Kde-frameworks-devel mailing list