summaryrefslogtreecommitdiffstats
path: root/source/kde/kde/patch/calendarsupport/calendarsupport.qt-5.15.2.diff
blob: 7dc0b8689b97caf4e682fadf58d4ebe0a14d8b81 (plain) (blame)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
diff -u -r --new-file calendarsupport-20.08.3.orig/src/printing/calprintdefaultplugins.cpp calendarsupport-20.08.3/src/printing/calprintdefaultplugins.cpp
--- calendarsupport-20.08.3.orig/src/printing/calprintdefaultplugins.cpp	2020-10-10 14:56:21.000000000 -0500
+++ calendarsupport-20.08.3/src/printing/calprintdefaultplugins.cpp	2020-11-21 13:57:32.443012469 -0600
@@ -1,28 +1,12 @@
 /*
-  Copyright (c) 1998 Preston Brown <pbrown@kde.org>
-  Copyright (C) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
-  Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
-  Copyright (c) 2008 Ron Goodheart <rong.dev@gmail.com>
-  Copyright (C) 2010-2020 Laurent Montel <montel@kde.org>
-  Copyright (c) 2012-2013 Allen Winter <winter@kde.org>
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License along
-  with this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-  As a special exception, permission is given to link this program
-  with any edition of Qt, and distribute the resulting executable,
-  without including the source code for Qt in the source distribution.
+  SPDX-FileCopyrightText: 1998 Preston Brown <pbrown@kde.org>
+  SPDX-FileCopyrightText: 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
+  SPDX-FileCopyrightText: 2003 Cornelius Schumacher <schumacher@kde.org>
+  SPDX-FileCopyrightText: 2008 Ron Goodheart <rong.dev@gmail.com>
+  SPDX-FileCopyrightText: 2010-2020 Laurent Montel <montel@kde.org>
+  SPDX-FileCopyrightText: 2012-2013 Allen Winter <winter@kde.org>
+
+  SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
 */
 
 #include "calprintdefaultplugins.h"
@@ -40,7 +24,6 @@
 
 #include <QPainter>
 #include <QPrinter>
-#include <KLocalizedString>
 
 using namespace CalendarSupport;
 
@@ -69,7 +52,7 @@
 
 void CalPrintIncidence::readSettingsWidget()
 {
-    CalPrintIncidenceConfig *cfg
+    auto *cfg
         = dynamic_cast<CalPrintIncidenceConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         mUseColors = cfg->mColors->isChecked();
@@ -84,7 +67,7 @@
 
 void CalPrintIncidence::setSettingsWidget()
 {
-    CalPrintIncidenceConfig *cfg
+    auto *cfg
         = dynamic_cast<CalPrintIncidenceConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         cfg->mColors->setChecked(mUseColors);
@@ -205,7 +188,7 @@
 
     bool visit(const KCalendarCore::FreeBusy::Ptr &fb) override
     {
-        Q_UNUSED(fb);
+        Q_UNUSED(fb)
         return true;
     }
 };
@@ -688,7 +671,7 @@
 
 void CalPrintDay::readSettingsWidget()
 {
-    CalPrintDayConfig *cfg
+    auto *cfg
         = dynamic_cast<CalPrintDayConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         mFromDate = cfg->mFromDate->date();
@@ -720,7 +703,7 @@
 
 void CalPrintDay::setSettingsWidget()
 {
-    CalPrintDayConfig *cfg = dynamic_cast<CalPrintDayConfig *>((QWidget *)mConfigWidget);
+    auto *cfg = dynamic_cast<CalPrintDayConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         cfg->mFromDate->setDate(mFromDate);
         cfg->mToDate->setDate(mToDate);
@@ -793,7 +776,7 @@
 void CalPrintDay::setDateRange(const QDate &from, const QDate &to)
 {
     CalPrintPluginBase::setDateRange(from, to);
-    CalPrintDayConfig *cfg
+    auto *cfg
         = dynamic_cast<CalPrintDayConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         cfg->mFromDate->setDate(from);
@@ -821,7 +804,7 @@
         QString line1 = local.toString(mFromDate, QLocale::ShortFormat);
         QString line2 = local.toString(mToDate, QLocale::ShortFormat);
         QString title;
-        if (orientation() == QPrinter::Landscape) {
+        if (orientation() == QPageLayout::Landscape) {
             title = i18nc("date from-to", "%1 - %2", line1, line2);
         } else {
             title = i18nc("date from-\nto", "%1 -\n%2", line1, line2);
@@ -967,7 +950,7 @@
 
 void CalPrintWeek::readSettingsWidget()
 {
-    CalPrintWeekConfig *cfg = dynamic_cast<CalPrintWeekConfig *>((QWidget *)mConfigWidget);
+    auto *cfg = dynamic_cast<CalPrintWeekConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         mFromDate = cfg->mFromDate->date();
         mToDate = cfg->mToDate->date();
@@ -999,7 +982,7 @@
 
 void CalPrintWeek::setSettingsWidget()
 {
-    CalPrintWeekConfig *cfg = dynamic_cast<CalPrintWeekConfig *>((QWidget *)mConfigWidget);
+    auto *cfg = dynamic_cast<CalPrintWeekConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         cfg->mFromDate->setDate(mFromDate);
         cfg->mToDate->setDate(mToDate);
@@ -1066,21 +1049,21 @@
     }
 }
 
-QPrinter::Orientation CalPrintWeek::defaultOrientation() const
+QPageLayout::Orientation CalPrintWeek::defaultOrientation() const
 {
     if (mWeekPrintType == Filofax) {
-        return QPrinter::Portrait;
+        return QPageLayout::Portrait;
     } else if (mWeekPrintType == SplitWeek) {
-        return QPrinter::Portrait;
+        return QPageLayout::Portrait;
     } else {
-        return QPrinter::Landscape;
+        return QPageLayout::Landscape;
     }
 }
 
 void CalPrintWeek::setDateRange(const QDate &from, const QDate &to)
 {
     CalPrintPluginBase::setDateRange(from, to);
-    CalPrintWeekConfig *cfg
+    auto *cfg
         = dynamic_cast<CalPrintWeekConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         cfg->mFromDate->setDate(from);
@@ -1115,7 +1098,7 @@
         do {
             line1 = local.toString(curWeek.addDays(-6), QLocale::ShortFormat);
             line2 = local.toString(curWeek, QLocale::ShortFormat);
-            if (orientation() == QPrinter::Landscape) {
+            if (orientation() == QPageLayout::Landscape) {
                 title = i18nc("date from-to", "%1 - %2", line1, line2);
             } else {
                 title = i18nc("date from-\nto", "%1 -\n%2", line1, line2);
@@ -1142,7 +1125,7 @@
         do {
             line1 = local.toString(curWeek.addDays(-6), QLocale::ShortFormat);
             line2 = local.toString(curWeek, QLocale::ShortFormat);
-            if (orientation() == QPrinter::Landscape) {
+            if (orientation() == QPageLayout::Landscape) {
                 title = i18nc("date from - to (week number)", "%1 - %2 (Week %3)",
                               line1, line2, curWeek.weekNumber());
             } else {
@@ -1228,7 +1211,7 @@
 
 void CalPrintMonth::readSettingsWidget()
 {
-    CalPrintMonthConfig *cfg = dynamic_cast<CalPrintMonthConfig *>((QWidget *)mConfigWidget);
+    auto *cfg = dynamic_cast<CalPrintMonthConfig *>((QWidget *)mConfigWidget);
 
     if (cfg) {
         mFromDate = QDate(cfg->mFromYear->value(), cfg->mFromMonth->currentIndex() + 1, 1);
@@ -1250,7 +1233,7 @@
 
 void CalPrintMonth::setSettingsWidget()
 {
-    CalPrintMonthConfig *cfg = dynamic_cast<CalPrintMonthConfig *>((QWidget *)mConfigWidget);
+    auto *cfg = dynamic_cast<CalPrintMonthConfig *>((QWidget *)mConfigWidget);
 
     if (cfg) {
         setDateRange(mFromDate, mToDate);
@@ -1306,7 +1289,7 @@
 void CalPrintMonth::setDateRange(const QDate &from, const QDate &to)
 {
     CalPrintPluginBase::setDateRange(from, to);
-    CalPrintMonthConfig *cfg
+    auto *cfg
         = dynamic_cast<CalPrintMonthConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         cfg->mFromMonth->clear();
@@ -1389,7 +1372,7 @@
 
 void CalPrintTodos::readSettingsWidget()
 {
-    CalPrintTodoConfig *cfg = dynamic_cast<CalPrintTodoConfig *>((QWidget *)mConfigWidget);
+    auto *cfg = dynamic_cast<CalPrintTodoConfig *>((QWidget *)mConfigWidget);
 
     if (cfg) {
         mPageTitle = cfg->mTitle->text();
@@ -1425,7 +1408,7 @@
 
 void CalPrintTodos::setSettingsWidget()
 {
-    CalPrintTodoConfig *cfg
+    auto *cfg
         = dynamic_cast<CalPrintTodoConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         cfg->mTitle->setText(mPageTitle);
diff -u -r --new-file calendarsupport-20.08.3.orig/src/printing/calprintdefaultplugins.h calendarsupport-20.08.3/src/printing/calprintdefaultplugins.h
--- calendarsupport-20.08.3.orig/src/printing/calprintdefaultplugins.h	2020-10-10 14:56:21.000000000 -0500
+++ calendarsupport-20.08.3/src/printing/calprintdefaultplugins.h	2020-11-21 16:02:29.289180174 -0600
@@ -69,9 +69,9 @@
     }
 
     QWidget *createConfigWidget(QWidget *) override;
-    Q_REQUIRED_RESULT QPrinter::Orientation defaultOrientation() const override
+    Q_REQUIRED_RESULT QPageLayout::Orientation defaultOrientation() const override
     {
-        return QPrinter::Portrait;
+        return QPageLayout::Portrait;
     }
 
 public:
@@ -182,7 +182,7 @@
     /**
       Returns the default orientation for the eWeekPrintType.
     */
-    QPrinter::Orientation defaultOrientation() const override;
+    QPageLayout::Orientation defaultOrientation() const override;
 
 public:
     void print(QPainter &p, int width, int height) override;
@@ -238,9 +238,9 @@
     }
 
     QWidget *createConfigWidget(QWidget *) override;
-    QPrinter::Orientation defaultOrientation() const override
+    QPageLayout::Orientation defaultOrientation() const override
     {
-        return QPrinter::Landscape;
+        return QPageLayout::Landscape;
     }
 
 public:
diff -u -r --new-file calendarsupport-20.08.3.orig/src/printing/calprinter.cpp calendarsupport-20.08.3/src/printing/calprinter.cpp
--- calendarsupport-20.08.3.orig/src/printing/calprinter.cpp	2020-10-10 14:56:21.000000000 -0500
+++ calendarsupport-20.08.3/src/printing/calprinter.cpp	2020-11-21 16:02:29.290180174 -0600
@@ -39,7 +39,6 @@
 #include <QStackedWidget>
 #include <KConfigGroup>
 #include <QDialogButtonBox>
-#include <QPushButton>
 
 #include <PimCommon/KPimPrintPreviewDialog>
 
@@ -142,13 +141,13 @@
     QPrinter printer;
     switch (dlgorientation) {
     case eOrientPlugin:
-        printer.setOrientation(selectedStyle->defaultOrientation());
+        printer.setPageOrientation(selectedStyle->defaultOrientation());
         break;
     case eOrientPortrait:
-        printer.setOrientation(QPrinter::Portrait);
+        printer.setPageOrientation(QPageLayout::Portrait);
         break;
     case eOrientLandscape:
-        printer.setOrientation(QPrinter::Landscape);
+        printer.setPageOrientation(QPageLayout::Landscape);
         break;
     case eOrientPrinter:
         break;
@@ -182,7 +181,7 @@
     setWindowTitle(i18nc("@title:window", "Print"));
     QDialogButtonBox *buttonBox = new QDialogButtonBox(
         QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
-    QVBoxLayout *mainLayout = new QVBoxLayout(this);
+    auto *mainLayout = new QVBoxLayout(this);
     mOkButton = buttonBox->button(QDialogButtonBox::Ok);
     mOkButton->setDefault(true);
     mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
@@ -190,12 +189,12 @@
     connect(buttonBox, &QDialogButtonBox::rejected, this, &CalPrintDialog::reject);
     setModal(true);
     QWidget *page = new QWidget(this);
-    QVBoxLayout *pageVBoxLayout = new QVBoxLayout(page);
+    auto *pageVBoxLayout = new QVBoxLayout(page);
     pageVBoxLayout->setContentsMargins(0, 0, 0, 0);
     mainLayout->addWidget(page);
     mainLayout->addWidget(buttonBox);
 
-    QSplitter *splitter = new QSplitter(page);
+    auto *splitter = new QSplitter(page);
     pageVBoxLayout->addWidget(splitter);
     splitter->setOrientation(Qt::Horizontal);
     splitter->setChildrenCollapsible(false);
@@ -204,7 +203,7 @@
     mTypeGroup = new QButtonGroup(typeBox);
 
     QWidget *splitterRight = new QWidget(splitter);
-    QGridLayout *splitterRightLayout = new QGridLayout(splitterRight);
+    auto *splitterRightLayout = new QGridLayout(splitterRight);
     splitterRightLayout->setContentsMargins(0, 0, 0, 0);
     //splitterRightLayout->setMargin( marginHint() );
     //splitterRightLayout->setSpacing( spacingHint() );
diff -u -r --new-file calendarsupport-20.08.3.orig/src/printing/calprintpluginbase.cpp calendarsupport-20.08.3/src/printing/calprintpluginbase.cpp
--- calendarsupport-20.08.3.orig/src/printing/calprintpluginbase.cpp	2020-10-10 14:56:21.000000000 -0500
+++ calendarsupport-20.08.3/src/printing/calprintpluginbase.cpp	2020-11-21 16:02:29.290180174 -0600
@@ -38,7 +38,6 @@
 #include <QAbstractTextDocumentLayout>
 #include <QFrame>
 #include <QLabel>
-#include <QPainter>
 #include <QTextCursor>
 #include <QTextDocument>
 #include <QTextDocumentFragment>
@@ -112,7 +111,7 @@
         happens on the given day */
     bool overlaps(CellItem *o) const override
     {
-        PrintCellItem *other = static_cast<PrintCellItem *>(o);
+        auto *other = static_cast<PrintCellItem *>(o);
         return !(other->start() >= end() || other->end() <= start());
     }
 
@@ -144,7 +143,7 @@
 QWidget *CalPrintPluginBase::createConfigWidget(QWidget *w)
 {
     QFrame *wdg = new QFrame(w);
-    QVBoxLayout *layout = new QVBoxLayout(wdg);
+    auto *layout = new QVBoxLayout(wdg);
 
     QLabel *title = new QLabel(description(), wdg);
     QFont titleFont(title->font());
@@ -248,9 +247,9 @@
     mPrintFooter = printFooter;
 }
 
-QPrinter::Orientation CalPrintPluginBase::orientation() const
+QPageLayout::Orientation CalPrintPluginBase::orientation() const
 {
-    return mPrinter ? mPrinter->orientation() : QPrinter::Portrait;
+    return mPrinter ? mPrinter->pageLayout().orientation() : QPageLayout::Portrait;
 }
 
 QColor CalPrintPluginBase::getTextColor(const QColor &c) const
@@ -342,7 +341,7 @@
 {
     if (mHeaderHeight >= 0) {
         return mHeaderHeight;
-    } else if (orientation() == QPrinter::Portrait) {
+    } else if (orientation() == QPageLayout::Portrait) {
         return PORTRAIT_HEADER_HEIGHT;
     } else {
         return LANDSCAPE_HEADER_HEIGHT;
@@ -372,7 +371,7 @@
 
     if (mFooterHeight >= 0) {
         return mFooterHeight;
-    } else if (orientation() == QPrinter::Portrait) {
+    } else if (orientation() == QPageLayout::Portrait) {
         return PORTRAIT_FOOTER_HEIGHT;
     } else {
         return LANDSCAPE_FOOTER_HEIGHT;
@@ -961,7 +960,7 @@
 
     QListIterator<CellItem *> it2(cells);
     while (it2.hasNext()) {
-        PrintCellItem *placeItem = static_cast<PrintCellItem *>(it2.next());
+        auto *placeItem = static_cast<PrintCellItem *>(it2.next());
         drawAgendaItem(placeItem, p, startPrintDate, endPrintDate, minlen, box,
                        includeDescription, excludeTime);
     }
@@ -1673,7 +1672,7 @@
     QFont oldfont(p.font());
     p.setFont(QFont(QStringLiteral("sans-serif"), 7));
     while (it1.hasNext()) {
-        PrintCellItem *placeItem = static_cast<PrintCellItem *>(it1.next());
+        auto *placeItem = static_cast<PrintCellItem *>(it1.next());
         int minsToStart = starttime.secsTo(placeItem->start()) / 60;
         int minsToEnd = starttime.secsTo(placeItem->end()) / 60;
 
diff -u -r --new-file calendarsupport-20.08.3.orig/src/printing/calprintpluginbase.h calendarsupport-20.08.3/src/printing/calprintpluginbase.h
--- calendarsupport-20.08.3.orig/src/printing/calprintpluginbase.h	2020-10-10 14:56:21.000000000 -0500
+++ calendarsupport-20.08.3/src/printing/calprintpluginbase.h	2020-11-21 16:02:29.290180174 -0600
@@ -123,7 +123,7 @@
     */
     static int weekdayColumn(int weekday);
 
-    QPrinter::Orientation orientation() const;
+    QPageLayout::Orientation orientation() const;
 
     /** Returns the height of the page header. If the height was explicitly
         set using setHeaderHeight, that value is returned, otherwise a
diff -u -r --new-file calendarsupport-20.08.3.orig/src/printing/printplugin.h calendarsupport-20.08.3/src/printing/printplugin.h
--- calendarsupport-20.08.3.orig/src/printing/printplugin.h	2020-10-10 14:56:21.000000000 -0500
+++ calendarsupport-20.08.3/src/printing/printplugin.h	2020-11-21 16:02:29.290180174 -0600
@@ -153,9 +153,9 @@
       config settings), implement this function in your subclass and
       return the desired orientation.
     */
-    virtual QPrinter::Orientation defaultOrientation() const
+    virtual QPageLayout::Orientation defaultOrientation() const
     {
-        return QPrinter::Portrait;
+        return QPageLayout::Portrait;
     }
 
     /**
diff -u -r --new-file calendarsupport-20.08.3.orig/src/printing/yearprint.cpp calendarsupport-20.08.3/src/printing/yearprint.cpp
--- calendarsupport-20.08.3.orig/src/printing/yearprint.cpp	2020-10-10 14:56:21.000000000 -0500
+++ calendarsupport-20.08.3/src/printing/yearprint.cpp	2020-11-21 13:57:32.444012470 -0600
@@ -1,23 +1,7 @@
 /*
-  Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
+  SPDX-FileCopyrightText: 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
 
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License along
-  with this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-  As a special exception, permission is given to link this program
-  with any edition of Qt, and distribute the resulting executable,
-  without including the source code for Qt in the source distribution.
+  SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
 */
 
 #include "yearprint.h"
@@ -38,7 +22,7 @@
 
 void CalPrintYear::readSettingsWidget()
 {
-    CalPrintYearConfig *cfg = dynamic_cast<CalPrintYearConfig *>((QWidget *)mConfigWidget);
+    auto *cfg = dynamic_cast<CalPrintYearConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         mYear = cfg->mYear->value();
         mPages = cfg->mPages->currentText().toInt();
@@ -49,7 +33,7 @@
 
 void CalPrintYear::setSettingsWidget()
 {
-    CalPrintYearConfig *cfg
+    auto *cfg
         = dynamic_cast<CalPrintYearConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         QDate start(mYear, 1, 1);
@@ -98,15 +82,15 @@
     }
 }
 
-QPrinter::Orientation CalPrintYear::defaultOrientation() const
+QPageLayout::Orientation CalPrintYear::defaultOrientation() const
 {
-    return (mPages == 1) ? QPrinter::Landscape : QPrinter::Portrait;
+    return (mPages == 1) ? QPageLayout::Landscape : QPageLayout::Portrait;
 }
 
 void CalPrintYear::setDateRange(const QDate &from, const QDate &to)
 {
     CalPrintPluginBase::setDateRange(from, to);
-    CalPrintYearConfig *cfg = dynamic_cast<CalPrintYearConfig *>((QWidget *)mConfigWidget);
+    auto *cfg = dynamic_cast<CalPrintYearConfig *>((QWidget *)mConfigWidget);
     if (cfg) {
         cfg->mYear->setValue(from.year());
     }
@@ -147,7 +131,7 @@
         QString stdate = locale.toString(start, QLocale::ShortFormat);
         QString endate = locale.toString(end, QLocale::ShortFormat);
         QString title;
-        if (orientation() == QPrinter::Landscape) {
+        if (orientation() == QPageLayout::Landscape) {
             title = i18nc("date from - to", "%1 - %2", stdate, endate);
         } else {
             title = i18nc("date from -\nto", "%1 -\n%2", stdate, endate);
diff -u -r --new-file calendarsupport-20.08.3.orig/src/printing/yearprint.h calendarsupport-20.08.3/src/printing/yearprint.h
--- calendarsupport-20.08.3.orig/src/printing/yearprint.h	2020-10-10 14:56:21.000000000 -0500
+++ calendarsupport-20.08.3/src/printing/yearprint.h	2020-11-21 16:02:29.291180174 -0600
@@ -64,7 +64,7 @@
     }
 
     QWidget *createConfigWidget(QWidget *) override;
-    Q_REQUIRED_RESULT QPrinter::Orientation defaultOrientation() const override;
+    Q_REQUIRED_RESULT QPageLayout::Orientation defaultOrientation() const override;
 
 public:
     void print(QPainter &p, int width, int height) override;