Commit 403e3052 authored by Laurent Montel's avatar Laurent Montel 😁

Use new email list

parent b994bb43
......@@ -22,6 +22,7 @@
#include "contactgrantleeprintgeoobject.h"
#include "contactgrantleeprintcryptoobject.h"
#include "contactgrantleeprintwebsite.h"
#include "contactgrantleeprintemail.h"
#include <KContacts/PhoneNumber>
......@@ -54,6 +55,12 @@ ContactGrantleePrintObject::ContactGrantleePrintObject(const KContacts::Addresse
mListPhones << new ContactGrantleePrintPhoneObject(phone);
}
const auto emails = address.emailList();
mListEmails.reserve(emails.size());
Q_FOREACH (const KContacts::Email &email, emails) {
mListEmails << new ContactGrantleePrintEmail(mAddress, email);
}
const QStringList customs = mAddress.customs();
if (!customs.empty()) {
......@@ -78,6 +85,7 @@ ContactGrantleePrintObject::~ContactGrantleePrintObject()
qDeleteAll(mListPhones);
qDeleteAll(mListIm);
qDeleteAll(mListWebSite);
qDeleteAll(mListEmails);
delete mCryptoObject;
}
......@@ -207,6 +215,11 @@ QVariant ContactGrantleePrintObject::webSites() const
return QVariant::fromValue(mListWebSite);
}
QVariant ContactGrantleePrintObject::emailsList() const
{
return QVariant::fromValue(mListEmails);
}
QVariant ContactGrantleePrintObject::phones() const
{
return QVariant::fromValue(mListPhones);
......
......@@ -65,6 +65,7 @@ class ContactGrantleePrintObject : public QObject
Q_PROPERTY(QString spouse READ spouse)
Q_PROPERTY(QString languages READ languages)
Q_PROPERTY(QVariant webSites READ webSites)
Q_PROPERTY(QVariant emailsList READ emailsList)
//Add more functions
public:
......@@ -107,12 +108,14 @@ public:
QString spouse() const;
QString languages() const;
QVariant webSites() const;
QVariant emailsList() const;
private:
QString imgToDataUrl(const QImage &image) const;
QList<QObject *> mListAddress;
QList<QObject *> mListPhones;
QList<QObject *> mListIm;
QList<QObject *> mListWebSite;
QList<QObject *> mListEmails;
ContactGrantleePrintGeoObject *mGeoObject;
ContactGrantleePrintCryptoObject *mCryptoObject;
KContacts::Addressee mAddress;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment