1 |
commit: ff32834e66f881415549ae94747b5382cf2463ad |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 27 20:53:26 2018 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 27 21:05:46 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff32834e |
7 |
|
8 |
games-strategy/hedgewars: Add upstream patch to build w/ Qt5 |
9 |
|
10 |
See also: |
11 |
https://issues.hedgewars.org/show_bug.cgi?id=159 |
12 |
https://hg.hedgewars.org/hedgewars/log?rev=branch(qt5transition) |
13 |
|
14 |
Bug: https://bugs.gentoo.org/645504 |
15 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
16 |
|
17 |
.../hedgewars/files/hedgewars-0.9.23-qt5-1.patch | 87 ++++ |
18 |
.../hedgewars/files/hedgewars-0.9.23-qt5-2.patch | 477 +++++++++++++++++++++ |
19 |
.../hedgewars/hedgewars-0.9.23-r1.ebuild | 92 ++++ |
20 |
3 files changed, 656 insertions(+) |
21 |
|
22 |
diff --git a/games-strategy/hedgewars/files/hedgewars-0.9.23-qt5-1.patch b/games-strategy/hedgewars/files/hedgewars-0.9.23-qt5-1.patch |
23 |
new file mode 100644 |
24 |
index 00000000000..ec96bd8ef45 |
25 |
--- /dev/null |
26 |
+++ b/games-strategy/hedgewars/files/hedgewars-0.9.23-qt5-1.patch |
27 |
@@ -0,0 +1,87 @@ |
28 |
+ |
29 |
+# HG changeset patch |
30 |
+# User unc0rr |
31 |
+# Date 1516824334 -3600 |
32 |
+# Node ID 8869b5256720f0378bf9d5edc68ecb7e1f376039 |
33 |
+# Parent 856570ddd409bec11645c90b5a92fb79c5f2a4e1 |
34 |
+Configure for Qt5 |
35 |
+ |
36 |
+diff -r 856570ddd409 -r 8869b5256720 QTfrontend/CMakeLists.txt |
37 |
+--- a/QTfrontend/CMakeLists.txt Mon Jan 15 12:15:56 2018 -0500 |
38 |
++++ b/QTfrontend/CMakeLists.txt Wed Jan 24 21:05:34 2018 +0100 |
39 |
+@@ -1,24 +1,6 @@ |
40 |
+-# Configure for Qt4 |
41 |
+-set(QT_MIN_VERSION "4.7.0") |
42 |
+-include(CheckLibraryExists) |
43 |
++find_package(Qt5 COMPONENTS Core Gui Network Svg Xml OpenGL) |
44 |
+ |
45 |
+-set(QT_USE_QTCORE TRUE) |
46 |
+-set(QT_USE_QTGUI TRUE) |
47 |
+-set(QT_USE_QTNETWORK TRUE) |
48 |
+-set(QT_USE_QTSVG FALSE) |
49 |
+-set(QT_USE_QTXML FALSE) |
50 |
+-set(QT_USE_QTOPENGL FALSE) |
51 |
+-set(QT_USE_QTMAIN TRUE) |
52 |
+- |
53 |
+-find_package(Qt4 REQUIRED) |
54 |
+-include(${QT_USE_FILE}) |
55 |
+- |
56 |
+-# https://bugreports.qt-project.org/browse/QTBUG-17333 |
57 |
+-if(APPLE AND |
58 |
+- ${QTVERSION} VERSION_GREATER "4.7.0" AND |
59 |
+- ${QTVERSION} VERSION_LESS "4.7.4") |
60 |
+- message(FATAL_ERROR "This version of Qt is known *not* to work, please update or use a lower version") |
61 |
+-endif() |
62 |
++include(CheckLibraryExists) |
63 |
+ |
64 |
+ find_package(SDL2 REQUIRED) |
65 |
+ find_package(SDL2_mixer 2 REQUIRED) #audio in SDLInteraction |
66 |
+@@ -159,9 +141,9 @@ |
67 |
+ endif() |
68 |
+ endif() |
69 |
+ |
70 |
+-qt4_add_resources(hwfr_rez_src ${hwfr_rez}) |
71 |
++qt5_add_resources(hwfr_rez_src ${hwfr_rez}) |
72 |
+ |
73 |
+-qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
74 |
++qt5_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
75 |
+ |
76 |
+ |
77 |
+ if(APPLE) |
78 |
+@@ -198,14 +180,14 @@ |
79 |
+ |
80 |
+ list(APPEND HW_LINK_LIBS |
81 |
+ physfs physlayer |
82 |
+- ${QT_LIBRARIES} |
83 |
++ Qt5::Core Qt5::Gui Qt5::Network Qt5::Svg Qt5::Xml Qt5::OpenGL |
84 |
+ ) |
85 |
+ |
86 |
+ list(APPEND HW_LINK_LIBS |
87 |
+ ${SDL2_LIBRARY} |
88 |
+ ${SDL2_MIXER_LIBRARIES} |
89 |
+ ) |
90 |
+- |
91 |
++ |
92 |
+ if(WIN32 AND NOT UNIX) |
93 |
+ if(NOT SDL2_LIBRARY) |
94 |
+ list(APPEND HW_LINK_LIBS SDL2) |
95 |
+diff -r 856570ddd409 -r 8869b5256720 share/hedgewars/Data/Locale/CMakeLists.txt |
96 |
+--- a/share/hedgewars/Data/Locale/CMakeLists.txt Mon Jan 15 12:15:56 2018 -0500 |
97 |
++++ b/share/hedgewars/Data/Locale/CMakeLists.txt Wed Jan 24 21:05:34 2018 +0100 |
98 |
+@@ -1,5 +1,4 @@ |
99 |
+-find_package(Qt4 REQUIRED) |
100 |
+-include(${QT_USE_FILE}) |
101 |
++find_package(Qt5 COMPONENTS LinguistTools) |
102 |
+ |
103 |
+ file(GLOB txttrans2 ??.txt) |
104 |
+ file(GLOB txttrans5 ?????.txt) |
105 |
+@@ -9,7 +8,7 @@ |
106 |
+ file(GLOB campaignfiles campaigns_*.txt) |
107 |
+ file(GLOB tipfiles tips_*.xml) |
108 |
+ |
109 |
+-QT4_ADD_TRANSLATION(QM ${tsfiles}) |
110 |
++QT5_ADD_TRANSLATION(QM ${tsfiles}) |
111 |
+ |
112 |
+ add_custom_target (release-translation ALL |
113 |
+ DEPENDS ${QM} |
114 |
+ |
115 |
|
116 |
diff --git a/games-strategy/hedgewars/files/hedgewars-0.9.23-qt5-2.patch b/games-strategy/hedgewars/files/hedgewars-0.9.23-qt5-2.patch |
117 |
new file mode 100644 |
118 |
index 00000000000..eb4e465f009 |
119 |
--- /dev/null |
120 |
+++ b/games-strategy/hedgewars/files/hedgewars-0.9.23-qt5-2.patch |
121 |
@@ -0,0 +1,477 @@ |
122 |
+ |
123 |
+# HG changeset patch |
124 |
+# User unc0rr |
125 |
+# Date 1516828810 -3600 |
126 |
+# Node ID fc47fc4af6bd6f399035923453cd85c8f50146f7 |
127 |
+# Parent 8869b5256720f0378bf9d5edc68ecb7e1f376039 |
128 |
+Finish porting. Seems to work, but no thorough testing has been performed |
129 |
+ |
130 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/CMakeLists.txt |
131 |
+--- a/QTfrontend/CMakeLists.txt Wed Jan 24 21:05:34 2018 +0100 |
132 |
++++ b/QTfrontend/CMakeLists.txt Wed Jan 24 22:20:10 2018 +0100 |
133 |
+@@ -1,5 +1,7 @@ |
134 |
+ find_package(Qt5 COMPONENTS Core Gui Network Svg Xml OpenGL) |
135 |
+ |
136 |
++include_directories(${Qt5Core_PRIVATE_INCLUDE_DIRS}) |
137 |
++ |
138 |
+ include(CheckLibraryExists) |
139 |
+ |
140 |
+ find_package(SDL2 REQUIRED) |
141 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/main.cpp |
142 |
+--- a/QTfrontend/main.cpp Wed Jan 24 21:05:34 2018 +0100 |
143 |
++++ b/QTfrontend/main.cpp Wed Jan 24 22:20:10 2018 +0100 |
144 |
+@@ -20,7 +20,6 @@ |
145 |
+ |
146 |
+ #include <QTranslator> |
147 |
+ #include <QLocale> |
148 |
+-#include <QPlastiqueStyle> |
149 |
+ #include <QRegExp> |
150 |
+ #include <QMap> |
151 |
+ #include <QSettings> |
152 |
+@@ -252,7 +251,7 @@ |
153 |
+ splash.show(); |
154 |
+ #endif |
155 |
+ |
156 |
+- app.setStyle(new QPlastiqueStyle()); |
157 |
++ //app.setStyle(new QPlastiqueStyle()); |
158 |
+ |
159 |
+ QDateTime now = QDateTime::currentDateTime(); |
160 |
+ srand(now.toTime_t()); |
161 |
+@@ -332,7 +331,7 @@ |
162 |
+ |
163 |
+ // Fallback to current input locale if "C" locale is returned |
164 |
+ if(cc == "C") |
165 |
+- cc = HWApplication::keyboardInputLocale().name(); |
166 |
++ cc = HWApplication::inputMethod()->locale().name(); |
167 |
+ } |
168 |
+ |
169 |
+ // Load locale files into translators |
170 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/model/ammoSchemeModel.cpp |
171 |
+--- a/QTfrontend/model/ammoSchemeModel.cpp Wed Jan 24 21:05:34 2018 +0100 |
172 |
++++ b/QTfrontend/model/ammoSchemeModel.cpp Wed Jan 24 22:20:10 2018 +0100 |
173 |
+@@ -569,7 +569,7 @@ |
174 |
+ << QVariant() // scriptparam 43 |
175 |
+ ; |
176 |
+ |
177 |
+- QList<QVariant> construction; |
178 |
++ QList<QVariant> construction; |
179 |
+ construction |
180 |
+ << predefSchemesNames[10] // name 0 |
181 |
+ << QVariant(false) // fortsmode 1 |
182 |
+@@ -617,7 +617,7 @@ |
183 |
+ << QVariant() // scriptparam 43 |
184 |
+ ; |
185 |
+ |
186 |
+- QList<QVariant> hedgeeditor; |
187 |
++ QList<QVariant> hedgeeditor; |
188 |
+ hedgeeditor |
189 |
+ << predefSchemesNames[11] // name 0 |
190 |
+ << QVariant(false) // fortsmode 1 |
191 |
+@@ -664,9 +664,9 @@ |
192 |
+ << QVariant(0) // world edge 42 |
193 |
+ << QVariant() // scriptparam 43 |
194 |
+ ; |
195 |
+- |
196 |
+- |
197 |
+- |
198 |
++ |
199 |
++ |
200 |
++ |
201 |
+ schemes.append(defaultScheme); |
202 |
+ schemes.append(proMode); |
203 |
+ schemes.append(shoppa); |
204 |
+@@ -896,10 +896,12 @@ |
205 |
+ return; |
206 |
+ } |
207 |
+ |
208 |
++ beginResetModel(); |
209 |
++ |
210 |
+ cfg[cfg.size()-1] = cfg[cfg.size()-1].mid(1); |
211 |
+ |
212 |
+ for(int i = 0; i < cfg.size(); ++i) |
213 |
+ netScheme[i] = QVariant(cfg[i]); |
214 |
+ |
215 |
+- reset(); |
216 |
++ endResetModel(); |
217 |
+ } |
218 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/model/playerslistmodel.cpp |
219 |
+--- a/QTfrontend/model/playerslistmodel.cpp Wed Jan 24 21:05:34 2018 +0100 |
220 |
++++ b/QTfrontend/model/playerslistmodel.cpp Wed Jan 24 22:20:10 2018 +0100 |
221 |
+@@ -309,10 +309,10 @@ |
222 |
+ } |
223 |
+ |
224 |
+ if(index.data(Ignore).toBool()) |
225 |
+- setData(index, Qt::gray, Qt::ForegroundRole); |
226 |
++ setData(index, QColor(Qt::gray), Qt::ForegroundRole); |
227 |
+ else |
228 |
+ if(index.data(Friend).toBool()) |
229 |
+- setData(index, Qt::green, Qt::ForegroundRole); |
230 |
++ setData(index, QColor(Qt::green), Qt::ForegroundRole); |
231 |
+ else |
232 |
+ setData(index, QBrush(QColor(0xff, 0xcc, 0x00)), Qt::ForegroundRole); |
233 |
+ } |
234 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/net/hwmap.cpp |
235 |
+--- a/QTfrontend/net/hwmap.cpp Wed Jan 24 21:05:34 2018 +0100 |
236 |
++++ b/QTfrontend/net/hwmap.cpp Wed Jan 24 22:20:10 2018 +0100 |
237 |
+@@ -79,7 +79,7 @@ |
238 |
+ { |
239 |
+ quint8 *buf = (quint8*) readbuffer.constData(); |
240 |
+ QImage im(buf, 256, 128, QImage::Format_Mono); |
241 |
+- im.setNumColors(2); |
242 |
++ im.setColorCount(2); |
243 |
+ |
244 |
+ QPixmap px(QSize(256, 128)); |
245 |
+ QPixmap pxres(px.size()); |
246 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/net/netudpwidget.cpp |
247 |
+--- a/QTfrontend/net/netudpwidget.cpp Wed Jan 24 21:05:34 2018 +0100 |
248 |
++++ b/QTfrontend/net/netudpwidget.cpp Wed Jan 24 22:20:10 2018 +0100 |
249 |
+@@ -33,15 +33,19 @@ |
250 |
+ |
251 |
+ void HWNetUdpModel::updateList() |
252 |
+ { |
253 |
+- games.clear(); |
254 |
++ beginResetModel(); |
255 |
++ |
256 |
++ games.clear(); |
257 |
+ |
258 |
+- reset(); |
259 |
++ endResetModel(); |
260 |
+ |
261 |
+- pUdpSocket->writeDatagram("hedgewars client", QHostAddress::Broadcast, NETGAME_DEFAULT_PORT); |
262 |
++ pUdpSocket->writeDatagram("hedgewars client", QHostAddress::Broadcast, NETGAME_DEFAULT_PORT); |
263 |
+ } |
264 |
+ |
265 |
+ void HWNetUdpModel::onClientRead() |
266 |
+ { |
267 |
++ beginResetModel(); |
268 |
++ |
269 |
+ while (pUdpSocket->hasPendingDatagrams()) |
270 |
+ { |
271 |
+ QByteArray datagram; |
272 |
+@@ -60,7 +64,7 @@ |
273 |
+ } |
274 |
+ } |
275 |
+ |
276 |
+- reset(); |
277 |
++ endResetModel(); |
278 |
+ } |
279 |
+ |
280 |
+ QVariant HWNetUdpModel::data(const QModelIndex &index, |
281 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/net/newnetclient.cpp |
282 |
+--- a/QTfrontend/net/newnetclient.cpp Wed Jan 24 21:05:34 2018 +0100 |
283 |
++++ b/QTfrontend/net/newnetclient.cpp Wed Jan 24 22:20:10 2018 +0100 |
284 |
+@@ -242,7 +242,7 @@ |
285 |
+ void HWNewNet::SendPasswordHash(const QString & hash) |
286 |
+ { |
287 |
+ // don't send it immediately, only store and check if server asked us for a password |
288 |
+- m_passwordHash = hash.toAscii(); |
289 |
++ m_passwordHash = hash.toLatin1(); |
290 |
+ |
291 |
+ maybeSendPassword(); |
292 |
+ } |
293 |
+@@ -271,7 +271,7 @@ |
294 |
+ if (lst[0] == "ERROR") |
295 |
+ { |
296 |
+ if (lst.size() == 2) |
297 |
+- emit Error(HWApplication::translate("server", lst[1].toAscii().constData())); |
298 |
++ emit Error(HWApplication::translate("server", lst[1].toLatin1().constData())); |
299 |
+ else |
300 |
+ emit Error("Unknown error"); |
301 |
+ return; |
302 |
+@@ -280,7 +280,7 @@ |
303 |
+ if (lst[0] == "WARNING") |
304 |
+ { |
305 |
+ if (lst.size() == 2) |
306 |
+- emit Warning(HWApplication::translate("server", lst[1].toAscii().constData())); |
307 |
++ emit Warning(HWApplication::translate("server", lst[1].toLatin1().constData())); |
308 |
+ else |
309 |
+ emit Warning("Unknown warning"); |
310 |
+ return; |
311 |
+@@ -447,7 +447,7 @@ |
312 |
+ while(flags.size() > 1) |
313 |
+ { |
314 |
+ flags.remove(0, 1); |
315 |
+- char c = flags[0].toAscii(); |
316 |
++ char c = flags[0].toLatin1(); |
317 |
+ bool inRoom = (netClientState == InRoom || netClientState == InGame); |
318 |
+ |
319 |
+ switch(c) |
320 |
+@@ -673,7 +673,7 @@ |
321 |
+ } |
322 |
+ m_game_connected = false; |
323 |
+ Disconnect(); |
324 |
+- emit disconnected(HWApplication::translate("server", lst[1].toAscii().constData())); |
325 |
++ emit disconnected(HWApplication::translate("server", lst[1].toLatin1().constData())); |
326 |
+ return; |
327 |
+ } |
328 |
+ |
329 |
+@@ -727,7 +727,7 @@ |
330 |
+ } |
331 |
+ for(int i = 1; i < lst.size(); ++i) |
332 |
+ { |
333 |
+- QByteArray em = QByteArray::fromBase64(lst[i].toAscii()); |
334 |
++ QByteArray em = QByteArray::fromBase64(lst[i].toLatin1()); |
335 |
+ emit FromNet(em); |
336 |
+ } |
337 |
+ return; |
338 |
+@@ -1155,18 +1155,18 @@ |
339 |
+ return; |
340 |
+ |
341 |
+ QString hash = QCryptographicHash::hash( |
342 |
+- m_clientSalt.toAscii() |
343 |
+- .append(m_serverSalt.toAscii()) |
344 |
++ m_clientSalt.toLatin1() |
345 |
++ .append(m_serverSalt.toLatin1()) |
346 |
+ .append(m_passwordHash) |
347 |
+- .append(cProtoVer->toAscii()) |
348 |
++ .append(cProtoVer->toLatin1()) |
349 |
+ .append("!hedgewars") |
350 |
+ , QCryptographicHash::Sha1).toHex(); |
351 |
+ |
352 |
+ m_serverHash = QCryptographicHash::hash( |
353 |
+- m_serverSalt.toAscii() |
354 |
+- .append(m_clientSalt.toAscii()) |
355 |
++ m_serverSalt.toLatin1() |
356 |
++ .append(m_clientSalt.toLatin1()) |
357 |
+ .append(m_passwordHash) |
358 |
+- .append(cProtoVer->toAscii()) |
359 |
++ .append(cProtoVer->toLatin1()) |
360 |
+ .append("!hedgewars") |
361 |
+ , QCryptographicHash::Sha1).toHex(); |
362 |
+ |
363 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/net/proto.h |
364 |
+--- a/QTfrontend/net/proto.h Wed Jan 24 21:05:34 2018 +0100 |
365 |
++++ b/QTfrontend/net/proto.h Wed Jan 24 22:20:10 2018 +0100 |
366 |
+@@ -22,7 +22,7 @@ |
367 |
+ #include <QByteArray> |
368 |
+ #include <QString> |
369 |
+ #include <QStringList> |
370 |
+- |
371 |
++#include <QObject> |
372 |
+ |
373 |
+ class HWProto : public QObject |
374 |
+ { |
375 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/dialog/upload_video.cpp |
376 |
+--- a/QTfrontend/ui/dialog/upload_video.cpp Wed Jan 24 21:05:34 2018 +0100 |
377 |
++++ b/QTfrontend/ui/dialog/upload_video.cpp Wed Jan 24 22:20:10 2018 +0100 |
378 |
+@@ -38,7 +38,7 @@ |
379 |
+ |
380 |
+ // User-agent string used in http requests. |
381 |
+ // Don't make it a global varibale - crash on linux because of cVersionString |
382 |
+-#define USER_AGENT ("Hedgewars-QtFrontend/" + *cVersionString).toAscii() |
383 |
++#define USER_AGENT ("Hedgewars-QtFrontend/" + *cVersionString).toLatin1() |
384 |
+ |
385 |
+ // This is developer key obtained from http://code.google.com/apis/youtube/dashboard/ |
386 |
+ // If you are reusing this code outside Hedgewars, don't use this developer key, |
387 |
+@@ -193,7 +193,7 @@ |
388 |
+ |
389 |
+ QString account(QUrl::toPercentEncoding(leAccount->text())); |
390 |
+ QString pass(QUrl::toPercentEncoding(lePassword->text())); |
391 |
+- QByteArray data = QString("Email=%1&Passwd=%2&service=youtube&source=Hedgewars").arg(account).arg(pass).toAscii(); |
392 |
++ QByteArray data = QString("Email=%1&Passwd=%2&service=youtube&source=Hedgewars").arg(account).arg(pass).toUtf8(); |
393 |
+ |
394 |
+ QNetworkReply *reply = netManager->post(request, data); |
395 |
+ connect(reply, SIGNAL(finished()), this, SLOT(authFinished())); |
396 |
+@@ -246,7 +246,7 @@ |
397 |
+ return; |
398 |
+ } |
399 |
+ |
400 |
+- QByteArray auth = ("GoogleLogin auth=" + authToken).toAscii(); |
401 |
++ QByteArray auth = ("GoogleLogin auth=" + authToken).toLatin1(); |
402 |
+ |
403 |
+ // We have authenticated, now we can send metadata and start upload |
404 |
+ // Documentation is here: https://developers.google.com/youtube/2.0/developers_guide_protocol_resumable_uploads#Resumable_uploads |
405 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/page/pageadmin.cpp |
406 |
+--- a/QTfrontend/ui/page/pageadmin.cpp Wed Jan 24 21:05:34 2018 +0100 |
407 |
++++ b/QTfrontend/ui/page/pageadmin.cpp Wed Jan 24 22:20:10 2018 +0100 |
408 |
+@@ -98,7 +98,7 @@ |
409 |
+ << tr("Expiration") |
410 |
+ << tr("Reason") |
411 |
+ ); |
412 |
+- twBans->horizontalHeader()->setResizeMode(2, QHeaderView::Stretch); |
413 |
++ twBans->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch); |
414 |
+ twBans->setEditTriggers(QAbstractItemView::NoEditTriggers); |
415 |
+ twBans->setSelectionBehavior(QAbstractItemView::SelectRows); |
416 |
+ twBans->setSelectionMode(QAbstractItemView::SingleSelection); |
417 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/page/pagenet.cpp |
418 |
+--- a/QTfrontend/ui/page/pagenet.cpp Wed Jan 24 21:05:34 2018 +0100 |
419 |
++++ b/QTfrontend/ui/page/pagenet.cpp Wed Jan 24 22:20:10 2018 +0100 |
420 |
+@@ -99,7 +99,7 @@ |
421 |
+ { |
422 |
+ tvServersList->setModel(new HWNetUdpModel(tvServersList)); |
423 |
+ |
424 |
+- tvServersList->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); |
425 |
++ tvServersList->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); |
426 |
+ |
427 |
+ static_cast<HWNetServersModel *>(tvServersList->model())->updateList(); |
428 |
+ |
429 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/page/pageroomslist.cpp |
430 |
+--- a/QTfrontend/ui/page/pageroomslist.cpp Wed Jan 24 21:05:34 2018 +0100 |
431 |
++++ b/QTfrontend/ui/page/pageroomslist.cpp Wed Jan 24 22:20:10 2018 +0100 |
432 |
+@@ -154,7 +154,7 @@ |
433 |
+ roomsList = new RoomTableView(this); |
434 |
+ roomsList->setSelectionBehavior(QAbstractItemView::SelectRows); |
435 |
+ roomsList->verticalHeader()->setVisible(false); |
436 |
+- roomsList->horizontalHeader()->setResizeMode(QHeaderView::Interactive); |
437 |
++ roomsList->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive); |
438 |
+ roomsList->setAlternatingRowColors(true); |
439 |
+ roomsList->setShowGrid(false); |
440 |
+ roomsList->setSelectionMode(QAbstractItemView::SingleSelection); |
441 |
+@@ -587,7 +587,7 @@ |
442 |
+ |
443 |
+ h->setSortIndicatorShown(true); |
444 |
+ h->setSortIndicator(RoomsListModel::StateColumn, Qt::AscendingOrder); |
445 |
+- h->setResizeMode(RoomsListModel::NameColumn, QHeaderView::Stretch); |
446 |
++ h->setSectionResizeMode(RoomsListModel::NameColumn, QHeaderView::Stretch); |
447 |
+ |
448 |
+ if (!restoreHeaderState()) |
449 |
+ { |
450 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/page/pagevideos.cpp |
451 |
+--- a/QTfrontend/ui/page/pagevideos.cpp Wed Jan 24 21:05:34 2018 +0100 |
452 |
++++ b/QTfrontend/ui/page/pagevideos.cpp Wed Jan 24 22:20:10 2018 +0100 |
453 |
+@@ -133,8 +133,8 @@ |
454 |
+ filesTable->setMinimumWidth(400); |
455 |
+ |
456 |
+ QHeaderView * header = filesTable->horizontalHeader(); |
457 |
+- header->setResizeMode(vcName, QHeaderView::ResizeToContents); |
458 |
+- header->setResizeMode(vcSize, QHeaderView::Fixed); |
459 |
++ header->setSectionResizeMode(vcName, QHeaderView::ResizeToContents); |
460 |
++ header->setSectionResizeMode(vcSize, QHeaderView::Fixed); |
461 |
+ header->resizeSection(vcSize, 100); |
462 |
+ header->setStretchLastSection(true); |
463 |
+ |
464 |
+@@ -851,7 +851,7 @@ |
465 |
+ |
466 |
+ static QString unprotectPass(QString str) |
467 |
+ { |
468 |
+- QByteArray array = QByteArray::fromBase64(str.toAscii()); |
469 |
++ QByteArray array = QByteArray::fromBase64(str.toLatin1()); |
470 |
+ for (int i = 0; i < array.size(); i++) |
471 |
+ array[i] = array[i] ^ 0xC4 ^ i; |
472 |
+ return QString::fromUtf8(array); |
473 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/widget/about.cpp |
474 |
+--- a/QTfrontend/ui/widget/about.cpp Wed Jan 24 21:05:34 2018 +0100 |
475 |
++++ b/QTfrontend/ui/widget/about.cpp Wed Jan 24 22:20:10 2018 +0100 |
476 |
+@@ -26,6 +26,7 @@ |
477 |
+ #include <QMessageBox> |
478 |
+ #include <QNetworkReply> |
479 |
+ #include <QDebug> |
480 |
++#include <QMimeData> |
481 |
+ #include "hwconsts.h" |
482 |
+ #include "SDLInteraction.h" |
483 |
+ #include "SDL.h" |
484 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/widget/chatwidget.cpp |
485 |
+--- a/QTfrontend/ui/widget/chatwidget.cpp Wed Jan 24 21:05:34 2018 +0100 |
486 |
++++ b/QTfrontend/ui/widget/chatwidget.cpp Wed Jan 24 22:20:10 2018 +0100 |
487 |
+@@ -32,6 +32,7 @@ |
488 |
+ #include <QSortFilterProxyModel> |
489 |
+ #include <QMenu> |
490 |
+ #include <QScrollBar> |
491 |
++#include <QMimeData> |
492 |
+ |
493 |
+ #include "DataManager.h" |
494 |
+ #include "hwconsts.h" |
495 |
+@@ -312,7 +313,7 @@ |
496 |
+ else if (link.scheme() == "hwnick") |
497 |
+ { |
498 |
+ // decode nick |
499 |
+- QString nick = QString::fromUtf8(QByteArray::fromBase64(link.encodedQuery())); |
500 |
++ QString nick = QString::fromUtf8(QByteArray::fromBase64(link.query(QUrl::FullyDecoded).toLatin1())); |
501 |
+ QModelIndexList mil = chatNicks->model()->match(chatNicks->model()->index(0, 0), Qt::DisplayRole, nick); |
502 |
+ |
503 |
+ bool isOffline = (mil.size() < 1); |
504 |
+@@ -374,10 +375,10 @@ |
505 |
+ { |
506 |
+ if (nickname != m_userNick) |
507 |
+ return QString("<a href=\"hwnick://?%1\" class=\"nick\">%2</a>").arg( |
508 |
+- QString(nickname.toUtf8().toBase64())).arg(Qt::escape(nickname)); |
509 |
++ QString(nickname.toUtf8().toBase64())).arg(nickname.toHtmlEscaped()); |
510 |
+ |
511 |
+ // unlinked nick (if own one) |
512 |
+- return QString("<span class=\"nick\">%1</span>").arg(Qt::escape(nickname)); |
513 |
++ return QString("<span class=\"nick\">%1</span>").arg(nickname.toHtmlEscaped()); |
514 |
+ } |
515 |
+ |
516 |
+ const QRegExp HWChatWidget::URLREGEXP = QRegExp("(http(s)?://)?(www\\.)?((([^/:?&#]+\\.)?hedgewars\\.org|code\\.google\\.com|googlecode\\.com|hh\\.unit22\\.org)(/[^ ]*)?)"); |
517 |
+@@ -399,7 +400,7 @@ |
518 |
+ |
519 |
+ QString HWChatWidget::messageToHTML(const QString & message) |
520 |
+ { |
521 |
+- QString formattedStr = Qt::escape(message); |
522 |
++ QString formattedStr = message.toHtmlEscaped(); |
523 |
+ // link some urls |
524 |
+ formattedStr = formattedStr.replace(URLREGEXP, "<a href=\"http\\2://\\4\">\\4</a>"); |
525 |
+ return formattedStr; |
526 |
+@@ -606,9 +607,9 @@ |
527 |
+ { |
528 |
+ addLine("msg_PlayerInfo", QString(" >>> %1 - <span class=\"ipaddress\">%2</span> <span class=\"version\">%3</span> <span class=\"location\">%4</span>") |
529 |
+ .arg(linkedNick(nick)) |
530 |
+- .arg(Qt::escape(ip == "[]"?"":ip)) |
531 |
+- .arg(Qt::escape(version)) |
532 |
+- .arg(Qt::escape(roomInfo)) |
533 |
++ .arg(QString(ip == "[]"?"":ip).toHtmlEscaped()) |
534 |
++ .arg(version.toHtmlEscaped()) |
535 |
++ .arg(roomInfo.toHtmlEscaped()) |
536 |
+ ); |
537 |
+ } |
538 |
+ |
539 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/widget/feedbackdialog.cpp |
540 |
+--- a/QTfrontend/ui/widget/feedbackdialog.cpp Wed Jan 24 21:05:34 2018 +0100 |
541 |
++++ b/QTfrontend/ui/widget/feedbackdialog.cpp Wed Jan 24 22:20:10 2018 +0100 |
542 |
+@@ -20,7 +20,7 @@ |
543 |
+ #include <QLineEdit> |
544 |
+ #include <QTextBrowser> |
545 |
+ #include <QLabel> |
546 |
+-#include <QHttp> |
547 |
++#include <QNetworkAccessManager> |
548 |
+ #include <QSysInfo> |
549 |
+ #include <QDebug> |
550 |
+ #include <QBuffer> |
551 |
+@@ -474,7 +474,7 @@ |
552 |
+ this, SLOT(finishedSlot(QNetworkReply*))); |
553 |
+ |
554 |
+ QNetworkRequest header(QUrl("https://hedgewars.org/feedback/?submit")); |
555 |
+- header.setRawHeader("Content-Length", QString::number(body.size()).toAscii()); |
556 |
++ header.setRawHeader("Content-Length", QString::number(body.size()).toLatin1()); |
557 |
+ header.setRawHeader("Content-Type", "application/x-www-form-urlencoded"); |
558 |
+ |
559 |
+ nam->post(header, body); |
560 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/widget/keybinder.cpp |
561 |
+--- a/QTfrontend/ui/widget/keybinder.cpp Wed Jan 24 21:05:34 2018 +0100 |
562 |
++++ b/QTfrontend/ui/widget/keybinder.cpp Wed Jan 24 22:20:10 2018 +0100 |
563 |
+@@ -154,7 +154,7 @@ |
564 |
+ curTable = new QTableWidget(0, 2); |
565 |
+ curTable->verticalHeader()->setVisible(false); |
566 |
+ curTable->horizontalHeader()->setVisible(false); |
567 |
+- curTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch); |
568 |
++ curTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); |
569 |
+ curTable->verticalHeader()->setDefaultSectionSize(rowHeight); |
570 |
+ curTable->setShowGrid(false); |
571 |
+ curTable->setStyleSheet("QTableWidget { border: none; } "); |
572 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/ui/widget/mapContainer.cpp |
573 |
+--- a/QTfrontend/ui/widget/mapContainer.cpp Wed Jan 24 21:05:34 2018 +0100 |
574 |
++++ b/QTfrontend/ui/widget/mapContainer.cpp Wed Jan 24 22:20:10 2018 +0100 |
575 |
+@@ -984,7 +984,7 @@ |
576 |
+ { |
577 |
+ m_theme = selectedTheme = current.data(ThemeModel::ActualNameRole).toString(); |
578 |
+ m_themeID = current.row(); |
579 |
+- QIcon icon = qVariantValue<QIcon>(current.data(Qt::DecorationRole)); |
580 |
++ QIcon icon = current.data(Qt::DecorationRole).value<QIcon>(); |
581 |
+ //QSize iconSize = icon.actualSize(QSize(65535, 65535)); |
582 |
+ //btnTheme->setFixedHeight(64); |
583 |
+ //btnTheme->setIconSize(iconSize); |
584 |
+diff -r 8869b5256720 -r fc47fc4af6bd QTfrontend/util/FileEngine.h |
585 |
+--- a/QTfrontend/util/FileEngine.h Wed Jan 24 21:05:34 2018 +0100 |
586 |
++++ b/QTfrontend/util/FileEngine.h Wed Jan 24 22:20:10 2018 +0100 |
587 |
+@@ -1,9 +1,7 @@ |
588 |
+ #ifndef _FileEngine_h |
589 |
+ #define _FileEngine_h |
590 |
+ |
591 |
+-#include <QAbstractFileEngine> |
592 |
+-#include <QAbstractFileEngineHandler> |
593 |
+-#include <QAbstractFileEngineIterator> |
594 |
++#include <private/qabstractfileengine_p.h> |
595 |
+ #include <QDateTime> |
596 |
+ |
597 |
+ #include "physfs.h" |
598 |
+ |
599 |
|
600 |
diff --git a/games-strategy/hedgewars/hedgewars-0.9.23-r1.ebuild b/games-strategy/hedgewars/hedgewars-0.9.23-r1.ebuild |
601 |
new file mode 100644 |
602 |
index 00000000000..59115e25924 |
603 |
--- /dev/null |
604 |
+++ b/games-strategy/hedgewars/hedgewars-0.9.23-r1.ebuild |
605 |
@@ -0,0 +1,92 @@ |
606 |
+# Copyright 1999-2018 Gentoo Foundation |
607 |
+# Distributed under the terms of the GNU General Public License v2 |
608 |
+ |
609 |
+EAPI=6 |
610 |
+ |
611 |
+CMAKE_MAKEFILE_GENERATOR=emake |
612 |
+inherit cmake-utils desktop xdg-utils |
613 |
+ |
614 |
+MY_P=${PN}-src-${PV} |
615 |
+DEB_PATCH_VER=7 |
616 |
+ |
617 |
+DESCRIPTION="A turn-based strategy, artillery, action and comedy game" |
618 |
+HOMEPAGE="https://www.hedgewars.org/" |
619 |
+SRC_URI="https://www.hedgewars.org/download/releases/${MY_P}.tar.bz2 |
620 |
+ mirror://debian/pool/main/h/${PN}/${PN}_0.9.22-dfsg-${DEB_PATCH_VER}.debian.tar.xz" |
621 |
+ |
622 |
+LICENSE="GPL-2 Apache-2.0 FDL-1.3" |
623 |
+SLOT="0" |
624 |
+KEYWORDS="~amd64 ~x86" |
625 |
+IUSE="libav" |
626 |
+ |
627 |
+QA_FLAGS_IGNORED="/usr/bin/hwengine" # pascal sucks |
628 |
+QA_PRESTRIPPED="/usr/bin/hwengine" # pascal sucks |
629 |
+ |
630 |
+# qtcore:5= - depends on private header |
631 |
+CDEPEND=" |
632 |
+ >=dev-games/physfs-3.0.1 |
633 |
+ dev-lang/lua:0= |
634 |
+ dev-qt/qtcore:5= |
635 |
+ dev-qt/qtgui:5 |
636 |
+ dev-qt/qtnetwork:5 |
637 |
+ dev-qt/qtwidgets:5 |
638 |
+ media-libs/libpng:0= |
639 |
+ media-libs/libsdl2:= |
640 |
+ media-libs/sdl2-image:= |
641 |
+ media-libs/sdl2-mixer:= |
642 |
+ media-libs/sdl2-net:= |
643 |
+ media-libs/sdl2-ttf:= |
644 |
+ sys-libs/zlib:= |
645 |
+ libav? ( media-video/libav:= ) |
646 |
+ !libav? ( media-video/ffmpeg:= )" |
647 |
+DEPEND="${CDEPEND} |
648 |
+ >=dev-lang/fpc-2.4" |
649 |
+RDEPEND="${CDEPEND} |
650 |
+ app-arch/xz-utils |
651 |
+ >=media-fonts/dejavu-2.28 |
652 |
+ media-fonts/wqy-zenhei" |
653 |
+ |
654 |
+S="${WORKDIR}"/${MY_P} |
655 |
+ |
656 |
+PATCHES=( |
657 |
+ "${FILESDIR}"/${PN}-0.9.22-rpath-fix.patch |
658 |
+ "${FILESDIR}"/${P}-qt5-{1,2}.patch # bug 645504 |
659 |
+) |
660 |
+ |
661 |
+src_configure() { |
662 |
+ local mycmakeargs=( |
663 |
+ -DMINIMAL_FLAGS=ON |
664 |
+ -DDATA_INSTALL_DIR="${EPREFIX}/usr/share/${PN}" |
665 |
+ -Dtarget_binary_install_dir="${EPREFIX}/usr/bin" |
666 |
+ -Dtarget_library_install_dir="${EPREFIX}/usr/$(get_libdir)" |
667 |
+ -DNOSERVER=TRUE |
668 |
+ -DCMAKE_VERBOSE_MAKEFILE=TRUE |
669 |
+ -DPHYSFS_SYSTEM=ON |
670 |
+ # Need to tell the build system where the fonts are located |
671 |
+ # as it uses PhysFS' symbolic link protection mode which |
672 |
+ # prevents us from symlinking the fonts into the right directory |
673 |
+ # https://hg.hedgewars.org/hedgewars/rev/76ad55807c24 |
674 |
+ # https://icculus.org/physfs/docs/html/physfs_8h.html#aad451d9b3f46f627a1be8caee2eef9b7 |
675 |
+ -DFONTS_DIRS="${EPREFIX}/usr/share/fonts/wqy-zenhei;${EPREFIX}/usr/share/fonts/dejavu" |
676 |
+ # upstream sets RPATH that leads to weird breakage |
677 |
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1200193 |
678 |
+ -DCMAKE_SKIP_RPATH=ON |
679 |
+ ) |
680 |
+ cmake-utils_src_configure |
681 |
+} |
682 |
+ |
683 |
+src_install() { |
684 |
+ cmake-utils_src_install |
685 |
+ |
686 |
+ doicon misc/hedgewars.png |
687 |
+ make_desktop_entry ${PN} Hedgewars |
688 |
+ doman man/${PN}.6 |
689 |
+} |
690 |
+ |
691 |
+pkg_postinst() { |
692 |
+ xdg_desktop_database_update |
693 |
+} |
694 |
+ |
695 |
+pkg_postrm() { |
696 |
+ xdg_desktop_database_update |
697 |
+} |