Commit f906beb0 authored by David Faure's avatar David Faure
Browse files

Port kolourpaint away from Kdeprint::createPrintDialog

Summary: This was the final step to port away from kdelibs4support.

Test Plan: The print dialog still has the 3rd widget with 2 radiobuttons like before.

Reviewers: broulik, andreagenor, tcanabrava, vkrause

Reviewed By: vkrause

Maniphest Tasks: T11576

Differential Revision: https://phabricator.kde.org/D25601
parent ea2d7440
......@@ -39,7 +39,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
XmlGui
IconThemes
TextWidgets
KDELibs4Support #kio::netaccess
JobWidgets
)
add_definitions(-DQT_USE_QSTRINGBUILDER)
......
......@@ -17,11 +17,11 @@ add_library(kolourpaint_lgpl SHARED ${kolourpaint_lgpl_SRCS})
set(kolourpaint_lgpl_version 5)
target_link_libraries(kolourpaint_lgpl
KF5::KDELibs4Support # kio::network
KF5::I18n
KF5::GuiAddons
KF5::WidgetsAddons
KF5::KIOCore
KF5::JobWidgets
Qt5::Widgets
)
......
......@@ -32,6 +32,7 @@
#include <KJobWidgets>
#include <KIO/StoredTransferJob>
#include <KIO/FileCopyJob>
#include <KLocalizedString>
#include <KMessageBox>
#include "kpLogCategories.h"
......
......@@ -62,7 +62,6 @@
#include <kstandardaction.h>
#include <ktoolinvocation.h>
#include <KLocalizedString>
#include <kdeprintdialog.h> // kdelibs4support
#include "kpLogCategories.h"
#include "commands/kpCommandHistory.h"
......@@ -1323,15 +1322,12 @@ void kpMainWindow::sendImageToPrinter (QPrinter *printer,
auto *optionsPage = new kpPrintDialogPage (this);
optionsPage->setPrintImageCenteredOnPage (d->configPrintImageCenteredOnPage);
QPrintDialog *printDialog =
KdePrint::createPrintDialog (
printer,
QList <QWidget *> () << optionsPage,
this);
printDialog->setWindowTitle (i18nc ("@title:window", "Print Image"));
QPrintDialog printDialog (printer, this);
printDialog.setOptionTabs ({optionsPage});
printDialog.setWindowTitle (i18nc ("@title:window", "Print Image"));
// Display dialog.
const bool wantToPrint = printDialog->exec ();
const bool wantToPrint = printDialog.exec ();
if (optionsPage->printImageCenteredOnPage () !=
d->configPrintImageCenteredOnPage)
......@@ -1345,8 +1341,6 @@ void kpMainWindow::sendImageToPrinter (QPrinter *printer,
cfg.sync ();
}
delete printDialog;
if (!wantToPrint) {
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment