Changeset View
Changeset View
Standalone View
Standalone View
src/akonadi-contacts/contactviewer.cpp
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | 141 | mBrowser->document()->addResource(QTextDocument::ImageResource, | |||
---|---|---|---|---|---|
143 | defaultSmsPixmap); | 143 | defaultSmsPixmap); | ||
144 | 144 | | |||
145 | if (mShowQRCode) { | 145 | if (mShowQRCode) { | ||
146 | KContacts::VCardConverter converter; | 146 | KContacts::VCardConverter converter; | ||
147 | KContacts::Addressee addr(mCurrentContact); | 147 | KContacts::Addressee addr(mCurrentContact); | ||
148 | addr.setPhoto(KContacts::Picture()); | 148 | addr.setPhoto(KContacts::Picture()); | ||
149 | addr.setLogo(KContacts::Picture()); | 149 | addr.setLogo(KContacts::Picture()); | ||
150 | const QString data = QString::fromUtf8(converter.createVCard(addr)); | 150 | const QString data = QString::fromUtf8(converter.createVCard(addr)); | ||
151 | if (mQRCode) { | ||||
151 | mQRCode->setData(data); | 152 | mQRCode->setData(data); | ||
152 | mDataMatrix->setData(data); | | |||
153 | mBrowser->document()->addResource(QTextDocument::ImageResource, | 153 | mBrowser->document()->addResource(QTextDocument::ImageResource, | ||
154 | QUrl(QStringLiteral("qrcode")), | 154 | QUrl(QStringLiteral("qrcode")), | ||
155 | mQRCode->toImage(QSizeF(50, 50))); | 155 | mQRCode->toImage(QSizeF(50, 50))); | ||
156 | } | ||||
157 | if (mDataMatrix) { | ||||
158 | mDataMatrix->setData(data); | ||||
156 | mBrowser->document()->addResource(QTextDocument::ImageResource, | 159 | mBrowser->document()->addResource(QTextDocument::ImageResource, | ||
157 | QUrl(QStringLiteral("datamatrix")), | 160 | QUrl(QStringLiteral("datamatrix")), | ||
158 | mDataMatrix->toImage(QSizeF(50, 50))); | 161 | mDataMatrix->toImage(QSizeF(50, 50))); | ||
159 | } | 162 | } | ||
163 | } | ||||
160 | 164 | | |||
161 | // merge local and global custom field descriptions | 165 | // merge local and global custom field descriptions | ||
162 | QVector<QVariantMap> customFieldDescriptions; | 166 | QVector<QVariantMap> customFieldDescriptions; | ||
163 | const CustomField::List globalCustomFields = CustomFieldManager::globalCustomFieldDescriptions(); | 167 | const CustomField::List globalCustomFields = CustomFieldManager::globalCustomFieldDescriptions(); | ||
164 | customFieldDescriptions.reserve(localCustomFieldDescriptions.count() + globalCustomFields.count()); | 168 | customFieldDescriptions.reserve(localCustomFieldDescriptions.count() + globalCustomFields.count()); | ||
165 | for (const QVariant &entry : qAsConst(localCustomFieldDescriptions)) { | 169 | for (const QVariant &entry : qAsConst(localCustomFieldDescriptions)) { | ||
166 | customFieldDescriptions << entry.toMap(); | 170 | customFieldDescriptions << entry.toMap(); | ||
167 | } | 171 | } | ||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |