Merge lp:~aacid/ubuntu-ui-toolkit/removeTimeConstraintsFromSwipeArea into lp:ubuntu-ui-toolkit/staging

Proposed by Albert Astals Cid on 2015-12-17
Status: Merged
Approved by: Zsombor Egri on 2015-12-18
Approved revision: 1783
Merged at revision: 1784
Proposed branch: lp:~aacid/ubuntu-ui-toolkit/removeTimeConstraintsFromSwipeArea
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 400 lines (+70/-31)
19 files modified
components.api (+1/-0)
debian/control (+9/-0)
debian/libubuntugestures5-private-dev.install (+3/-0)
src/Ubuntu/Components/plugin/plugin.cpp (+3/-1)
src/Ubuntu/Components/plugin/plugin.pri (+1/-4)
src/Ubuntu/Components/plugin/ucbottomedge.cpp (+1/-1)
src/Ubuntu/Components/plugin/ucbottomedgehint.cpp (+1/-1)
src/Ubuntu/Test/plugin/plugin.pri (+2/-1)
src/Ubuntu/Test/plugin/uctestextras.cpp (+18/-0)
src/Ubuntu/Test/plugin/uctestextras.h (+2/-0)
src/Ubuntu/UbuntuGestures/UbuntuGestures.pro (+6/-0)
src/Ubuntu/UbuntuGestures/damper.cpp (+1/-1)
src/Ubuntu/UbuntuGestures/ucswipearea.cpp (+8/-8)
src/Ubuntu/UbuntuGestures/ucswipearea_p.h (+2/-3)
src/Ubuntu/UbuntuGestures/ucswipearea_p_p.h (+7/-6)
tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp (+1/-1)
tests/unit_x11/tst_bottomedge/tst_bottomedge.pro (+1/-1)
tests/unit_x11/tst_swipearea/tst_swipearea.cpp (+2/-2)
tests/unit_x11/tst_swipearea/tst_swipearea.pro (+1/-1)
To merge this branch: bzr merge lp:~aacid/ubuntu-ui-toolkit/removeTimeConstraintsFromSwipeArea
Reviewer Review Type Date Requested Status
Zsombor Egri (community) 2015-12-17 Approve on 2015-12-18
PS Jenkins bot continuous-integration Approve on 2015-12-18
Review via email: mp+280868@code.launchpad.net

Commit Message

Add UCTestExtras::removeTimeConstraintsFromSwipeArea

For that needed to move ucswipearea.cpp from UbuntuComponents to UbuntuGestures but made it in a private header so we don't have to care much for the API/ABI stability for now

To post a comment you must log in.
1782. By Albert Astals Cid on 2015-12-17

eof

Zsombor Egri (zsombi) wrote :

Please update API file too.

review: Needs Fixing
Albert Astals Cid (aacid) wrote :

> Please update API file too.

Done

1783. By Albert Astals Cid on 2015-12-18

Add removeTimeConstraintsFromSwipeArea

Zsombor Egri (zsombi) wrote :

Nice move, thank you! We will follow your example and move some more into private package to share code between different toolkit modules.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2015-12-17 13:48:23 +0000
3+++ components.api 2015-12-18 08:36:43 +0000
4@@ -1205,6 +1205,7 @@
5 function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button, Qt.KeyboardModifiers stateKey, int steps)
6 function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button, Qt.KeyboardModifiers stateKey)
7 function mouseDrag(Item item, Qt.point from, Qt.point delta, Qt.MouseButton button)
8+ function removeTimeConstraintsFromSwipeArea(Item item)
9 readonly property bool touchPresent
10 Ubuntu.Components.TextArea 1.0 0.1: StyledItem
11 property bool autoExpand
12
13=== modified file 'debian/control'
14--- debian/control 2015-12-16 09:55:02 +0000
15+++ debian/control 2015-12-18 08:36:43 +0000
16@@ -107,6 +107,15 @@
17 This package contains the development files for
18 Ubuntu gestures library with SwipeArea
19
20+Package: libubuntugestures5-private-dev
21+Architecture: any
22+Multi-Arch: same
23+Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends}
24+Depends: ${misc:Depends},
25+ ${shlibs:Depends},
26+Description: Ubuntu gestures library private development files
27+ This package contains the private development files for
28+ Ubuntu gestures library with SwipeArea
29
30
31 Package: ubuntu-ui-toolkit-theme
32
33=== added file 'debian/libubuntugestures5-private-dev.install'
34--- debian/libubuntugestures5-private-dev.install 1970-01-01 00:00:00 +0000
35+++ debian/libubuntugestures5-private-dev.install 2015-12-18 08:36:43 +0000
36@@ -0,0 +1,3 @@
37+usr/include/*/qt5/UbuntuGestures/*/UbuntuGestures/private/ucswipearea_p.h
38+usr/include/*/qt5/UbuntuGestures/*/UbuntuGestures/private/ucswipearea_p_p.h
39+usr/include/*/qt5/UbuntuGestures/*/UbuntuGestures/private/damper_p.h
40
41=== modified file 'src/Ubuntu/Components/plugin/plugin.cpp'
42--- src/Ubuntu/Components/plugin/plugin.cpp 2015-12-08 10:54:31 +0000
43+++ src/Ubuntu/Components/plugin/plugin.cpp 2015-12-18 08:36:43 +0000
44@@ -71,13 +71,15 @@
45 #include "uclabel.h"
46 #include "uclistitemlayout.h"
47 #include "ucbottomedgehint.h"
48-#include "gestures/ucswipearea.h"
49 #include "ucmathutils.h"
50 #include "ucbottomedge.h"
51 #include "ucbottomedgeregion.h"
52 #include "ucbottomedgestyle.h"
53 #include "ucpagetreenode.h"
54
55+// From UbuntuGestures
56+#include "private/ucswipearea_p.h"
57+
58 #include <sys/types.h>
59 #include <unistd.h>
60 #include <stdexcept>
61
62=== modified file 'src/Ubuntu/Components/plugin/plugin.pri'
63--- src/Ubuntu/Components/plugin/plugin.pri 2015-12-15 15:58:54 +0000
64+++ src/Ubuntu/Components/plugin/plugin.pri 2015-12-18 08:36:43 +0000
65@@ -3,7 +3,7 @@
66 PKGCONFIG += gio-2.0 dbus-1 libnih-dbus
67 }
68
69-QT *= core-private qml qml-private quick quick-private gui-private dbus svg UbuntuGestures
70+QT *= core-private qml qml-private quick quick-private gui-private dbus svg UbuntuGestures UbuntuGestures_private
71
72 equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 2) {
73 QT += v8-private
74@@ -98,8 +98,6 @@
75 $$PWD/ucimportversionchecker_p.h \
76 $$PWD/ucbottomedgehint.h \
77 $$PWD/ucbottomedgehint_p.h \
78- $$PWD/gestures/ucswipearea.h \
79- $$PWD/gestures/ucswipearea_p.h \
80 $$PWD/gestures/damper.h \
81 $$PWD/gestures/ubuntugesturesqmlglobal.h \
82 $$PWD/ucmathutils.h \
83@@ -174,7 +172,6 @@
84 $$PWD/privates/threelabelsslot_p.cpp \
85 $$PWD/ucimportversionchecker_p.cpp \
86 $$PWD/ucbottomedgehint.cpp \
87- $$PWD/gestures/ucswipearea.cpp \
88 $$PWD/ucmathutils.cpp \
89 $$PWD/ucbottomedge.cpp \
90 $$PWD/ucbottomedgestyle.cpp \
91
92=== modified file 'src/Ubuntu/Components/plugin/ucbottomedge.cpp'
93--- src/Ubuntu/Components/plugin/ucbottomedge.cpp 2015-12-14 07:21:44 +0000
94+++ src/Ubuntu/Components/plugin/ucbottomedge.cpp 2015-12-18 08:36:43 +0000
95@@ -34,7 +34,7 @@
96 #include "ucheader.h"
97 #include "ucaction.h"
98 #include "quickutils.h"
99-#include "gestures/ucswipearea.h"
100+#include "private/ucswipearea_p.h"
101 #include <QtQuick/private/qquickanimation_p.h>
102
103 Q_LOGGING_CATEGORY(ucBottomEdge, "ubuntu.components.BottomEdge", QtMsgType::QtWarningMsg)
104
105=== modified file 'src/Ubuntu/Components/plugin/ucbottomedgehint.cpp'
106--- src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 2015-12-14 16:05:03 +0000
107+++ src/Ubuntu/Components/plugin/ucbottomedgehint.cpp 2015-12-18 08:36:43 +0000
108@@ -23,7 +23,7 @@
109 #include "ucnamespace.h"
110 #include "ucunits.h"
111 #include "ucaction.h"
112-#include "gestures/ucswipearea.h"
113+#include "private/ucswipearea_p.h"
114 #include "propertychange_p.h"
115 #include <QtQml/private/qqmlproperty_p.h>
116 #include <QtQuick/private/qquickflickable_p.h>
117
118=== modified file 'src/Ubuntu/Test/plugin/plugin.pri'
119--- src/Ubuntu/Test/plugin/plugin.pri 2015-10-21 08:33:21 +0000
120+++ src/Ubuntu/Test/plugin/plugin.pri 2015-12-18 08:36:43 +0000
121@@ -1,4 +1,4 @@
122-QT *= core-private qml qml-private quick quick-private gui-private testlib
123+QT *= core-private qml qml-private quick quick-private gui-private testlib UbuntuGestures
124
125 equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 2) {
126 QT *= v8-private
127@@ -7,6 +7,7 @@
128 CONFIG += no_keywords
129 DEFINES += UBUNTU_QML_IMPORT_PATH='\\"$${ROOT_BUILD_DIR}/qml\\"'
130 DEFINES += QT_USE_QSTRINGBUILDER
131+INCLUDEPATH += ../UbuntuGestures
132
133 TARGET = $$qtLibraryTarget($$TARGET)
134 uri = Ubuntu.Test
135
136=== modified file 'src/Ubuntu/Test/plugin/uctestextras.cpp'
137--- src/Ubuntu/Test/plugin/uctestextras.cpp 2015-11-25 07:44:10 +0000
138+++ src/Ubuntu/Test/plugin/uctestextras.cpp 2015-12-18 08:36:43 +0000
139@@ -17,7 +17,11 @@
140 #include "uctestextras.h"
141 #include "uctestcase.h"
142
143+#include "ucswipearea_p.h"
144+#include "ucswipearea_p_p.h"
145+
146 #include <qpa/qwindowsysteminterface.h>
147+#include <private/qobject_p.h>
148 #include <QSysInfo>
149
150 const char *DEVICE_MISSING_MSG = "No touch device registered. Register one using registerTouchDevice() before using %1";
151@@ -375,3 +379,17 @@
152 }
153 QTest::mouseRelease(item->window(), button, stateKey, movePoint, delay);
154 }
155+
156+
157+void UCTestExtras::removeTimeConstraintsFromSwipeArea(QQuickItem *item)
158+{
159+ UCSwipeArea *swipeArea = dynamic_cast<UCSwipeArea*>(item);
160+ if (!swipeArea) {
161+ qWarning() << item << "is not a SwipeArea";
162+ return;
163+ }
164+
165+ UCSwipeAreaPrivate *priv = static_cast<UCSwipeAreaPrivate *>(QObjectPrivate::get(swipeArea));
166+ priv->setMaxTime(60 * 60 * 1000);
167+ priv->setCompositionTime(0);
168+}
169
170=== modified file 'src/Ubuntu/Test/plugin/uctestextras.h'
171--- src/Ubuntu/Test/plugin/uctestextras.h 2015-11-24 15:23:02 +0000
172+++ src/Ubuntu/Test/plugin/uctestextras.h 2015-12-18 08:36:43 +0000
173@@ -46,6 +46,8 @@
174
175 static void mouseDrag(QQuickItem *item, const QPoint &from, const QPoint &delta, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, int steps = -1, int delay = -1);
176
177+ static void removeTimeConstraintsFromSwipeArea(QQuickItem *item);
178+
179 public: // yet for cpp use
180 static void touchDragWithPoints(int touchId, QQuickItem *item, QList<QPoint> points, int delay = -1);
181 static void mouseDragWithPoints(QQuickItem *item, QList<QPoint> points, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, int delay = -1);
182
183=== modified file 'src/Ubuntu/UbuntuGestures/UbuntuGestures.pro'
184--- src/Ubuntu/UbuntuGestures/UbuntuGestures.pro 2015-11-17 13:01:00 +0000
185+++ src/Ubuntu/UbuntuGestures/UbuntuGestures.pro 2015-12-18 08:36:43 +0000
186@@ -21,6 +21,10 @@
187 unownedtouchevent.h \
188 ubuntugesturesglobal.h \
189 pool.h \
190+ ucswipearea_p.h \
191+ ucswipearea_p_p.h \
192+ damper.h \
193+
194
195 SOURCES += candidateinactivitytimer.cpp \
196 debughelpers.cpp \
197@@ -29,3 +33,5 @@
198 touchownershipevent.cpp \
199 touchregistry.cpp \
200 unownedtouchevent.cpp \
201+ ucswipearea.cpp \
202+ damper.cpp \
203\ No newline at end of file
204
205=== renamed file 'src/Ubuntu/Components/plugin/gestures/damper.cpp' => 'src/Ubuntu/UbuntuGestures/damper.cpp'
206--- src/Ubuntu/Components/plugin/gestures/damper.cpp 2015-10-21 08:33:21 +0000
207+++ src/Ubuntu/UbuntuGestures/damper.cpp 2015-12-18 08:36:43 +0000
208@@ -14,7 +14,7 @@
209 * along with this program. If not, see <http://www.gnu.org/licenses/>.
210 */
211
212-#include "Damper.h"
213+#include "damper_p.h"
214 #include <QDebug>
215
216 QDebug operator<<(QDebug dbg, const DampedPointF &p)
217
218=== renamed file 'src/Ubuntu/Components/plugin/gestures/damper.h' => 'src/Ubuntu/UbuntuGestures/damper_p.h'
219=== renamed file 'src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp' => 'src/Ubuntu/UbuntuGestures/ucswipearea.cpp'
220--- src/Ubuntu/Components/plugin/gestures/ucswipearea.cpp 2015-12-16 09:52:31 +0000
221+++ src/Ubuntu/UbuntuGestures/ucswipearea.cpp 2015-12-18 08:36:43 +0000
222@@ -15,7 +15,7 @@
223 *
224 */
225
226-#include "ucswipearea_p.h"
227+#include "ucswipearea_p_p.h"
228
229 #include <QQuickWindow>
230 #include <QtCore/qmath.h>
231@@ -71,19 +71,19 @@
232
233 switch (ev->type()) {
234 case QEvent::TouchBegin:
235- message.append("TouchBegin ");
236+ message.append(QStringLiteral("TouchBegin "));
237 break;
238 case QEvent::TouchUpdate:
239- message.append("TouchUpdate ");
240+ message.append(QStringLiteral("TouchUpdate "));
241 break;
242 case QEvent::TouchEnd:
243- message.append("TouchEnd ");
244+ message.append(QStringLiteral("TouchEnd "));
245 break;
246 case QEvent::TouchCancel:
247- message.append("TouchCancel ");
248+ message.append(QStringLiteral("TouchCancel "));
249 break;
250 default:
251- message.append("INVALID_TOUCH_EVENT_TYPE ");
252+ message.append(QStringLiteral("INVALID_TOUCH_EVENT_TYPE "));
253 }
254
255 Q_FOREACH(const QTouchEvent::TouchPoint& touchPoint, ev->touchPoints()) {
256@@ -859,7 +859,7 @@
257
258 QString ActiveTouchesInfo::toString()
259 {
260- QString string = "(";
261+ QString string = QStringLiteral("(");
262
263 {
264 QTextStream stream(&string);
265@@ -869,7 +869,7 @@
266 });
267 }
268
269- string.append(")");
270+ string.append(QStringLiteral(")"));
271
272 return string;
273 }
274
275=== renamed file 'src/Ubuntu/Components/plugin/gestures/ucswipearea.h' => 'src/Ubuntu/UbuntuGestures/ucswipearea_p.h'
276--- src/Ubuntu/Components/plugin/gestures/ucswipearea.h 2015-12-10 08:03:24 +0000
277+++ src/Ubuntu/UbuntuGestures/ucswipearea_p.h 2015-12-18 08:36:43 +0000
278@@ -19,8 +19,7 @@
279 #define UCSWIPEAREA_H
280
281 #include <QtQuick/QQuickItem>
282-#include "ubuntugesturesqmlglobal.h"
283-#include "damper.h"
284+#include "ubuntugesturesglobal.h"
285
286 // lib UbuntuGestures
287 #include <UbuntuGestures/Pool>
288@@ -34,7 +33,7 @@
289 class UCSwipeAreaPrivate;
290
291 class UCSwipeAreaPrivate;
292-class UBUNTUGESTURESQML_EXPORT UCSwipeArea : public QQuickItem
293+class UBUNTUGESTURES_EXPORT UCSwipeArea : public QQuickItem
294 {
295 Q_OBJECT
296
297
298=== renamed file 'src/Ubuntu/Components/plugin/gestures/ucswipearea_p.h' => 'src/Ubuntu/UbuntuGestures/ucswipearea_p_p.h'
299--- src/Ubuntu/Components/plugin/gestures/ucswipearea_p.h 2015-12-16 09:52:31 +0000
300+++ src/Ubuntu/UbuntuGestures/ucswipearea_p_p.h 2015-12-18 08:36:43 +0000
301@@ -18,18 +18,20 @@
302 #ifndef UCSWIPEAREAPRIVATE_H
303 #define UCSWIPEAREAPRIVATE_H
304
305-#include "ucswipearea.h"
306+#include "ucswipearea_p.h"
307 #include <QtQuick/private/qquickitem_p.h>
308
309+#include "damper_p.h"
310+
311 // Information about an active touch point
312-struct UBUNTUGESTURESQML_EXPORT ActiveTouchInfo {
313+struct UBUNTUGESTURES_EXPORT ActiveTouchInfo {
314 ActiveTouchInfo() : id(-1), startTime(-1) {}
315 bool isValid() const { return id != -1; }
316 void reset() { id = -1; }
317 int id;
318 qint64 startTime;
319 };
320-class UBUNTUGESTURESQML_EXPORT ActiveTouchesInfo {
321+class UBUNTUGESTURES_EXPORT ActiveTouchesInfo {
322 public:
323 ActiveTouchesInfo(const UbuntuGestures::SharedTimeSource &timeSource);
324 void update(QTouchEvent *event);
325@@ -46,7 +48,7 @@
326 };
327
328 class UCSwipeAreaStatusListener;
329-class UBUNTUGESTURESQML_EXPORT UCSwipeAreaPrivate : public QQuickItemPrivate
330+class UBUNTUGESTURES_EXPORT UCSwipeAreaPrivate : public QQuickItemPrivate
331 {
332 Q_DECLARE_PUBLIC(UCSwipeArea)
333
334@@ -71,7 +73,6 @@
335 // Useful for testing, where a fake time source can be supplied
336 void setTimeSource(const UbuntuGestures::SharedTimeSource &timeSource);
337
338-public:
339 // Describes the state of the directional drag gesture.
340 enum Status {
341 // Waiting for a new touch point to land on this area. No gesture is being processed
342@@ -163,7 +164,7 @@
343 bool immediateRecognition;
344 };
345
346-class UBUNTUGESTURESQML_EXPORT UCSwipeAreaStatusListener
347+class UBUNTUGESTURES_EXPORT UCSwipeAreaStatusListener
348 {
349 public:
350 virtual void swipeStatusChanged(UCSwipeAreaPrivate::Status /*old*/, UCSwipeAreaPrivate::Status /*new*/) {}
351
352=== modified file 'tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp'
353--- tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp 2015-12-12 08:25:22 +0000
354+++ tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp 2015-12-18 08:36:43 +0000
355@@ -20,7 +20,7 @@
356 #include "ucbottomedgeregion.h"
357 #include "ucbottomedge_p.h"
358 #include "ucbottomedgehint.h"
359-#include "gestures/ucswipearea.h"
360+#include "private/ucswipearea_p.h"
361 #include "ucunits.h"
362 #include "ucheader.h"
363 #include "ucaction.h"
364
365=== modified file 'tests/unit_x11/tst_bottomedge/tst_bottomedge.pro'
366--- tests/unit_x11/tst_bottomedge/tst_bottomedge.pro 2015-12-12 08:25:22 +0000
367+++ tests/unit_x11/tst_bottomedge/tst_bottomedge.pro 2015-12-18 08:36:43 +0000
368@@ -1,5 +1,5 @@
369 include(../test-include.pri)
370-QT += core-private qml-private quick-private gui-private UbuntuGestures
371+QT += core-private qml-private quick-private gui-private UbuntuGestures UbuntuGestures_private
372
373 SOURCES += \
374 tst_bottomedge.cpp
375
376=== modified file 'tests/unit_x11/tst_swipearea/tst_swipearea.cpp'
377--- tests/unit_x11/tst_swipearea/tst_swipearea.cpp 2015-12-16 09:52:31 +0000
378+++ tests/unit_x11/tst_swipearea/tst_swipearea.cpp 2015-12-18 08:36:43 +0000
379@@ -23,8 +23,8 @@
380 #include <private/qquickmousearea_p.h>
381 #include <private/qquickwindow_p.h>
382
383-#include "gestures/ucswipearea.h"
384-#include "gestures/ucswipearea_p.h"
385+#include "private/ucswipearea_p.h"
386+#include "private/ucswipearea_p_p.h"
387 #define protected public
388 #define private public
389 #include <UbuntuGestures/TouchRegistry>
390
391=== modified file 'tests/unit_x11/tst_swipearea/tst_swipearea.pro'
392--- tests/unit_x11/tst_swipearea/tst_swipearea.pro 2015-11-06 14:05:07 +0000
393+++ tests/unit_x11/tst_swipearea/tst_swipearea.pro 2015-12-18 08:36:43 +0000
394@@ -1,5 +1,5 @@
395 include(../test-include.pri)
396-QT += core-private qml-private quick-private gui-private UbuntuGestures
397+QT += core-private qml-private quick-private gui-private UbuntuGestures UbuntuGestures_private
398 SOURCES += \
399 GestureTest.cpp \
400 tst_swipearea.cpp

Subscribers

People subscribed via source and target branches