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