Extend IdentityTest and fix all bugs it discovered

Authored by dvratil on Jul 22 2016, 9:08 AM.

Description

Extend IdentityTest and fix all bugs it discovered

Fixes main serialization and deserialization of Identity to raw data.
The serializer was serializing QStrings, while the deserializer was
expecting QVariants, which did not behave as expected. The serializer
now serializes everything as QVariants too.

Fixes serialization of Signature - signature was never being stored
in mPropertiesMap, so the key was always empty. We instead serialize
mSignature directly. Calls to setSignature() etc. now also insert the
mSignature into the mPropertiesMap.

Improves operator==() to handle comparision between manually created
and deserialized Identity. Deserialization will fill mPropertiesMap
with lots of empty QVariants, but the default ctor will not so simple
mPropertiesMap == other.mPropertiesMap comparision was failing. The
algorithm now assumes that if a key is not present in one map but
is present in another the maps are considered equal as long as the
value is invalid.

Differential Revision: https://phabricator.kde.org/D2254

Details

Committed
dvratilJul 22 2016, 12:26 PM
Differential Revision
D2254: Extend IdentityTest and fix all bugs it discovered
Parents
R176:5fc9962412a0: Add per-identity auto-encrypt option
Branches
Unknown
Tags
Unknown