From 79a3590486e796e828f816dbead54326e25be57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Fri, 6 Mar 2015 14:55:48 +0100 Subject: Add support for relation priority. * default priority is -1 (not set). * add priotiry into check for equality * write priority if priority is set. KOLAB #4807 --- src/containers/kolabconfiguration.h | 5 +++-- src/kolabconversions.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/containers/kolabconfiguration.h b/src/containers/kolabconfiguration.h index c011131..e3601cf 100644 --- a/src/containers/kolabconfiguration.h +++ b/src/containers/kolabconfiguration.h @@ -110,8 +110,8 @@ private: }; struct Relation { - Relation(){} - Relation(const std::string &name, const std::string &type): mName(name), mType(type) {} + Relation(): mPriority(-1) {} + Relation(const std::string &name, const std::string &type): mName(name), mType(type), mPriority(-1) {} bool operator==(const Relation &other) const { return mName == other.mName && @@ -119,6 +119,7 @@ struct Relation { mColor == other.mColor && mIconName == other.mIconName && mParent == other.mParent && + mPriority == other.mPriority && mMembers == other.mMembers; } diff --git a/src/kolabconversions.h b/src/kolabconversions.h index daa9164..8e2050c 100644 --- a/src/kolabconversions.h +++ b/src/kolabconversions.h @@ -215,7 +215,7 @@ std::string serializeObject (const Kolab::Configuration & if (!relation.parent().empty()) { n.parent(relation.parent()); } - if (!relation.priority() != 0) { + if (relation.priority() != -1) { n.priority(fromInt(relation.priority())); } BOOST_FOREACH(const std::string &s, relation.members()) { -- cgit v0.12