D19087: Add standalone conversion functions for PropertyMap to Json and vice versa
Stefan BrĂ¼ns
noreply at phabricator.kde.org
Sun Feb 17 01:10:01 GMT 2019
bruns created this revision.
bruns added reviewers: Baloo, Frameworks, ngraham, poboiko, astippich.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
bruns requested review of this revision.
REVISION SUMMARY
Baloo caches property data, and uses Json for serializing it. For storing,
it populates a QVariantMap, where multiple values for the same key are
stored as a QVariantList (QJsonObject::fromVariantMap only handles one
value per key). After deserialization, the KFileMetaData::PropertyMap
also contains QVariantLists for keys with multiple values.
To handle multiple property values per key correctly, do the serialization
and deserialization manually. This also save the temporary QVariantMap
on deserialization.
Add unit tests to test roundtrip from PropertyMap to JSon and back. This
is now possible as the serialization code is no longer done inline.
It makes it also easier to keep serialization and deserialization in
sync, as it is no longer in different files (src/file/result.cpp and
src/file/extractor/file.cpp).
TEST PLAN
ctest
REPOSITORY
R293 Baloo
BRANCH
submit
REVISION DETAIL
https://phabricator.kde.org/D19087
AFFECTED FILES
autotests/unit/file/CMakeLists.txt
autotests/unit/file/propertyserializationtest.cpp
src/file/CMakeLists.txt
src/file/propertydata.cpp
src/file/propertydata.h
To: bruns, #baloo, #frameworks, ngraham, poboiko, astippich
Cc: kde-frameworks-devel, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190217/6a43090a/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list