diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,8 +41,8 @@ set(AKONADI_MIMELIB_VERSION "5.11.40") set(KPIMTEXTEDIT_LIB_VERSION "5.11.40") -set(KDEPIM_APPS_LIB_VERSION_LIB "5.11.40") -set(LIBGRANTLEETHEME_LIB_VERSION_LIB "5.11.40") +set(KDEPIM_APPS_LIB_VERSION_LIB "5.11.45") +set(LIBGRANTLEETHEME_LIB_VERSION_LIB "5.11.41") set(LIBKLEO_LIB_VERSION_LIB "5.11.40") set(QT_REQUIRED_VERSION "5.10.0") set(KIMAP_LIB_VERSION "5.11.40") diff --git a/contactprintthemeeditor/contactprintthemepreview.h b/contactprintthemeeditor/contactprintthemepreview.h --- a/contactprintthemeeditor/contactprintthemepreview.h +++ b/contactprintthemeeditor/contactprintthemepreview.h @@ -46,7 +46,7 @@ private: KContacts::Addressee mContact; - KAddressBookGrantlee::GrantleePrint *mGrantleePrint = nullptr; + QString mThemePath; QWebEngineView *mViewer = nullptr; }; diff --git a/contactprintthemeeditor/contactprintthemepreview.cpp b/contactprintthemeeditor/contactprintthemepreview.cpp --- a/contactprintthemeeditor/contactprintthemepreview.cpp +++ b/contactprintthemeeditor/contactprintthemepreview.cpp @@ -29,17 +29,14 @@ ContactPrintThemePreview::ContactPrintThemePreview(const QString &projectDirectory, QWidget *parent) : GrantleeThemeEditor::PreviewWidget(parent) + , mThemePath(projectDirectory) { QHBoxLayout *hbox = new QHBoxLayout(this); hbox->setContentsMargins(0, 0, 0, 0); mViewer = new QWebEngineView(this); mViewer->setContextMenuPolicy(Qt::NoContextMenu); hbox->addWidget(mViewer); - mGrantleePrint = new KAddressBookGrantlee::GrantleePrint(this); loadConfig(); - if (!projectDirectory.isEmpty()) { - mGrantleePrint->changeGrantleePath(projectDirectory); - } } ContactPrintThemePreview::~ContactPrintThemePreview() @@ -50,8 +47,9 @@ { KContacts::AddresseeList lst; lst << mContact; - mGrantleePrint->refreshTemplate(); - const QString html = mGrantleePrint->contactsToHtml(lst); + KAddressBookGrantlee::GrantleePrint grantleePrint(mThemePath); + grantleePrint.setApplicationDomain("kaddressbook"); + const QString html = grantleePrint.contactsToHtml(lst); mViewer->setHtml(html); } @@ -64,7 +62,7 @@ void ContactPrintThemePreview::setThemePath(const QString &projectDirectory, const QString &mainPageFileName) { Q_UNUSED(mainPageFileName); - mGrantleePrint->changeGrantleePath(projectDirectory); + mThemePath = projectDirectory; } void ContactPrintThemePreview::loadConfig()