summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-11-01 23:37:54 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-11-01 23:37:54 (GMT)
commit3f281f354248eb90694af82f344021f5c27e6f9f (patch)
tree49d17950f1ace94d9418f8da030a72eb984b1d6d
parent95061b30ccc2e63e162e3510e6de5c0292c0a7dd (diff)
downloadlibkolabxml-3f281f354248eb90694af82f344021f5c27e6f9f.tar.gz
Renamed the attachment property to file, to stress the difference between the xcal attachment property and this one.
-rw-r--r--schemas/kolabformat.xsd2
-rw-r--r--src/containers/kolabfile.cpp6
-rw-r--r--src/containers/kolabfile.h4
-rw-r--r--src/kolabconversions.h6
-rw-r--r--tests/bindingstest.cpp4
5 files changed, 11 insertions, 11 deletions
diff --git a/schemas/kolabformat.xsd b/schemas/kolabformat.xsd
index 56ed6b8..0e8c8d8 100644
--- a/schemas/kolabformat.xsd
+++ b/schemas/kolabformat.xsd
@@ -86,7 +86,7 @@
<xs:element name="last-modification-date" type="xs:dateTime"/>
<xs:element name="categories" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="classification" type="classifcationPropType" minOccurs="0" />
- <xs:element name="attachment" type="attachmentPropType" />
+ <xs:element name="file" type="attachmentPropType" />
<xs:element name="note" type="xs:string" minOccurs="0" />
<xs:element name="x-custom" type="CustomType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
diff --git a/src/containers/kolabfile.cpp b/src/containers/kolabfile.cpp
index 556ef04..cc4ec8e 100644
--- a/src/containers/kolabfile.cpp
+++ b/src/containers/kolabfile.cpp
@@ -64,7 +64,7 @@ bool File::operator==(const Kolab::File& other) const
d->categories == other.categories() &&
d->classification == other.classification() &&
d->note == other.note() &&
- d->attachment == other.attachment() &&
+ d->attachment == other.file() &&
d->customProperties == other.customProperties());
}
@@ -138,12 +138,12 @@ std::string File::note() const
return d->note;
}
-void File::setAttachment(const Attachment &attach)
+void File::setFile(const Attachment &attach)
{
d->attachment = attach;
}
-Attachment File::attachment() const
+Attachment File::file() const
{
return d->attachment;
}
diff --git a/src/containers/kolabfile.h b/src/containers/kolabfile.h
index 90e7750..767893e 100644
--- a/src/containers/kolabfile.h
+++ b/src/containers/kolabfile.h
@@ -53,8 +53,8 @@ namespace Kolab {
void setNote(const std::string &);
std::string note() const;
- void setAttachment(const Attachment &);
- Attachment attachment() const;
+ void setFile(const Attachment &);
+ Attachment file() const;
void setCustomProperties(const std::vector<CustomProperty> &);
std::vector<CustomProperty> customProperties() const;
diff --git a/src/kolabconversions.h b/src/kolabconversions.h
index 583f56f..3fffa1b 100644
--- a/src/kolabconversions.h
+++ b/src/kolabconversions.h
@@ -295,7 +295,7 @@ std::string serializeObject <Kolab::File> (const Kolab::File &file, const std::s
ERROR("missing filename");
}
- KolabXSD::File n(uid, getProductId(prod), created, lastModificationDate, fromAttachment(file.attachment()));
+ KolabXSD::File n(uid, getProductId(prod), created, lastModificationDate, fromAttachment(file.file()));
if (!file.categories().empty()) {
KolabXSD::File::categories_sequence categories;
@@ -549,14 +549,14 @@ boost::shared_ptr<Kolab::File> deserializeObject <Kolab::File> (const std::strin
}
}
- const Kolab::Attachment &attachment = toAttachment(file->attachment());
+ const Kolab::Attachment &attachment = toAttachment(file->file());
if (attachment.label().empty()) {
ERROR("Missing filename");
}
if (!attachment.isValid()) {
ERROR("invalid attachment");
}
- n->setAttachment(attachment);
+ n->setFile(attachment);
if (file->note()) {
n->setNote(*file->note());
diff --git a/tests/bindingstest.cpp b/tests/bindingstest.cpp
index 5b5e196..468bce9 100644
--- a/tests/bindingstest.cpp
+++ b/tests/bindingstest.cpp
@@ -128,7 +128,7 @@ void BindingsTest::fileCompletness()
Kolab::Attachment attachment;
attachment.setData("data", "mimetype");
attachment.setLabel("label");
- file.setAttachment(attachment);
+ file.setFile(attachment);
const std::string &result = Kolab::writeFile(file);
QCOMPARE(Kolab::error(), Kolab::NoError);
@@ -142,7 +142,7 @@ void BindingsTest::fileCompletness()
QCOMPARE(re.classification(), file.classification());
QCOMPARE(re.categories(), file.categories());
QCOMPARE(re.note(), file.note());
- QCOMPARE(re.attachment(), file.attachment());
+ QCOMPARE(re.file(), file.file());
}