1 |
commit: 4338fbe801992804b4bf84e14500ead09d810182 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Feb 28 14:14:18 2019 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 28 14:14:18 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=4338fbe8 |
7 |
|
8 |
dev-qt/qtquickcontrols: Fix div by zero |
9 |
|
10 |
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=403978#c21 |
11 |
Qt-Bug: https://bugreports.qt.io/browse/QTBUG-73691 |
12 |
See also: https://codereview.qt-project.org/#/c/254226/ |
13 |
|
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
16 |
|
17 |
...ntrols-5.12.1-scrollviewstyle-div-by-zero.patch | 34 ++++++++++++++++++++++ |
18 |
.../qtquickcontrols-5.12.1-r1.ebuild | 34 ++++++++++++++++++++++ |
19 |
2 files changed, 68 insertions(+) |
20 |
|
21 |
diff --git a/dev-qt/qtquickcontrols/files/qtquickcontrols-5.12.1-scrollviewstyle-div-by-zero.patch b/dev-qt/qtquickcontrols/files/qtquickcontrols-5.12.1-scrollviewstyle-div-by-zero.patch |
22 |
new file mode 100644 |
23 |
index 00000000..b58f26ac |
24 |
--- /dev/null |
25 |
+++ b/dev-qt/qtquickcontrols/files/qtquickcontrols-5.12.1-scrollviewstyle-div-by-zero.patch |
26 |
@@ -0,0 +1,34 @@ |
27 |
+From c231395eec3494619f4977b4c5cd845b9d7341ae Mon Sep 17 00:00:00 2001 |
28 |
+From: Benjamin Robin <dev@××××××××××.fr> |
29 |
+Date: Sun, 24 Feb 2019 10:28:14 +0100 |
30 |
+Subject: [PATCH] ScrollViewStyle: Avoid division by zero in extent computation |
31 |
+ |
32 |
+If the flickableItem content is empty (contentWidth / contentHeight is |
33 |
+equal to 0), prevent the division by zero in the computation of the |
34 |
+extent variable. |
35 |
+ |
36 |
+Task-number: QTBUG-73691 |
37 |
+Change-Id: I86becca9a1fa2508d1acafe09f46dfc952e4e96d |
38 |
+Reviewed-by: Mitch Curtis <mitch.curtis@××.io> |
39 |
+--- |
40 |
+ src/controls/Styles/Base/ScrollViewStyle.qml | 4 ++-- |
41 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
42 |
+ |
43 |
+diff --git a/src/controls/Styles/Base/ScrollViewStyle.qml b/src/controls/Styles/Base/ScrollViewStyle.qml |
44 |
+index 6750399d4..36b518d39 100644 |
45 |
+--- a/src/controls/Styles/Base/ScrollViewStyle.qml |
46 |
++++ b/src/controls/Styles/Base/ScrollViewStyle.qml |
47 |
+@@ -370,8 +370,8 @@ Style { |
48 |
+ |
49 |
+ property var flickableItem: control.flickableItem |
50 |
+ property int extent: Math.max(minimumHandleLength, __styleData.horizontal ? |
51 |
+- Math.min(1, (flickableItem ? flickableItem.width/flickableItem.contentWidth : 1)) * bg.width : |
52 |
+- Math.min(1, (flickableItem ? flickableItem.height/flickableItem.contentHeight : 1)) * bg.height) |
53 |
++ Math.min(1, ((flickableItem && flickableItem.contentWidth > 0.0) ? flickableItem.width/flickableItem.contentWidth : 1)) * bg.width : |
54 |
++ Math.min(1, ((flickableItem && flickableItem.contentHeight > 0.0) ? flickableItem.height/flickableItem.contentHeight : 1)) * bg.height) |
55 |
+ readonly property real range: __control.maximumValue - __control.minimumValue |
56 |
+ readonly property real begin: __control.value - __control.minimumValue |
57 |
+ |
58 |
+-- |
59 |
+2.16.3 |
60 |
+ |
61 |
|
62 |
diff --git a/dev-qt/qtquickcontrols/qtquickcontrols-5.12.1-r1.ebuild b/dev-qt/qtquickcontrols/qtquickcontrols-5.12.1-r1.ebuild |
63 |
new file mode 100644 |
64 |
index 00000000..a2971f97 |
65 |
--- /dev/null |
66 |
+++ b/dev-qt/qtquickcontrols/qtquickcontrols-5.12.1-r1.ebuild |
67 |
@@ -0,0 +1,34 @@ |
68 |
+# Copyright 1999-2019 Gentoo Authors |
69 |
+# Distributed under the terms of the GNU General Public License v2 |
70 |
+ |
71 |
+EAPI=6 |
72 |
+inherit qt5-build |
73 |
+ |
74 |
+DESCRIPTION="Set of Qt Quick controls to create complete user interfaces (deprecated)" |
75 |
+ |
76 |
+if [[ ${QT5_BUILD_TYPE} == release ]]; then |
77 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86" |
78 |
+fi |
79 |
+ |
80 |
+IUSE="+widgets" |
81 |
+ |
82 |
+DEPEND=" |
83 |
+ ~dev-qt/qtcore-${PV} |
84 |
+ ~dev-qt/qtdeclarative-${PV} |
85 |
+ ~dev-qt/qtgui-${PV} |
86 |
+ widgets? ( ~dev-qt/qtwidgets-${PV} ) |
87 |
+" |
88 |
+RDEPEND="${DEPEND}" |
89 |
+ |
90 |
+PATCHES=( "${FILESDIR}/${P}-scrollviewstyle-div-by-zero.patch" ) |
91 |
+ |
92 |
+src_prepare() { |
93 |
+ qt_use_disable_mod widgets widgets \ |
94 |
+ src/src.pro \ |
95 |
+ src/controls/Private/private.pri \ |
96 |
+ tests/auto/activeFocusOnTab/activeFocusOnTab.pro \ |
97 |
+ tests/auto/controls/controls.pro \ |
98 |
+ tests/auto/testplugin/testplugin.pro |
99 |
+ |
100 |
+ qt5-build_src_prepare |
101 |
+} |