1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
From 3287867734062c60dd6d5ccc66aa03fb73795f9e Mon Sep 17 00:00:00 2001
From: Volker Krause <vkrause@kde.org>
Date: Mon, 14 Mar 2022 17:22:48 +0100
Subject: [PATCH] Use KWindowStateSaver for the print preview dialog
This obsoletes KPimPrintPreviewDialog, and even allows us to remove the
dependency to pimcommon here.
---
CMakeLists.txt | 2 --
src/CMakeLists.txt | 1 -
src/printing/calprinter.cpp | 10 +++++-----
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f684ab9..5225c82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,7 +58,6 @@ find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
-find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiNotes ${AKONADI_NOTES_VERSION} CONFIG REQUIRED)
ecm_setup_version(PROJECT VARIABLE_PREFIX CALENDARSUPPORT
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f8c2e3b..2846328 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -116,7 +116,6 @@ PRIVATE
KF5::AkonadiCore
KF5::CalendarCore
KF5::CalendarUtils
- KF5::PimCommon
)
set_target_properties(KF5CalendarSupport PROPERTIES
diff --git a/src/printing/calprinter.cpp b/src/printing/calprinter.cpp
index 0ef3da7..0eb7f8f 100644
--- a/src/printing/calprinter.cpp
+++ b/src/printing/calprinter.cpp
@@ -10,11 +10,11 @@
#include "journalprint.h"
#include "yearprint.h"
+#include <KConfigGroup>
#include <KMessageBox>
#include <KStandardGuiItem>
-#include <QVBoxLayout>
+#include <KWindowStateSaver>
-#include <KConfigGroup>
#include <QButtonGroup>
#include <QDialogButtonBox>
#include <QGridLayout>
@@ -23,8 +23,7 @@
#include <QPrintPreviewDialog>
#include <QSplitter>
#include <QStackedWidget>
-
-#include <PimCommon/KPimPrintPreviewDialog>
+#include <QVBoxLayout>
using namespace CalendarSupport;
@@ -132,7 +131,8 @@ void CalPrinter::doPrint(PrintPlugin *selectedStyle, CalPrinter::ePrintOrientati
}
if (preview) {
- QPointer<PimCommon::KPimPrintPreviewDialog> printPreview = new PimCommon::KPimPrintPreviewDialog(&printer);
+ QPointer<QPrintPreviewDialog> printPreview = new QPrintPreviewDialog(&printer);
+ new KWindowStateSaver(printPreview.data(), "CalendarPrintPreviewDialog");
connect(printPreview.data(), &QPrintPreviewDialog::paintRequested, this, [selectedStyle, &printer]() {
selectedStyle->doPrint(&printer);
});
--
GitLab
|