summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Krause <[email protected]>2016-04-01 16:39:12 +0200
committerVolker Krause <[email protected]>2016-04-01 16:39:12 +0200
commitc5baf23f6f47c72e8604b36c58fbbda5029ed796 (patch)
tree7bb834eb8c78858ed4db74691a943f6cf4a3364c
parentb64ea0286a8e6eb3269588a4b48ccbf40158913b (diff)
Port away from KPrintPreview.
-rw-r--r--kaddressbook/mainwidget.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/kaddressbook/mainwidget.cpp b/kaddressbook/mainwidget.cpp
index 9fc62e0..bad30d4 100644
--- a/kaddressbook/mainwidget.cpp
+++ b/kaddressbook/mainwidget.cpp
@@ -78,7 +78,6 @@
#include <QTextBrowser>
#include <KToggleAction>
#include <KCMultiDialog>
-#include <KPrintPreview>
#include <KXMLGUIClient>
#include <KMessageBox>
@@ -87,6 +86,7 @@
#include <QHeaderView>
#include <QPrinter>
#include <QPrintDialog>
+#include <QPrintPreviewDialog>
#include <QSplitter>
#include <QStackedWidget>
#include <QDBusConnection>
@@ -607,9 +607,7 @@ void MainWidget::setupActions(KActionCollection *collection)
i18nc("@info:whatsthis",
"Print the complete address book or a selected number of contacts."));
- if (KPrintPreview::isAvailable()) {
- KStandardAction::printPreview(this, SLOT(printPreview()), collection);
- }
+ KStandardAction::printPreview(this, SLOT(printPreview()), collection);
QWidgetAction *quicksearch = new QWidgetAction(this);
quicksearch->setText(i18n("Quick search"));
@@ -746,9 +744,10 @@ void MainWidget::printPreview()
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setCollateCopies(true);
- KPrintPreview previewdlg(&printer, this);
+ QPrintPreviewDialog previewdlg(&printer, this);
KABPrinting::PrintingWizard wizard(&printer, mItemView->selectionModel(), this);
wizard.setDefaultAddressBook(currentAddressBook());
+ connect(&previewdlg, &QPrintPreviewDialog::paintRequested, this, [&wizard]() { wizard.print(); });
const int result = wizard.exec();
if (result) {