Changeset View
Changeset View
Standalone View
Standalone View
kaddressbookgrantlee/src/printing/contactgrantleeprintobject.cpp
Show All 15 Lines | 1 | /* | |||
---|---|---|---|---|---|
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | Boston, MA 02110-1301, USA. | 17 | Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "contactgrantleeprintobject.h" | 20 | #include "contactgrantleeprintobject.h" | ||
21 | #include "../contactobject/contactgrantleeaddressobject.h" | 21 | #include "../contactobject/contactgrantleeaddressobject.h" | ||
22 | #include "../contactobject/contactgrantleephoneobject.h" | 22 | #include "../contactobject/contactgrantleephoneobject.h" | ||
23 | #include "../contactobject/contactgrantleeimobject.h" | 23 | #include "../contactobject/contactgrantleeimobject.h" | ||
24 | #include "../contactobject/contactgrantleegeoobject.h" | | |||
25 | #include "../contactobject/contactgrantleecryptoobject.h" | 24 | #include "../contactobject/contactgrantleecryptoobject.h" | ||
26 | #include "../contactobject/contactgrantleewebsite.h" | 25 | #include "../contactobject/contactgrantleewebsite.h" | ||
27 | #include "../contactobject/contactgrantleeemail.h" | 26 | #include "../contactobject/contactgrantleeemail.h" | ||
28 | 27 | | |||
29 | #include <KContacts/PhoneNumber> | 28 | #include <KContacts/PhoneNumber> | ||
30 | 29 | | |||
31 | #include <QBuffer> | 30 | #include <QBuffer> | ||
32 | #include <QVariant> | 31 | #include <QVariant> | ||
Show All 36 Lines | 67 | for (const QString &custom : customs) { | |||
69 | if (custom.startsWith(QLatin1String("messaging/"))) { | 68 | if (custom.startsWith(QLatin1String("messaging/"))) { | ||
70 | const int pos = custom.indexOf(QLatin1Char(':')); | 69 | const int pos = custom.indexOf(QLatin1Char(':')); | ||
71 | QString key = custom.left(pos); | 70 | QString key = custom.left(pos); | ||
72 | key.remove(QStringLiteral("-All")); | 71 | key.remove(QStringLiteral("-All")); | ||
73 | const QString value = custom.mid(pos + 1); | 72 | const QString value = custom.mid(pos + 1); | ||
74 | mListIm << new ContactGrantleeImObject(key, value); | 73 | mListIm << new ContactGrantleeImObject(key, value); | ||
75 | } | 74 | } | ||
76 | } | 75 | } | ||
77 | mGeoObject = new ContactGrantleeGeoObject(address.geo()); | | |||
78 | mCryptoObject = new ContactGrantleeCryptoObject(address); | 76 | mCryptoObject = new ContactGrantleeCryptoObject(address); | ||
79 | } | 77 | } | ||
80 | 78 | | |||
81 | ContactGrantleePrintObject::~ContactGrantleePrintObject() | 79 | ContactGrantleePrintObject::~ContactGrantleePrintObject() | ||
82 | { | 80 | { | ||
83 | delete mGeoObject; | | |||
84 | qDeleteAll(mListAddress); | 81 | qDeleteAll(mListAddress); | ||
85 | qDeleteAll(mListPhones); | 82 | qDeleteAll(mListPhones); | ||
86 | qDeleteAll(mListIm); | 83 | qDeleteAll(mListIm); | ||
87 | qDeleteAll(mListWebSite); | 84 | qDeleteAll(mListWebSite); | ||
88 | qDeleteAll(mListEmails); | 85 | qDeleteAll(mListEmails); | ||
89 | delete mCryptoObject; | 86 | delete mCryptoObject; | ||
90 | } | 87 | } | ||
91 | 88 | | |||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Line(s) | |||||
230 | 227 | | |||
231 | QVariant ContactGrantleePrintObject::instantManging() const | 228 | QVariant ContactGrantleePrintObject::instantManging() const | ||
232 | { | 229 | { | ||
233 | return QVariant::fromValue(mListIm); | 230 | return QVariant::fromValue(mListIm); | ||
234 | } | 231 | } | ||
235 | 232 | | |||
236 | QVariant ContactGrantleePrintObject::geo() const | 233 | QVariant ContactGrantleePrintObject::geo() const | ||
237 | { | 234 | { | ||
238 | return QVariant::fromValue(mGeoObject); | 235 | return QVariant::fromValue(mAddress.geo()); | ||
239 | } | 236 | } | ||
240 | 237 | | |||
241 | QVariant ContactGrantleePrintObject::crypto() const | 238 | QVariant ContactGrantleePrintObject::crypto() const | ||
242 | { | 239 | { | ||
243 | return QVariant::fromValue(mCryptoObject); | 240 | return QVariant::fromValue(mCryptoObject); | ||
244 | } | 241 | } | ||
245 | 242 | | |||
246 | QString ContactGrantleePrintObject::addressBookName() const | 243 | QString ContactGrantleePrintObject::addressBookName() const | ||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |