D18601: Rewrite taglib writer to use property interface
Alexander Stippich
noreply at phabricator.kde.org
Sat Feb 2 10:46:06 GMT 2019
astippich added a comment.
In D18601#402905 <https://phabricator.kde.org/D18601#402905>, @bruns wrote:
> I think this becomes better structured when you:
>
> 1. Create one function per file type, with parameters (Taglib::Filestream, KFM::PropertyMap)
> 2. From this function, call a generic `updateProperties(oldProperties, newProperties) -> mergedProperties`
> 3. Call the type specific function from TaglibWriter::write(...)
>
> Especially when taking the changes for writing the rating into account, this would make the code easier to read - handling of different types just once (not once for reading and once for writing), and no upcasting/dynamic_cast of Taglib::File*. It also saves the heap allocation of the concrete TagLib::File implementation.
Done. It requires a little bit more of boilerplate code, but I have not strong preference.
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/20190202/60dcff55/attachment.html>
More information about the Kde-frameworks-devel
mailing list