summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Krause <[email protected]>2015-08-16 22:17:46 +0200
committerVolker Krause <[email protected]>2015-08-16 22:17:46 +0200
commit99c42ed7e54ff0577c59b11c6784a9145ad9cb92 (patch)
tree61698878c50ff7cb0d06d30aa910a10c7cb57fa1
parentf56b954738f0aa91778e0d9717dabfab089be5d1 (diff)
Port away from KPrintPreview.
-rw-r--r--kmail/editor/kmcomposewin.cpp5
-rw-r--r--kmail/messageactions.cpp5
-rw-r--r--messageviewer/viewer/viewer_p.cpp9
3 files changed, 7 insertions, 12 deletions
diff --git a/kmail/editor/kmcomposewin.cpp b/kmail/editor/kmcomposewin.cpp
index 68999d7..8693167 100644
--- a/kmail/editor/kmcomposewin.cpp
+++ b/kmail/editor/kmcomposewin.cpp
@@ -167,7 +167,6 @@
#include <sonnet/dictionarycombobox.h>
#include <krun.h>
#include <KIO/JobUiDelegate>
-#include <KPrintPreview>
#include <QFileDialog>
#include <QAction>
#include <KEmailAddress>
@@ -1209,9 +1208,7 @@ void KMComposeWin::setupActions(void)
mComposerBase->recipientsEditor(), SLOT(saveDistributionList()));
KStandardAction::print(this, SLOT(slotPrint()), actionCollection());
- if (KPrintPreview::isAvailable()) {
- KStandardAction::printPreview(this, SLOT(slotPrintPreview()), actionCollection());
- }
+ KStandardAction::printPreview(this, SLOT(slotPrintPreview()), actionCollection());
KStandardAction::close(this, SLOT(slotClose()), actionCollection());
KStandardAction::undo(mGlobalAction, SLOT(slotUndo()), actionCollection());
diff --git a/kmail/messageactions.cpp b/kmail/messageactions.cpp
index f860217..868943b 100644
--- a/kmail/messageactions.cpp
+++ b/kmail/messageactions.cpp
@@ -55,7 +55,6 @@
#include <KUriFilterData>
#include <KUriFilter>
#include <KStringHandler>
-#include <KPrintPreview>
#include <QIcon>
#include <QVariant>
@@ -145,9 +144,7 @@ MessageActions::MessageActions(KActionCollection *ac, QWidget *parent)
connect(mAnnotateAction, &QAction::triggered, this, &MessageActions::annotateMessage);
mPrintAction = KStandardAction::print(this, SLOT(slotPrintMsg()), ac);
- if (KPrintPreview::isAvailable()) {
- mPrintPreviewAction = KStandardAction::printPreview(this, SLOT(slotPrintPreviewMsg()), ac);
- }
+ mPrintPreviewAction = KStandardAction::printPreview(this, SLOT(slotPrintPreviewMsg()), ac);
mForwardActionMenu = new KActionMenu(QIcon::fromTheme(QStringLiteral("mail-forward")), i18nc("Message->", "&Forward"), this);
ac->addAction(QStringLiteral("message_forward"), mForwardActionMenu);
diff --git a/messageviewer/viewer/viewer_p.cpp b/messageviewer/viewer/viewer_p.cpp
index e733dc3..796871f 100644
--- a/messageviewer/viewer/viewer_p.cpp
+++ b/messageviewer/viewer/viewer_p.cpp
@@ -70,7 +70,7 @@
#include <QTemporaryDir>
#include <QTemporaryFile>
#include <KToggleAction>
-#include <KPrintPreview>
+#include <QPrintPreviewDialog>
#include <kdeprintdialog.h>
#include <QIcon>
#include <kfileitemactions.h>
@@ -2517,9 +2517,10 @@ void ViewerPrivate::slotPrintPreview()
if (!mMessage) {
return;
}
- QPrinter printer;
- KPrintPreview previewdlg(&printer/*, mViewer*/);
- mViewer->print(&printer);
+ QPrintPreviewDialog previewdlg(mViewer);
+ connect(&previewdlg, &QPrintPreviewDialog::paintRequested, this, [this](QPrinter *printer) {
+ mViewer->print(printer);
+ });
previewdlg.exec();
}