Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-apps/calendarsupport/files/, kde-apps/calendarsupport/
Date: Sun, 29 Nov 2020 20:05:32
Message-Id: 1606680269.6a98ee6035cad3817e71b4429dbf1e7eb8227459.asturm@gentoo
1 commit: 6a98ee6035cad3817e71b4429dbf1e7eb8227459
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 29 20:02:53 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 29 20:04:29 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a98ee60
7
8 kde-apps/calendarsupport: Fix build with Qt 5.15.2
9
10 Upstream commit b4193facb223bd5b73a65318dec8ced51b66adf7
11
12 Reported-by: Lars Wendler <polynomial-c <AT> gentoo.org>
13 Closes: https://bugs.gentoo.org/757657
14 Package-Manager: Portage-3.0.11, Repoman-3.0.2
15 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
16
17 .../calendarsupport/calendarsupport-20.08.3.ebuild | 2 +
18 .../files/calendarsupport-20.08.3-qt-5.15.2.patch | 229 +++++++++++++++++++++
19 2 files changed, 231 insertions(+)
20
21 diff --git a/kde-apps/calendarsupport/calendarsupport-20.08.3.ebuild b/kde-apps/calendarsupport/calendarsupport-20.08.3.ebuild
22 index 0bd817ac07c..58478c49882 100644
23 --- a/kde-apps/calendarsupport/calendarsupport-20.08.3.ebuild
24 +++ b/kde-apps/calendarsupport/calendarsupport-20.08.3.ebuild
25 @@ -45,3 +45,5 @@ DEPEND="
26 >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
27 "
28 RDEPEND="${DEPEND}"
29 +
30 +PATCHES=( "${FILESDIR}/${P}-qt-5.15.2.patch" )
31
32 diff --git a/kde-apps/calendarsupport/files/calendarsupport-20.08.3-qt-5.15.2.patch b/kde-apps/calendarsupport/files/calendarsupport-20.08.3-qt-5.15.2.patch
33 new file mode 100644
34 index 00000000000..af94c2e7a0d
35 --- /dev/null
36 +++ b/kde-apps/calendarsupport/files/calendarsupport-20.08.3-qt-5.15.2.patch
37 @@ -0,0 +1,229 @@
38 +From b4193facb223bd5b73a65318dec8ced51b66adf7 Mon Sep 17 00:00:00 2001
39 +From: Nicolas Fella <nicolas.fella@×××.de>
40 +Date: Wed, 9 Sep 2020 17:26:46 +0200
41 +Subject: [PATCH] Port away from deprecated QPrinter functions
42 +
43 +This implies changing from QPrinter::Orientation to QPageLayout::Orientation. The actual values are the same tough.
44 +---
45 + src/printing/calprintdefaultplugins.cpp | 14 +++++++-------
46 + src/printing/calprintdefaultplugins.h | 10 +++++-----
47 + src/printing/calprinter.cpp | 6 +++---
48 + src/printing/calprintpluginbase.cpp | 8 ++++----
49 + src/printing/calprintpluginbase.h | 2 +-
50 + src/printing/printplugin.h | 4 ++--
51 + src/printing/yearprint.cpp | 6 +++---
52 + src/printing/yearprint.h | 2 +-
53 + 8 files changed, 26 insertions(+), 26 deletions(-)
54 +
55 +diff --git a/src/printing/calprintdefaultplugins.cpp b/src/printing/calprintdefaultplugins.cpp
56 +index 862b74d..e3d802d 100644
57 +--- a/src/printing/calprintdefaultplugins.cpp
58 ++++ b/src/printing/calprintdefaultplugins.cpp
59 +@@ -805,7 +805,7 @@ void CalPrintDay::print(QPainter &p, int width, int height)
60 + QString line1 = local.toString(mFromDate, QLocale::ShortFormat);
61 + QString line2 = local.toString(mToDate, QLocale::ShortFormat);
62 + QString title;
63 +- if (orientation() == QPrinter::Landscape) {
64 ++ if (orientation() == QPageLayout::Landscape) {
65 + title = i18nc("date from-to", "%1 - %2", line1, line2);
66 + } else {
67 + title = i18nc("date from-\nto", "%1 -\n%2", line1, line2);
68 +@@ -1050,14 +1050,14 @@ void CalPrintWeek::saveConfig()
69 + }
70 + }
71 +
72 +-QPrinter::Orientation CalPrintWeek::defaultOrientation() const
73 ++QPageLayout::Orientation CalPrintWeek::defaultOrientation() const
74 + {
75 + if (mWeekPrintType == Filofax) {
76 +- return QPrinter::Portrait;
77 ++ return QPageLayout::Portrait;
78 + } else if (mWeekPrintType == SplitWeek) {
79 +- return QPrinter::Portrait;
80 ++ return QPageLayout::Portrait;
81 + } else {
82 +- return QPrinter::Landscape;
83 ++ return QPageLayout::Landscape;
84 + }
85 + }
86 +
87 +@@ -1099,7 +1099,7 @@ void CalPrintWeek::print(QPainter &p, int width, int height)
88 + do {
89 + line1 = local.toString(curWeek.addDays(-6), QLocale::ShortFormat);
90 + line2 = local.toString(curWeek, QLocale::ShortFormat);
91 +- if (orientation() == QPrinter::Landscape) {
92 ++ if (orientation() == QPageLayout::Landscape) {
93 + title = i18nc("date from-to", "%1 - %2", line1, line2);
94 + } else {
95 + title = i18nc("date from-\nto", "%1 -\n%2", line1, line2);
96 +@@ -1126,7 +1126,7 @@ void CalPrintWeek::print(QPainter &p, int width, int height)
97 + do {
98 + line1 = local.toString(curWeek.addDays(-6), QLocale::ShortFormat);
99 + line2 = local.toString(curWeek, QLocale::ShortFormat);
100 +- if (orientation() == QPrinter::Landscape) {
101 ++ if (orientation() == QPageLayout::Landscape) {
102 + title = i18nc("date from - to (week number)", "%1 - %2 (Week %3)",
103 + line1, line2, curWeek.weekNumber());
104 + } else {
105 +diff --git a/src/printing/calprintdefaultplugins.h b/src/printing/calprintdefaultplugins.h
106 +index 4df72f6..3f62d0b 100644
107 +--- a/src/printing/calprintdefaultplugins.h
108 ++++ b/src/printing/calprintdefaultplugins.h
109 +@@ -53,9 +53,9 @@ public:
110 + }
111 +
112 + QWidget *createConfigWidget(QWidget *) override;
113 +- Q_REQUIRED_RESULT QPrinter::Orientation defaultOrientation() const override
114 ++ Q_REQUIRED_RESULT QPageLayout::Orientation defaultOrientation() const override
115 + {
116 +- return QPrinter::Portrait;
117 ++ return QPageLayout::Portrait;
118 + }
119 +
120 + public:
121 +@@ -166,7 +166,7 @@ public:
122 + /**
123 + Returns the default orientation for the eWeekPrintType.
124 + */
125 +- QPrinter::Orientation defaultOrientation() const override;
126 ++ QPageLayout::Orientation defaultOrientation() const override;
127 +
128 + public:
129 + void print(QPainter &p, int width, int height) override;
130 +@@ -222,9 +222,9 @@ public:
131 + }
132 +
133 + QWidget *createConfigWidget(QWidget *) override;
134 +- QPrinter::Orientation defaultOrientation() const override
135 ++ QPageLayout::Orientation defaultOrientation() const override
136 + {
137 +- return QPrinter::Landscape;
138 ++ return QPageLayout::Landscape;
139 + }
140 +
141 + public:
142 +diff --git a/src/printing/calprinter.cpp b/src/printing/calprinter.cpp
143 +index 182e0e3..10e9db6 100644
144 +--- a/src/printing/calprinter.cpp
145 ++++ b/src/printing/calprinter.cpp
146 +@@ -126,13 +126,13 @@ void CalPrinter::doPrint(PrintPlugin *selectedStyle, CalPrinter::ePrintOrientati
147 + QPrinter printer;
148 + switch (dlgorientation) {
149 + case eOrientPlugin:
150 +- printer.setOrientation(selectedStyle->defaultOrientation());
151 ++ printer.setPageOrientation(selectedStyle->defaultOrientation());
152 + break;
153 + case eOrientPortrait:
154 +- printer.setOrientation(QPrinter::Portrait);
155 ++ printer.setPageOrientation(QPageLayout::Portrait);
156 + break;
157 + case eOrientLandscape:
158 +- printer.setOrientation(QPrinter::Landscape);
159 ++ printer.setPageOrientation(QPageLayout::Landscape);
160 + break;
161 + case eOrientPrinter:
162 + break;
163 +diff --git a/src/printing/calprintpluginbase.cpp b/src/printing/calprintpluginbase.cpp
164 +index e96f3b2..9db198e 100644
165 +--- a/src/printing/calprintpluginbase.cpp
166 ++++ b/src/printing/calprintpluginbase.cpp
167 +@@ -232,9 +232,9 @@ void CalPrintPluginBase::setPrintFooter(bool printFooter)
168 + mPrintFooter = printFooter;
169 + }
170 +
171 +-QPrinter::Orientation CalPrintPluginBase::orientation() const
172 ++QPageLayout::Orientation CalPrintPluginBase::orientation() const
173 + {
174 +- return mPrinter ? mPrinter->orientation() : QPrinter::Portrait;
175 ++ return mPrinter ? mPrinter->pageLayout().orientation() : QPageLayout::Portrait;
176 + }
177 +
178 + QColor CalPrintPluginBase::getTextColor(const QColor &c) const
179 +@@ -326,7 +326,7 @@ int CalPrintPluginBase::headerHeight() const
180 + {
181 + if (mHeaderHeight >= 0) {
182 + return mHeaderHeight;
183 +- } else if (orientation() == QPrinter::Portrait) {
184 ++ } else if (orientation() == QPageLayout::Portrait) {
185 + return PORTRAIT_HEADER_HEIGHT;
186 + } else {
187 + return LANDSCAPE_HEADER_HEIGHT;
188 +@@ -356,7 +356,7 @@ int CalPrintPluginBase::footerHeight() const
189 +
190 + if (mFooterHeight >= 0) {
191 + return mFooterHeight;
192 +- } else if (orientation() == QPrinter::Portrait) {
193 ++ } else if (orientation() == QPageLayout::Portrait) {
194 + return PORTRAIT_FOOTER_HEIGHT;
195 + } else {
196 + return LANDSCAPE_FOOTER_HEIGHT;
197 +diff --git a/src/printing/calprintpluginbase.h b/src/printing/calprintpluginbase.h
198 +index ff1113c..b3d41ac 100644
199 +--- a/src/printing/calprintpluginbase.h
200 ++++ b/src/printing/calprintpluginbase.h
201 +@@ -108,7 +108,7 @@ public:
202 + */
203 + static int weekdayColumn(int weekday);
204 +
205 +- QPrinter::Orientation orientation() const;
206 ++ QPageLayout::Orientation orientation() const;
207 +
208 + /** Returns the height of the page header. If the height was explicitly
209 + set using setHeaderHeight, that value is returned, otherwise a
210 +diff --git a/src/printing/printplugin.h b/src/printing/printplugin.h
211 +index 57afdfe..73bf467 100644
212 +--- a/src/printing/printplugin.h
213 ++++ b/src/printing/printplugin.h
214 +@@ -140,9 +140,9 @@ public:
215 + config settings), implement this function in your subclass and
216 + return the desired orientation.
217 + */
218 +- virtual QPrinter::Orientation defaultOrientation() const
219 ++ virtual QPageLayout::Orientation defaultOrientation() const
220 + {
221 +- return QPrinter::Portrait;
222 ++ return QPageLayout::Portrait;
223 + }
224 +
225 + /**
226 +diff --git a/src/printing/yearprint.cpp b/src/printing/yearprint.cpp
227 +index 3287ca6..e57a1c4 100644
228 +--- a/src/printing/yearprint.cpp
229 ++++ b/src/printing/yearprint.cpp
230 +@@ -82,9 +82,9 @@ void CalPrintYear::saveConfig()
231 + }
232 + }
233 +
234 +-QPrinter::Orientation CalPrintYear::defaultOrientation() const
235 ++QPageLayout::Orientation CalPrintYear::defaultOrientation() const
236 + {
237 +- return (mPages == 1) ? QPrinter::Landscape : QPrinter::Portrait;
238 ++ return (mPages == 1) ? QPageLayout::Landscape : QPageLayout::Portrait;
239 + }
240 +
241 + void CalPrintYear::setDateRange(const QDate &from, const QDate &to)
242 +@@ -131,7 +131,7 @@ void CalPrintYear::print(QPainter &p, int width, int height)
243 + QString stdate = locale.toString(start, QLocale::ShortFormat);
244 + QString endate = locale.toString(end, QLocale::ShortFormat);
245 + QString title;
246 +- if (orientation() == QPrinter::Landscape) {
247 ++ if (orientation() == QPageLayout::Landscape) {
248 + title = i18nc("date from - to", "%1 - %2", stdate, endate);
249 + } else {
250 + title = i18nc("date from -\nto", "%1 -\n%2", stdate, endate);
251 +diff --git a/src/printing/yearprint.h b/src/printing/yearprint.h
252 +index e59bf87..cd46a50 100644
253 +--- a/src/printing/yearprint.h
254 ++++ b/src/printing/yearprint.h
255 +@@ -48,7 +48,7 @@ public:
256 + }
257 +
258 + QWidget *createConfigWidget(QWidget *) override;
259 +- Q_REQUIRED_RESULT QPrinter::Orientation defaultOrientation() const override;
260 ++ Q_REQUIRED_RESULT QPageLayout::Orientation defaultOrientation() const override;
261 +
262 + public:
263 + void print(QPainter &p, int width, int height) override;
264 +--
265 +GitLab
266 +