Merge lp:~zsombi/unity8/u8GestureImports into lp:unity8

Proposed by Zsombor Egri
Status: Superseded
Proposed branch: lp:~zsombi/unity8/u8GestureImports
Merge into: lp:unity8
Diff against target: 486 lines (+76/-49)
19 files modified
debian/changelog (+6/-0)
debian/control (+6/-6)
plugins/Ubuntu/Gestures/AxisVelocityCalculator.cpp (+1/-1)
plugins/Ubuntu/Gestures/AxisVelocityCalculator.h (+4/-4)
plugins/Ubuntu/Gestures/CMakeLists.txt (+1/-0)
plugins/Ubuntu/Gestures/TouchGate.cpp (+6/-4)
plugins/Ubuntu/Gestures/TouchGate.h (+3/-2)
plugins/Ubuntu/Gestures/TouchGestureArea.cpp (+9/-7)
plugins/Ubuntu/Gestures/TouchGestureArea.h (+7/-6)
tests/plugins/Ubuntu/Gestures/CMakeLists.txt (+1/-0)
tests/plugins/Ubuntu/Gestures/GestureTest.cpp (+3/-3)
tests/plugins/Ubuntu/Gestures/GestureTest.h (+4/-5)
tests/plugins/Ubuntu/Gestures/tst_AxisVelocityCalculator.cpp (+1/-1)
tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.cpp (+1/-1)
tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp (+3/-1)
tests/qmltests/Components/tst_DragHandle.cpp (+2/-2)
tests/qmltests/Components/tst_EdgeDragEvaluator.cpp (+2/-2)
tests/utils/modules/Unity/Test/CMakeLists.txt (+1/-0)
tests/utils/modules/Unity/Test/testutil.cpp (+15/-4)
To merge this branch: bzr merge lp:~zsombi/unity8/u8GestureImports
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Daniel d'Andrada (community) code Approve
Review via email: mp+299304@code.launchpad.net

This proposal has been superseded by a proposal from 2016-07-22.

Commit message

Use private UbuntuGestures headers instead of fw-headers.

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
   - A new UbuntuGestures library build is required. Should be landed together with a new UITK landing. Silo019 has the build artifacts.

 * Did you perform an exploratory manual test run of your code change and any related functionality?
   - No, as the change only makes changes to build with the UITK changes made.

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
  - NA

 * If you changed the UI, has there been a design review?
  - NA

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2532
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1676/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2223/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2251
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2157
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2157
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2157
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2148/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2148/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2148/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2148/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2148/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2148/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2148/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2148/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2148/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1676/rebuild

review: Needs Fixing (continuous-integration)
lp:~zsombi/unity8/u8GestureImports updated
2535. By Zsombor Egri

be more precise on dep versions

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

"""
+UG_USE_NAMESPACE
85
86 AxisVelocityCalculator::AxisVelocityCalculator(QObject *parent)
87 - : AxisVelocityCalculator(SharedTimeSource(new RealTimeSource), parent)
88 + : AxisVelocityCalculator(UG_PREPEND_NAMESPACE(SharedTimeSource)(new UG_PREPEND_NAMESPACE(RealTimeSource)), parent)
""""

There's no need to prepend the namespace if there's already a "using namespace" statement at the beginning of the file.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

What's the story behind the optional namespace by the way? It's making our code look like GOBJECT code :D

Revision history for this message
Zsombor Egri (zsombi) wrote :

> """
> +UG_USE_NAMESPACE
> 85
> 86 AxisVelocityCalculator::AxisVelocityCalculator(QObject *parent)
> 87 - : AxisVelocityCalculator(SharedTimeSource(new RealTimeSource),
> parent)
> 88 + :
> AxisVelocityCalculator(UG_PREPEND_NAMESPACE(SharedTimeSource)(new
> UG_PREPEND_NAMESPACE(RealTimeSource)), parent)
> """"
>
> There's no need to prepend the namespace if there's already a "using
> namespace" statement at the beginning of the file.

Well, it didn't let me build... SO I had to add the NS anyway... Will try again, but that was the case :(

Revision history for this message
Zsombor Egri (zsombi) wrote :

> What's the story behind the optional namespace by the way? It's making our
> code look like GOBJECT code :D

It looks like Qt as well :) They do the same. And they do it wrong btw - when they use Quick objects in properties and signals, they'd need to prepend the NS everywhere, otherwise the signature will not be the same... They even have a tutorial/sample for that, and they're failing doing that...

lp:~zsombi/unity8/u8GestureImports updated
2536. By Zsombor Egri

merge trunk

Revision history for this message
Zsombor Egri (zsombi) wrote :

> > """
> > +UG_USE_NAMESPACE
> > 85
> > 86 AxisVelocityCalculator::AxisVelocityCalculator(QObject *parent)
> > 87 - : AxisVelocityCalculator(SharedTimeSource(new RealTimeSource),
> > parent)
> > 88 + :
> > AxisVelocityCalculator(UG_PREPEND_NAMESPACE(SharedTimeSource)(new
> > UG_PREPEND_NAMESPACE(RealTimeSource)), parent)
> > """"
> >
> > There's no need to prepend the namespace if there's already a "using
> > namespace" statement at the beginning of the file.
>
> Well, it didn't let me build... SO I had to add the NS anyway... Will try
> again, but that was the case :(

Mehh... I may have messed up something because of which it wasn't building seems...

lp:~zsombi/unity8/u8GestureImports updated
2537. By Zsombor Egri

no need to prepend namespace when using is set

2538. By Zsombor Egri

few more tests using namespace

Revision history for this message
Albert Astals Cid (aacid) wrote :

- void setTimeSource(const UbuntuGestures::SharedTimeSource &timeSource);
+ void setTimeSource(const UG_PREPEND_NAMESPACE(SharedTimeSource) &timeSource);

Do you really consider this change an improvement?

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2538
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1712/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2262/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2290
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2194
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2194
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2194
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2185/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2185/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2185/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2185/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2185/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2185/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2185/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2185/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2185/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1712/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 13/07/2016 06:07, Albert Astals Cid wrote:
> - void setTimeSource(const UbuntuGestures::SharedTimeSource &timeSource);
> + void setTimeSource(const UG_PREPEND_NAMESPACE(SharedTimeSource) &timeSource);
>
> Do you really consider this change an improvement?

 From what I understood by looking at ubuntu-ui-toolkit code. It may be
that UbuntuGestures was built *without* a namespace (you can choose it
at qmake time), in which case code must not use or refer to it as it
won't exist. All those macros will check whether UbuntuGestures was
built with a namespace and if so, it will add it, otherwise it will be a
NOOP.

We (unity8) have no choice but to obey and follow their design,
otherwise our code will not compile if UbuntuGestures was built without
a namespace.

But it still puzzles me why ubuntu-ui-toolkit added this configuration
option to disable UbuntuGestures namespace in the first place.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Didn't try to build it myself. But all changes seem pretty harmless to me (as in as long as it builds it should be fine).

review: Approve
Revision history for this message
Daniel d'Andrada (dandrader) :
review: Approve (code)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

PreviewIconActionTest test fails.
"var label = findChildsByType(button, "UCLabel")[0];" is returning null (label gets null). Looks like something that could fail if you move UCLabel into a namspace or something...

That also fails:
$ make xvfbtestDashContent FUNCTION="DashContent::test_noDelegateCreationDestructionOnMove"

The other failures listed in https://unity8-jenkins.ubuntu.com/job/test-ppa-autopkgtest/10/label=amd64,package=unity8,release=vivid+overlay,testname=qmluitests.sh/testReport/ you can ignore, as they pass when I run them locally, in my machine

review: Needs Fixing (code)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

The DashContent failure occurs in tests/qmltests/Dash/tst_DashContent.qml:652

The other failing test can be run like this:
$ make xvfbtestPreviewIconActions

If you wanna see them on the screen use "make testFoo" instead of "make xvfbtestFoo"

lp:~zsombi/unity8/u8GestureImports updated
2539. By Zsombor Egri

strip known namespaces from the class names

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2539
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1750/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2300/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2328
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2228
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2228
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2228
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2221/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2221/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2221/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2221/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2221/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2221/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2221/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2221/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2221/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1750/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

DashContent and PreviewIconActions tests pass now.

review: Approve (code)
lp:~zsombi/unity8/u8GestureImports updated
2540. By Zsombor Egri

trunk sync

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2540
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1751/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2301/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2329
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2229
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2229
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2229
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2222/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2222/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2222/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2222/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2222/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2222/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2222/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2222/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2222/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1751/rebuild

review: Needs Fixing (continuous-integration)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-07-11 17:24:20 +0000
3+++ debian/changelog 2016-07-15 12:25:45 +0000
4@@ -1,3 +1,9 @@
5+unity8 (8.13+16.10.20160705-0ubuntu1) UNRELEASED; urgency=medium
6+
7+ * Bump the version to secure UITK compatibility
8+
9+ -- Zoltán Balogh <zoltan@bakter.hu> Mon, 11 Jul 2016 12:42:29 +0200
10+
11 unity8 (8.12+16.10.20160711-0ubuntu1) yakkety; urgency=medium
12
13 [ Josh Arenson ]
14
15=== modified file 'debian/control'
16--- debian/control 2016-06-29 14:45:18 +0000
17+++ debian/control 2016-07-15 12:25:45 +0000
18@@ -31,8 +31,8 @@
19 libqt5svg5-dev,
20 libqt5xmlpatterns5-dev,
21 libsystemsettings-dev,
22- libubuntugestures5-dev,
23- libubuntugestures5-private-dev,
24+ libubuntugestures5-dev (>= 1.3.2030),
25+ libubuntugestures5-private-dev (>= 1.3.2030),
26 libudev-dev,
27 libunity-api-dev (>= 7.115),
28 libusermetricsoutput1-dev,
29@@ -51,7 +51,7 @@
30 qml-module-qtquick2,
31 qml-module-qtsysteminfo,
32 qml-module-qttest,
33- qml-module-ubuntu-components (>= 1.3.1845) | qml-module-ubuntu-components-gles (>= 1.3.1845),
34+ qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
35 qml-module-ubuntu-web,
36 qt5-default,
37 qtbase5-dev (>= 5.4),
38@@ -76,7 +76,7 @@
39 Package: indicators-client
40 Architecture: amd64 armhf i386
41 Depends: qmenumodel-qml (>= 0.2.9),
42- qml-module-ubuntu-components (>= 1.3.1845) | qml-module-ubuntu-components-gles (>= 1.3.1845),
43+ qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
44 unity8 (= ${binary:Version}),
45 ${misc:Depends},
46 ${shlibs:Depends},
47@@ -145,7 +145,7 @@
48 Package: unity8-common
49 Architecture: all
50 Depends: qml-module-qtquick-layouts,
51- qml-module-ubuntu-components (>= 1.3.1845) | qml-module-ubuntu-components-gles (>= 1.3.1845),
52+ qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
53 qml-module-ubuntu-thumbnailer0.1 | ubuntu-thumbnailer-impl,
54 qtdeclarative5-ubuntu-settings-components (>= 0.7),
55 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
56@@ -177,7 +177,7 @@
57 python3-fixtures,
58 python3-gi,
59 qttestability-autopilot (>= 1.4),
60- ubuntu-ui-toolkit-autopilot (>= 1.3.1845),
61+ ubuntu-ui-toolkit-autopilot (>= 1.3.2030),
62 unity-scope-click,
63 unity8 (= ${source:Version}),
64 unity8-fake-env (= ${source:Version}),
65
66=== modified file 'plugins/Ubuntu/Gestures/AxisVelocityCalculator.cpp'
67--- plugins/Ubuntu/Gestures/AxisVelocityCalculator.cpp 2013-10-23 12:25:40 +0000
68+++ plugins/Ubuntu/Gestures/AxisVelocityCalculator.cpp 2016-07-15 12:25:45 +0000
69@@ -21,7 +21,7 @@
70 #include "AxisVelocityCalculator.h"
71 #include <QtCore/QElapsedTimer>
72
73-using namespace UbuntuGestures;
74+UG_USE_NAMESPACE
75
76 AxisVelocityCalculator::AxisVelocityCalculator(QObject *parent)
77 : AxisVelocityCalculator(SharedTimeSource(new RealTimeSource), parent)
78
79=== modified file 'plugins/Ubuntu/Gestures/AxisVelocityCalculator.h'
80--- plugins/Ubuntu/Gestures/AxisVelocityCalculator.h 2015-12-07 10:54:56 +0000
81+++ plugins/Ubuntu/Gestures/AxisVelocityCalculator.h 2016-07-15 12:25:45 +0000
82@@ -24,7 +24,7 @@
83 #include "UbuntuGesturesQmlGlobal.h"
84 #include <stdint.h>
85 #include <QtCore/QObject>
86-#include <TimeSource>
87+#include <UbuntuGestures/private/timesource_p.h>
88
89 /*
90 Estimates the current velocity of a finger based on recent movement along an axis
91@@ -68,7 +68,7 @@
92 /*
93 Constructor that takes a TimeSource
94 */
95- AxisVelocityCalculator(const UbuntuGestures::SharedTimeSource &timeSource, QObject *parent = 0);
96+ AxisVelocityCalculator(const UG_PREPEND_NAMESPACE(SharedTimeSource) &timeSource, QObject *parent = 0);
97
98 virtual ~AxisVelocityCalculator();
99
100@@ -90,7 +90,7 @@
101 /*
102 Replaces the TimeSource with the given one. Useful for testing purposes.
103 */
104- void setTimeSource(const UbuntuGestures::SharedTimeSource &timeSource);
105+ void setTimeSource(const UG_PREPEND_NAMESPACE(SharedTimeSource) &timeSource);
106
107 /*
108 The minimum amount of samples needed for a velocity calculation.
109@@ -138,7 +138,7 @@
110 int m_samplesRead; /* index of the oldest sample available. -1 if buffer is empty */
111 int m_samplesWrite; /* index where the next sample will be written */
112
113- UbuntuGestures::SharedTimeSource m_timeSource;
114+ UG_PREPEND_NAMESPACE(SharedTimeSource) m_timeSource;
115
116 qreal m_trackedPosition;
117 };
118
119=== modified file 'plugins/Ubuntu/Gestures/CMakeLists.txt'
120--- plugins/Ubuntu/Gestures/CMakeLists.txt 2016-06-02 09:32:33 +0000
121+++ plugins/Ubuntu/Gestures/CMakeLists.txt 2016-07-15 12:25:45 +0000
122@@ -27,6 +27,7 @@
123 include_directories(
124 SYSTEM
125 ${UBUNTUGESTURES_INCLUDE_DIRS}
126+ ${UBUNTUGESTURES_INCLUDEDIR}/UbuntuGestures/${UBUNTUGESTURES_VERSION}
127 )
128
129 # There's no cmake var for v8 include path :-/ so create one
130
131=== modified file 'plugins/Ubuntu/Gestures/TouchGate.cpp'
132--- plugins/Ubuntu/Gestures/TouchGate.cpp 2015-12-07 10:54:56 +0000
133+++ plugins/Ubuntu/Gestures/TouchGate.cpp 2016-07-15 12:25:45 +0000
134@@ -20,16 +20,18 @@
135 #include <QDebug>
136 #include <QQuickWindow>
137
138-#include <TouchOwnershipEvent>
139-#include <TouchRegistry>
140+#include <UbuntuGestures/private/touchownershipevent_p.h>
141+#include <UbuntuGestures/private/touchregistry_p.h>
142
143 #if TOUCHGATE_DEBUG
144 #define ugDebug(params) qDebug().nospace() << "[TouchGate(" << (void*)this << ")] " << params
145-#include <DebugHelpers.h>
146+#include <UbuntuGestures/private/debughelpers_p.h>
147 #else // TOUCHGATE_DEBUG
148 #define ugDebug(params) ((void)0)
149 #endif // TOUCHGATE_DEBUG
150
151+UG_USE_NAMESPACE
152+
153 TouchGate::TouchGate(QQuickItem *parent)
154 : QQuickItem(parent)
155 {
156@@ -40,7 +42,7 @@
157 bool TouchGate::event(QEvent *e)
158 {
159 if (e->type() == TouchOwnershipEvent::touchOwnershipEventType()) {
160- touchOwnershipEvent(static_cast<TouchOwnershipEvent *>(e));
161+ touchOwnershipEvent(static_cast<TouchOwnershipEvent*>(e));
162 return true;
163 } else {
164 return QQuickItem::event(e);
165
166=== modified file 'plugins/Ubuntu/Gestures/TouchGate.h'
167--- plugins/Ubuntu/Gestures/TouchGate.h 2015-06-24 11:41:09 +0000
168+++ plugins/Ubuntu/Gestures/TouchGate.h 2016-07-15 12:25:45 +0000
169@@ -19,6 +19,7 @@
170
171 #include "UbuntuGesturesQmlGlobal.h"
172 #include "TouchDispatcher.h"
173+#include <UbuntuGestures/ubuntugesturesglobal.h>
174
175 #include <QQuickItem>
176 #include <QList>
177@@ -26,7 +27,7 @@
178
179 #define TOUCHGATE_DEBUG 0
180
181-class TouchOwnershipEvent;
182+UG_FORWARD_DECLARE_CLASS(TouchOwnershipEvent)
183
184 /*
185 Blocks the passage of events until ownership over the related touch points is granted.
186@@ -82,7 +83,7 @@
187 ulong timestamp;
188 };
189
190- void touchOwnershipEvent(TouchOwnershipEvent *event);
191+ void touchOwnershipEvent(UG_PREPEND_NAMESPACE(TouchOwnershipEvent) *event);
192 bool isTouchPointOwned(int touchId) const;
193 void storeTouchEvent(QTouchDevice *device,
194 Qt::KeyboardModifiers modifiers,
195
196=== modified file 'plugins/Ubuntu/Gestures/TouchGestureArea.cpp'
197--- plugins/Ubuntu/Gestures/TouchGestureArea.cpp 2016-06-01 20:16:51 +0000
198+++ plugins/Ubuntu/Gestures/TouchGestureArea.cpp 2016-07-15 12:25:45 +0000
199@@ -16,9 +16,9 @@
200
201 #include "TouchGestureArea.h"
202
203-#include <UbuntuGestures/TouchOwnershipEvent>
204-#include <UbuntuGestures/TouchRegistry>
205-#include <UbuntuGestures/UnownedTouchEvent>
206+#include <UbuntuGestures/private/touchownershipevent_p.h>
207+#include <UbuntuGestures/private/touchregistry_p.h>
208+#include <UbuntuGestures/private/unownedtouchevent_p.h>
209 // #include "TouchRegistry.h"
210 // #include "UnownedTouchEvent.h"
211
212@@ -26,6 +26,8 @@
213 #include <QStyleHints>
214 #include <private/qquickwindow_p.h>
215
216+UG_USE_NAMESPACE
217+
218 #define TOUCHGESTUREAREA_DEBUG 0
219
220 // TODO - understand more about why we lose touch event releases.
221@@ -135,7 +137,7 @@
222 , m_recognitionPeriod(50)
223 , m_releaseRejectPeriod(100)
224 {
225- setRecognitionTimer(new UbuntuGestures::Timer(this));
226+ setRecognitionTimer(new Timer(this));
227 m_recognitionTimer->setInterval(m_recognitionPeriod);
228 m_recognitionTimer->setSingleShot(true);
229 }
230@@ -153,10 +155,10 @@
231 {
232 // Process unowned touch events (handles update/release for incomplete gestures)
233 if (event->type() == TouchOwnershipEvent::touchOwnershipEventType()) {
234- touchOwnershipEvent(static_cast<TouchOwnershipEvent *>(event));
235+ touchOwnershipEvent(static_cast<TouchOwnershipEvent*>(event));
236 return true;
237 } else if (event->type() == UnownedTouchEvent::unownedTouchEventType()) {
238- unownedTouchEvent(static_cast<UnownedTouchEvent *>(event)->touchEvent());
239+ unownedTouchEvent(static_cast<UnownedTouchEvent*>(event)->touchEvent());
240 return true;
241 }
242
243@@ -608,7 +610,7 @@
244 }
245 }
246
247-void TouchGestureArea::setRecognitionTimer(UbuntuGestures::AbstractTimer *timer)
248+void TouchGestureArea::setRecognitionTimer(AbstractTimer *timer)
249 {
250 int interval = 0;
251 bool timerWasRunning = false;
252
253=== modified file 'plugins/Ubuntu/Gestures/TouchGestureArea.h'
254--- plugins/Ubuntu/Gestures/TouchGestureArea.h 2016-06-01 20:16:51 +0000
255+++ plugins/Ubuntu/Gestures/TouchGestureArea.h 2016-07-15 12:25:45 +0000
256@@ -21,10 +21,11 @@
257
258 #include <QQuickItem>
259
260-#include <UbuntuGestures/Timer>
261+#include <UbuntuGestures/ubuntugesturesglobal.h>
262+#include <UbuntuGestures/private/timer_p.h>
263
264-class TouchOwnershipEvent;
265-class UnownedTouchEvent;
266+UG_FORWARD_DECLARE_CLASS(TouchOwnershipEvent)
267+UG_FORWARD_DECLARE_CLASS(UnownedTouchEvent)
268
269 class GestureTouchPoint : public QObject
270 {
271@@ -141,7 +142,7 @@
272
273 bool event(QEvent *e) override;
274
275- void setRecognitionTimer(UbuntuGestures::AbstractTimer *timer);
276+ void setRecognitionTimer(UG_PREPEND_NAMESPACE(AbstractTimer) *timer);
277
278 int status() const;
279 bool dragging() const;
280@@ -194,7 +195,7 @@
281 void unownedTouchEvent_recognised(QTouchEvent *unownedTouchEvent);
282 void unownedTouchEvent_rejected(QTouchEvent *unownedTouchEvent);
283
284- void touchOwnershipEvent(TouchOwnershipEvent *event);
285+ void touchOwnershipEvent(UG_PREPEND_NAMESPACE(TouchOwnershipEvent) *event);
286 void updateTouchPoints(QTouchEvent *event);
287
288 GestureTouchPoint* addTouchPoint(const QTouchEvent::TouchPoint *tp);
289@@ -209,7 +210,7 @@
290 uint m_status;
291 QSet<int> m_candidateTouches;
292 QSet<int> m_watchedTouches;
293- UbuntuGestures::AbstractTimer *m_recognitionTimer;
294+ UG_PREPEND_NAMESPACE(AbstractTimer) *m_recognitionTimer;
295
296 bool m_dragging;
297 QHash<int, GestureTouchPoint*> m_liveTouchPoints;
298
299=== modified file 'tests/plugins/Ubuntu/Gestures/CMakeLists.txt'
300--- tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2016-06-02 09:32:33 +0000
301+++ tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2016-07-15 12:25:45 +0000
302@@ -7,6 +7,7 @@
303 SYSTEM
304 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
305 ${UBUNTUGESTURES_INCLUDE_DIRS}
306+ ${UBUNTUGESTURES_INCLUDEDIR}/UbuntuGestures/${UBUNTUGESTURES_VERSION}
307 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
308 )
309
310
311=== modified file 'tests/plugins/Ubuntu/Gestures/GestureTest.cpp'
312--- tests/plugins/Ubuntu/Gestures/GestureTest.cpp 2016-05-02 07:57:07 +0000
313+++ tests/plugins/Ubuntu/Gestures/GestureTest.cpp 2016-07-15 12:25:45 +0000
314@@ -22,10 +22,10 @@
315 #include <QQuickView>
316 #include <QtTest>
317
318-#include <Timer>
319-#include <TouchRegistry>
320+#include <UbuntuGestures/private/timer_p.h>
321+#include <UbuntuGestures/private/touchregistry_p.h>
322
323-using namespace UbuntuGestures;
324+UG_USE_NAMESPACE
325
326 GestureTest::GestureTest(const QString &qmlFilename)
327 : QObject(), m_device(nullptr), m_view(nullptr), m_qmlFilename(qmlFilename)
328
329=== modified file 'tests/plugins/Ubuntu/Gestures/GestureTest.h'
330--- tests/plugins/Ubuntu/Gestures/GestureTest.h 2016-03-29 03:47:39 +0000
331+++ tests/plugins/Ubuntu/Gestures/GestureTest.h 2016-07-15 12:25:45 +0000
332@@ -19,14 +19,13 @@
333
334 #include <QQuickItem>
335 #include <QTouchEvent>
336+#include <UbuntuGestures/ubuntugesturesglobal.h>
337
338 class QQuickView;
339 class QTouchDevice;
340
341-namespace UbuntuGestures {
342- class FakeTimerFactory;
343-}
344-class TouchRegistry;
345+UG_FORWARD_DECLARE_CLASS(FakeTimerFactory)
346+UG_FORWARD_DECLARE_CLASS(TouchRegistry)
347
348 // C++ std lib
349 #include <functional>
350@@ -96,7 +95,7 @@
351 QTouchDevice *m_device;
352 QQuickView *m_view;
353 TouchRegistry *m_touchRegistry;
354- UbuntuGestures::FakeTimerFactory *m_fakeTimerFactory;
355+ UG_PREPEND_NAMESPACE(FakeTimerFactory) *m_fakeTimerFactory;
356 QString m_qmlFilename;
357 };
358
359
360=== modified file 'tests/plugins/Ubuntu/Gestures/tst_AxisVelocityCalculator.cpp'
361--- tests/plugins/Ubuntu/Gestures/tst_AxisVelocityCalculator.cpp 2015-04-30 09:31:51 +0000
362+++ tests/plugins/Ubuntu/Gestures/tst_AxisVelocityCalculator.cpp 2016-07-15 12:25:45 +0000
363@@ -20,7 +20,7 @@
364
365 #include <AxisVelocityCalculator.h>
366
367-class FakeTimeSource : public UbuntuGestures::TimeSource {
368+class FakeTimeSource : public UG_PREPEND_NAMESPACE(TimeSource) {
369 public:
370 FakeTimeSource() : m_value(0) {}
371
372
373=== modified file 'tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.cpp'
374--- tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.cpp 2016-04-13 09:19:26 +0000
375+++ tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.cpp 2016-07-15 12:25:45 +0000
376@@ -21,7 +21,7 @@
377 #include "TestItem.h"
378 #include "Direction.h"
379
380-using namespace UbuntuGestures;
381+UG_USE_NAMESPACE
382
383 class tst_FloatingFlickable: public GestureTest
384 {
385
386=== modified file 'tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp'
387--- tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp 2015-12-07 10:54:56 +0000
388+++ tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp 2016-07-15 12:25:45 +0000
389@@ -25,10 +25,12 @@
390 #include <functional>
391
392 #include <TouchGate.h>
393-#include <TouchRegistry>
394+#include <UbuntuGestures/private/touchregistry_p.h>
395
396 #include "TestItem.h"
397
398+UG_USE_NAMESPACE
399+
400 class CandidateItem : public QQuickItem
401 {
402 Q_OBJECT
403
404=== modified file 'tests/qmltests/Components/tst_DragHandle.cpp'
405--- tests/qmltests/Components/tst_DragHandle.cpp 2016-05-18 21:30:25 +0000
406+++ tests/qmltests/Components/tst_DragHandle.cpp 2016-07-15 12:25:45 +0000
407@@ -24,10 +24,10 @@
408 #include <UbuntuGestures/private/ucswipearea_p_p.h>
409
410 #include <AxisVelocityCalculator.h>
411-#include <Timer>
412+#include <UbuntuGestures/private/timer_p.h>
413 #include "Direction.h"
414
415-using namespace UbuntuGestures;
416+UG_USE_NAMESPACE
417
418 class tst_DragHandle: public QObject
419 {
420
421=== modified file 'tests/qmltests/Components/tst_EdgeDragEvaluator.cpp'
422--- tests/qmltests/Components/tst_EdgeDragEvaluator.cpp 2015-12-07 10:54:56 +0000
423+++ tests/qmltests/Components/tst_EdgeDragEvaluator.cpp 2016-07-15 12:25:45 +0000
424@@ -24,9 +24,9 @@
425 // Ubuntu.Gestures plugin
426 #include <AxisVelocityCalculator.h>
427 #include <Direction.h>
428-#include <Timer>
429+#include <UbuntuGestures/private/timer_p.h>
430
431-using namespace UbuntuGestures;
432+UG_USE_NAMESPACE
433
434 class tst_EdgeDragEvaluator: public QObject
435 {
436
437=== modified file 'tests/utils/modules/Unity/Test/CMakeLists.txt'
438--- tests/utils/modules/Unity/Test/CMakeLists.txt 2016-06-02 09:32:33 +0000
439+++ tests/utils/modules/Unity/Test/CMakeLists.txt 2016-07-15 12:25:45 +0000
440@@ -13,6 +13,7 @@
441 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
442 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
443 ${UBUNTUGESTURES_INCLUDE_DIRS}
444+ ${UBUNTUGESTURES_INCLUDEDIR}/UbuntuGestures/${UBUNTUGESTURES_VERSION}
445 )
446
447 set(UnityTestQML_SOURCES
448
449=== modified file 'tests/utils/modules/Unity/Test/testutil.cpp'
450--- tests/utils/modules/Unity/Test/testutil.cpp 2016-06-02 08:05:31 +0000
451+++ tests/utils/modules/Unity/Test/testutil.cpp 2016-07-15 12:25:45 +0000
452@@ -24,10 +24,11 @@
453 #include <private/qquickanimation_p.h>
454
455 // UbuntuGestures lib
456-#include <TouchRegistry>
457-#include <Timer>
458+#include <UbuntuGestures/ubuntugesturesglobal.h>
459+#include <UbuntuGestures/private/touchregistry_p.h>
460+#include <UbuntuGestures/private/timer_p.h>
461
462-using namespace UbuntuGestures;
463+UG_USE_NAMESPACE
464
465 TestUtil::TestUtil(QObject *parent)
466 : QObject(parent)
467@@ -50,8 +51,18 @@
468 const QMetaObject *metaObject = obj->metaObject();
469 while (!result && metaObject) {
470 const QString className = metaObject->className();
471- const QString qmlName = className.left(className.indexOf("_QMLTYPE_"));
472+ QString qmlName = className.left(className.indexOf("_QMLTYPE_"));
473 result = qmlName == name;
474+ // test for known namespaces
475+ if (!result) {
476+ // remove UbuntuGestures and UbuntuToolkit namespace
477+ qmlName = qmlName.remove(QString("UbuntuGestures::"));
478+ result = qmlName == name;
479+ }
480+ if (!result) {
481+ qmlName = qmlName.remove(QString("UbuntuToolkit::"));
482+ result = qmlName == name;
483+ }
484 metaObject = metaObject->superClass();
485 }
486 }

Subscribers

People subscribed via source and target branches