diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ set(QT_REQUIRED_VERSION "5.10.0") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test DBus PrintSupport) set(LIBKDEPIM_LIB_VERSION_LIB "5.11.40") -set(KDEPIM_APPS_LIB_VERSION_LIB "5.11.44") +set(KDEPIM_APPS_LIB_VERSION_LIB "5.11.45") set(LIBGRANTLEETHEME_LIB_VERSION_LIB "5.11.40") set(PIMCOMMON_LIB_VERSION_LIB "5.11.40") set(LIBKLEO_LIB_VERSION "5.11.40") diff --git a/src/printing/grantlee/grantleeprintstyle.h b/src/printing/grantlee/grantleeprintstyle.h --- a/src/printing/grantlee/grantleeprintstyle.h +++ b/src/printing/grantlee/grantleeprintstyle.h @@ -38,7 +38,7 @@ void print(const KContacts::Addressee::List &, PrintProgress *) override; private: - KAddressBookGrantlee::GrantleePrint *mGrantleePrint = nullptr; + QString m_themePath; }; class GrantleeStyleFactory : public PrintStyleFactory diff --git a/src/printing/grantlee/grantleeprintstyle.cpp b/src/printing/grantlee/grantleeprintstyle.cpp --- a/src/printing/grantlee/grantleeprintstyle.cpp +++ b/src/printing/grantlee/grantleeprintstyle.cpp @@ -37,8 +37,9 @@ GrantleePrintStyle::GrantleePrintStyle(const QString &themePath, PrintingWizard *parent) : PrintStyle(parent) + , m_themePath(themePath) { - mGrantleePrint = new KAddressBookGrantlee::GrantleePrint(themePath, this); + QFile previewFile(QString(themePath + QDir::separator() + QStringLiteral("preview.png"))); if (previewFile.exists()) { setPreview(previewFile.fileName()); @@ -57,7 +58,9 @@ progress->addMessage(i18n("Setting up document")); - const QString html = mGrantleePrint->contactsToHtml(contacts); + KAddressBookGrantlee::GrantleePrint grantleePrint(m_themePath); + grantleePrint.setApplicationDomain("kaddressbook"); + const QString html = grantleePrint.contactsToHtml(contacts); QTextDocument document; document.setHtml(html); diff --git a/src/printing/grantlee/themes/big-theme-example/theme.html b/src/printing/grantlee/themes/big-theme-example/theme.html --- a/src/printing/grantlee/themes/big-theme-example/theme.html +++ b/src/printing/grantlee/themes/big-theme-example/theme.html @@ -1,6 +1,6 @@ -

AddressBook

+

{% i18n "Address Book" %}

{% if contacts %} {% for contact in contacts %}

{{ contact.realName|safe }}