summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-12-04 22:18:32 +0100
committerMontel Laurent <[email protected]>2017-12-04 22:18:32 +0100
commit9817e3c21bd1c7869b8fbd1b626f444da33bed66 (patch)
treec1a85f236d9edad34027a94f08610efa5a12863e
parent4035483a3eb47211fd6456ab0bfa1ca0ddd24541 (diff)
Clean up file. Minor optimization
-rw-r--r--resources/kolab/pimkolab/calendaring/calendaring.h5
-rw-r--r--resources/kolab/pimkolab/calendaring/datetimeutils.h5
-rw-r--r--resources/kolab/pimkolab/calendaring/event.h5
-rw-r--r--resources/kolab/pimkolab/icalendar/icalendar.h5
-rw-r--r--resources/kolab/pimkolab/kolabformat/kolabobject.cpp7
-rw-r--r--resources/kolab/pimkolab/kolabformat/mimeobject.cpp12
-rw-r--r--resources/kolab/pimkolab/kolabformat/mimeobject.h5
-rw-r--r--resources/kolab/pimkolab/kolabformat/xmlobject.h5
8 files changed, 8 insertions, 41 deletions
diff --git a/resources/kolab/pimkolab/calendaring/calendaring.h b/resources/kolab/pimkolab/calendaring/calendaring.h
index 5c7ed64..c0b524c 100644
--- a/resources/kolab/pimkolab/calendaring/calendaring.h
+++ b/resources/kolab/pimkolab/calendaring/calendaring.h
@@ -18,12 +18,7 @@
#ifndef KOLABCALENDARING_H
#define KOLABCALENDARING_H
-#ifndef SWIG
#include "kolab_export.h"
-#else
-/* No export/import SWIG interface files */
-#define KOLAB_EXPORT
-#endif
#include <kcalcore/event.h>
#include <kcalcore/memorycalendar.h>
diff --git a/resources/kolab/pimkolab/calendaring/datetimeutils.h b/resources/kolab/pimkolab/calendaring/datetimeutils.h
index 418ac5f..f753bb6 100644
--- a/resources/kolab/pimkolab/calendaring/datetimeutils.h
+++ b/resources/kolab/pimkolab/calendaring/datetimeutils.h
@@ -18,12 +18,7 @@
#ifndef KOLABDATETIMEUTILS_H
#define KOLABDATETIMEUTILS_H
-#ifndef SWIG
#include "kolab_export.h"
-#else
-/* No export/import SWIG interface files */
-#define KOLAB_EXPORT
-#endif
#include <string>
diff --git a/resources/kolab/pimkolab/calendaring/event.h b/resources/kolab/pimkolab/calendaring/event.h
index 43c55a1..f76f3e3 100644
--- a/resources/kolab/pimkolab/calendaring/event.h
+++ b/resources/kolab/pimkolab/calendaring/event.h
@@ -19,13 +19,8 @@
#define EVENT_H
#include <kolabevent.h>
-#ifndef SWIG
#include "kolab_export.h"
#include <icalendar/icalendar.h>
-#else
-/* No export/import SWIG interface files */
-#define KOLAB_EXPORT
-#endif
namespace Kolab {
namespace Calendaring {
diff --git a/resources/kolab/pimkolab/icalendar/icalendar.h b/resources/kolab/pimkolab/icalendar/icalendar.h
index 4e47be8..be8a095 100644
--- a/resources/kolab/pimkolab/icalendar/icalendar.h
+++ b/resources/kolab/pimkolab/icalendar/icalendar.h
@@ -20,12 +20,7 @@
#ifndef ICALENDAR_H
#define ICALENDAR_H
-#ifndef SWIG
#include "kolab_export.h"
-#else
-/* No export/import SWIG interface files */
-#define KOLAB_EXPORT
-#endif
#include <kolabevent.h>
diff --git a/resources/kolab/pimkolab/kolabformat/kolabobject.cpp b/resources/kolab/pimkolab/kolabformat/kolabobject.cpp
index b906abf..c65f890 100644
--- a/resources/kolab/pimkolab/kolabformat/kolabobject.cpp
+++ b/resources/kolab/pimkolab/kolabformat/kolabobject.cpp
@@ -207,10 +207,9 @@ class KolabObjectReader::Private
{
public:
Private()
- : mObjectType(InvalidObject)
+ : mObjectType(InvalidObject)
, mVersion(KolabV3)
, mOverrideObjectType(InvalidObject)
- , mDoOverrideVersion(false)
{
mAddressee = KContacts::Addressee();
}
@@ -327,7 +326,9 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
const Kolab::Configuration &configuration = mimeObject.getConfiguration();
const Kolab::Dictionary &dictionary = configuration.dictionary();
d->mDictionary.clear();
- foreach (const std::string &entry, dictionary.entries()) {
+ const std::vector<std::string> entries = dictionary.entries();
+ d->mDictionary.reserve(entries.size());
+ foreach (const std::string &entry, entries) {
d->mDictionary.append(Conversion::fromStdString(entry));
}
d->mDictionaryLanguage = Conversion::fromStdString(dictionary.language());
diff --git a/resources/kolab/pimkolab/kolabformat/mimeobject.cpp b/resources/kolab/pimkolab/kolabformat/mimeobject.cpp
index b0a7046..b48a571 100644
--- a/resources/kolab/pimkolab/kolabformat/mimeobject.cpp
+++ b/resources/kolab/pimkolab/kolabformat/mimeobject.cpp
@@ -216,10 +216,6 @@ class MIMEObject::Private
{
public:
Private()
- : mObjectType(InvalidObject)
- , mVersion(KolabV3)
- , mOverrideObjectType(InvalidObject)
- , mDoOverrideVersion(false)
{
}
@@ -228,10 +224,10 @@ public:
QVariant parseMimeMessage(const KMime::Message::Ptr &msg);
QVariant parseMimeMessage(const std::string &s);
- ObjectType mObjectType;
- Version mVersion;
- ObjectType mOverrideObjectType;
- Version mOverrideVersion;
+ ObjectType mObjectType = InvalidObject;
+ Version mVersion = KolabV3;
+ ObjectType mOverrideObjectType = InvalidObject;
+ Version mOverrideVersion = KolabV3;
bool mDoOverrideVersion = false;
QVariant mObject;
};
diff --git a/resources/kolab/pimkolab/kolabformat/mimeobject.h b/resources/kolab/pimkolab/kolabformat/mimeobject.h
index 641e48e..7b72f0b 100644
--- a/resources/kolab/pimkolab/kolabformat/mimeobject.h
+++ b/resources/kolab/pimkolab/kolabformat/mimeobject.h
@@ -19,12 +19,7 @@
#ifndef MIMEOBJECT_H
#define MIMEOBJECT_H
-#ifndef SWIG
#include "kolab_export.h"
-#else
-/* No export/import SWIG interface files */
-#define KOLAB_EXPORT
-#endif
#include <kolabformat.h>
#include "kolabdefinitions.h"
diff --git a/resources/kolab/pimkolab/kolabformat/xmlobject.h b/resources/kolab/pimkolab/kolabformat/xmlobject.h
index 2850ec9..56dbaa3 100644
--- a/resources/kolab/pimkolab/kolabformat/xmlobject.h
+++ b/resources/kolab/pimkolab/kolabformat/xmlobject.h
@@ -18,12 +18,7 @@
#ifndef KOLABXMLOBJECT_H
#define KOLABXMLOBJECT_H
-#ifndef SWIG
#include "kolab_export.h"
-#else
-/* No export/import SWIG interface files */
-#define KOLAB_EXPORT
-#endif
#include <kolabformat.h>