summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Knauß <mail@sandroknauss.de>2015-03-06 13:55:48 (GMT)
committerSandro Knauß <mail@sandroknauss.de>2015-03-06 13:55:48 (GMT)
commit79a3590486e796e828f816dbead54326e25be57f (patch)
tree4f3fe603c2685ae218d869af609f84bb5b7f83fa
parentf4a151d78de1a44db6c4b645c753852928664122 (diff)
downloadlibkolabxml-dev/default_priority.tar.gz
Add support for relation priority.dev/default_priority
* default priority is -1 (not set). * add priotiry into check for equality * write priority if priority is set. KOLAB #4807
-rw-r--r--src/containers/kolabconfiguration.h5
-rw-r--r--src/kolabconversions.h2
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 <Kolab::Configuration> (const Kolab::Configuration &
if (!relation.parent().empty()) {
n.parent(relation.parent());
}
- if (!relation.priority() != 0) {
+ if (relation.priority() != -1) {
n.priority(fromInt<KolabXSD::Configuration::priority_type>(relation.priority()));
}
BOOST_FOREACH(const std::string &s, relation.members()) {