on xenial help sign in
merge trunk
commitc38f4fee4e559eea64ff32537b4183c94cfa0c51 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 17 Jun 2015, 13:40 (11 years ago) parente835b8f52bbdce
174 files changed+2820−867
CMakeLists.txt+1 debian/changelog+64 libs/UbuntuGestures/CandidateInactivityTimer.cpp+7−2 libs/UbuntuGestures/CandidateInactivityTimer.h+3−1 libs/UbuntuGestures/Timer.cpp−10 libs/UbuntuGestures/Timer.h+1−1 libs/UbuntuGestures/TouchRegistry.cpp+16−12 libs/UbuntuGestures/TouchRegistry.h+8−6 plugins/AccountsService/plugin.h+1−1 plugins/Dash/CardCreator.js+2 plugins/Dash/plugin.h+1−1 plugins/Greeter/Unity/Launcher/launchermodelas.h+9−9 plugins/Greeter/Unity/Launcher/plugin.h+1−1 plugins/Greeter/Unity/Launcher/quicklistmodel.h+2−2 plugins/LightDM/UsersModel.cpp+1−1 plugins/LightDM/liblightdm/GreeterPrivate.cpp+29−5 plugins/LightDM/liblightdm/GreeterPrivate.h+1−1 plugins/LightDM/liblightdm/UsersModel.h+2−2 plugins/LightDM/plugin.h+1−1 plugins/Lights/plugin.h+1−1 plugins/Powerd/plugin.h+1−1 plugins/ScreenGrabber/plugin.h+1−1 plugins/SessionBroadcast/plugin.h+1−1 plugins/Ubuntu/DownloadDaemonListener/plugin.h+2−2 plugins/Ubuntu/Gestures/CMakeLists.txt+1 plugins/Ubuntu/Gestures/Direction.cpp+6−3 plugins/Ubuntu/Gestures/Direction.h+3−2 plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+5−2 plugins/Ubuntu/Gestures/DirectionalDragArea.h+2−2 plugins/Ubuntu/Gestures/FloatingFlickable.cpp+150 plugins/Ubuntu/Gestures/FloatingFlickable.h+86 plugins/Ubuntu/Gestures/TouchGate.cpp+10 plugins/Ubuntu/Gestures/TouchGate.h+1 plugins/Ubuntu/Gestures/plugin.cpp+3−1 plugins/Ubuntu/Gestures/plugin.h+1−1 plugins/Ubuntu/Payments/plugin.h+1−1 plugins/Ubuntu/SystemImage/plugin.h+1−1 plugins/Unity/Connectivity/plugin.h+1−1 plugins/Unity/DashCommunicator/plugin.h+1−1 plugins/Unity/Indicators/indicatorsmodel.h+5−5 plugins/Unity/Indicators/menucontentactivator.cpp+4−4 plugins/Unity/Indicators/plugin.h+1−1 plugins/Unity/Launcher/launchermodel.h+10−10 plugins/Unity/Launcher/plugin.h+1−1 plugins/Unity/Launcher/quicklistmodel.h+2−2 plugins/Unity/Session/plugin.h+1−1 plugins/Utils/HomeKeyWatcher.h+1−1 plugins/Utils/plugin.h+2−2 plugins/Utils/qlimitproxymodelqml.h+2−2 plugins/Utils/qvariantlistmodel.h+6−6 plugins/Utils/timeformatter.h+1−1 plugins/Utils/unitysortfilterproxymodelqml.h+2−2 plugins/Utils/windowkeysfilter.h+1−1 plugins/Wizard/plugin.h+1−1 po/am.po+4−4 po/ast.po+86−86 po/eo.po+6−6 po/fi.po+4−4 po/ia.po+94−83 po/nb.po+8−8 po/pt.po+7−7 po/sl.po+8−8 qml/Dash/Previews/PreviewRatingDisplay.qml+9−44 qml/Dash/Previews/PreviewRatingEdit.qml+80 qml/Dash/Previews/PreviewRatingInput.qml+3 qml/Dash/Previews/PreviewRatingSingleDisplay.qml+70 qml/Dash/Previews/PreviewWidgetFactory.qml+1 qml/Greeter/Greeter.qml+4−2 qml/Panel/Indicators/IndicatorsLight.qml+8 qml/Shell.qml−1 qml/Stages/DecoratedWindow.qml+1 qml/Stages/DesktopStage.qml+20−14 qml/Stages/PhoneStage.qml+5−4 qml/Stages/TabletStage.qml+10−12 src/Dash/main.cpp−6 src/main.cpp−5 tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+13−3 tests/autopilot/unity8/fixture_setup.py+131−3 tests/autopilot/unity8/indicators/tests/test_action_latency.py+4−2 tests/autopilot/unity8/indicators/tests/test_display_indicator.py+1−1 tests/autopilot/unity8/process_helpers.py+3−3 tests/autopilot/unity8/sensors.py+93 tests/autopilot/unity8/shell/emulators/main_window.py+12 tests/autopilot/unity8/shell/tests/test_rotation.py+113 tests/libs/UbuntuGestures/tst_TouchRegistry.cpp+75−76 tests/mocks/AccountsService/plugin.h+1−1 tests/mocks/CMakeLists.txt+1 tests/mocks/GSettings.1.0/fake_gsettings.h+2−2 tests/mocks/GSettings.1.0/plugin.cpp+6 tests/mocks/GSettings.1.0/plugin.h+1−1 tests/mocks/LightDM/liblightdm/UsersModel.h+2−2 tests/mocks/LightDM/plugin.h+1−1 tests/mocks/Lights/plugin.h+1−1 tests/mocks/MeeGo/QOfono/plugin.h+1−1 tests/mocks/Powerd/plugin.h+1−1 tests/mocks/QMenuModel/plugin.h+1−1 tests/mocks/QMenuModel/unitymenumodel.h+6−6 tests/mocks/QtMultimedia/plugin.h+1−1 tests/mocks/Ubuntu/Connectivity/plugin.h+2−2 tests/mocks/Ubuntu/DownloadDaemonListener/plugin.h+1−1 tests/mocks/Ubuntu/Payments/plugin.h+1−1 tests/mocks/Ubuntu/SystemImage/plugin.h+1−1 tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/plugin.h+1−1 tests/mocks/Ubuntu/Telephony/MockCallEntry.h+1−1 tests/mocks/Ubuntu/Telephony/plugin.h+2−2 tests/mocks/Unity/Application/ApplicationManager.cpp+1−1 tests/mocks/Unity/Application/CMakeLists.txt−4 tests/mocks/Unity/Application/ObjectListModel.h+1−1 tests/mocks/Unity/Application/plugin.h+2−2 tests/mocks/Unity/Connectivity/plugin.h+1−1 tests/mocks/Unity/DashCommunicator/plugin.h+1−1 tests/mocks/Unity/Indicators/fakeindicatorsmodel.h+5−5 tests/mocks/Unity/Indicators/fakeplugin.h+1−1 tests/mocks/Unity/Launcher/MockLauncherItem.h+2−2 tests/mocks/Unity/Launcher/MockLauncherModel.h+10−10 tests/mocks/Unity/Launcher/MockQuickListModel.h+2−2 tests/mocks/Unity/Launcher/plugin.h+1−1 tests/mocks/Unity/Notifications/MockActionModel.h+3−3 tests/mocks/Unity/Notifications/MockNotificationModel.h+3−3 tests/mocks/Unity/Notifications/plugin.h+1−1 tests/mocks/Unity/fake_scopes.h+2−2 tests/mocks/Unity/fake_unity_plugin.h+1−1 tests/mocks/Utils/CMakeLists.txt+40 tests/mocks/Utils/HomeKeyWatcher.qml+21 tests/mocks/Utils/Style.js+37 tests/mocks/Utils/Utils.qmltypes+175 tests/mocks/Utils/constants.cpp+23 tests/mocks/Utils/constants.h+43 tests/mocks/Utils/plugin.cpp+76 tests/mocks/Utils/plugin.h+33 tests/mocks/Utils/qmldir+5 tests/mocks/Utils/windowstatestorage.cpp+48 tests/mocks/Utils/windowstatestorage.h+38 tests/mocks/Wizard/mockplugin.h+1−1 tests/mocks/indicator-service/mock-indicator-service.c+76−12 tests/plugins/Dash/cardcreator/5.res+1−1 tests/plugins/Dash/horizontaljournaltest.cpp+3−3 tests/plugins/Dash/horizontaljournaltry.cpp+1−1 tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp+3−3 tests/plugins/Dash/organicgridtest.cpp+2−2 tests/plugins/Dash/organicgridtry.cpp+2−2 tests/plugins/Dash/verticaljournaltest.cpp+3−3 tests/plugins/Dash/verticaljournaltry.cpp+1−1 tests/plugins/LightDM/CMakeLists.txt+35−16 tests/plugins/LightDM/pam.cpp+52 tests/plugins/Ubuntu/Gestures/CMakeLists.txt+2−1 tests/plugins/Ubuntu/Gestures/GestureTest.cpp+2−1 tests/plugins/Ubuntu/Gestures/TestItem.cpp+30 tests/plugins/Ubuntu/Gestures/TestItem.h+33 tests/plugins/Ubuntu/Gestures/tst_AxisVelocityCalculator.cpp+1−1 tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp+21−21 tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.cpp+122 tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.qml+80 tests/plugins/Ubuntu/Gestures/tst_PressedOutsideNotifier.cpp+1−1 tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+2−25 tests/plugins/Unity/Indicators/menucontentactivatortest.cpp+2−2 tests/plugins/Unity/Launcher/CMakeLists.txt−1 tests/plugins/Unity/Launcher/launchermodeltest.cpp+21−21 tests/plugins/Utils/qlimitproxymodeltest.cpp+5−5 tests/plugins/Utils/unitysortfilterproxymodeltest.cpp+5−5 tests/qmltests/CMakeLists.txt+1 tests/qmltests/Components/tst_DragHandle.cpp−8 tests/qmltests/Dash/Previews/tst_PreviewRatingEdit.qml+80 tests/qmltests/Dash/tst_DashContent.qml+7−2 tests/qmltests/Stages/ApplicationCheckBox.qml+49−20 tests/qmltests/Stages/tst_DesktopStage.qml+77−67 tests/qmltests/Stages/tst_TabletStage.qml+1−1 tests/qmltests/tst_Shell.qml+136−39 tests/uqmlscene/main.cpp−10 tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+1 tests/utils/modules/Unity/Test/UnityTestCase.qml−2 tests/utils/modules/Unity/Test/plugin.h+1−1 tests/utils/modules/Unity/Test/testutil.cpp+8−20 tests/utils/modules/Unity/Test/testutil.h+1−1
CMakeLists.txt+1
@@ -113,6 +113,7 @@ set(MOCK_INDICATOR_SERVICE_APP unity-mock-indicator-service)
113113include_directories(
114114 ${CMAKE_SOURCE_DIR}/include
115115 ${CMAKE_BINARY_DIR}/include
116+ ${APPLICATION_API_INCLUDE_DIRS}
116117)
117118
118119# add subdirectories to build
debian/changelog+64
@@ -1,9 +1,73 @@
1+unity8 (8.10+15.10.20150612-0ubuntu2) wily; urgency=medium
2+
3+ * No-change rebuild against Qt 5.4.2.
4+
5+ -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Mon, 15 Jun 2015 12:33:07 +0300
6+
7+unity8 (8.10+15.10.20150612-0ubuntu1) wily; urgency=medium
8+
9+ [ Michał Sawicz ]
10+ * Implement full-shell rotation (LP: #1210199)
11+
12+ [ CI Train Bot ]
13+ * New rebuild forced.
14+ * Resync trunk.
15+
16+ [ Daniel d'Andrada ]
17+ * Implemented autopilot-test and fake-sensors for shell-rotation.
18+
19+ [ Mirco Müller ]
20+ * Implemented autopilot-test and fake-sensors for shell-rotation.
21+
22+ -- CI Train Bot <ci-train-bot@canonical.com> Fri, 12 Jun 2015 16:07:47 +0000
23+
124unity8 (8.10-0ubuntu1) UNRELEASED; urgency=medium
225
326 * Implement full-shell rotation (LP: #1210199)
427
528 -- Michał Sawicz <michal.sawicz@canonical.com> Wed, 15 Apr 2015 14:47:17 +0200
629
30+unity8 (8.02+15.10.20150603.1-0ubuntu1) wily; urgency=medium
31+
32+ [ CI Train Bot ]
33+ * New rebuild forced.
34+ * Resync trunk.
35+
36+ [ Renato Araujo Oliveira Filho ]
37+ * Set the device led color to green. (LP: #1450894)
38+
39+ -- CI Train Bot <ci-train-bot@canonical.com> Wed, 03 Jun 2015 21:42:35 +0000
40+
41+unity8 (8.02+15.10.20150518.1-0ubuntu1) wily; urgency=medium
42+
43+ [ Albert Astals Cid ]
44+ * Add overrides to override functions
45+ * Implement "rating-edit" preview widget (LP: #1318144)
46+ * Make the DashContent::test_mainNavigation test more stable (LP:
47+ #1450809)
48+ * Use art height as implicitHeight when the header is overlayed and
49+ there's no summary
50+
51+ [ CI Train Bot ]
52+ * New rebuild forced.
53+ * Resync trunk.
54+
55+ [ Daniel d'Andrada ]
56+ * Introducing FloatingFlickable
57+ * Make Ubuntu.Gestures components install TouchRegistry by themselves
58+
59+ [ Michael Terry ]
60+ * Fix a possible crash in our PAM threading code. (LP: #1425362) (LP:
61+ #1425362)
62+ * Fix the lockscreen becoming unresponsive after testing an app on the
63+ device from QtCreator. (LP: #1435364)
64+
65+ [ Nick Dedekind ]
66+ * Fixed desktop stage app focus.
67+ * Fixed issue in laggy indicator autpilot tests (LP: #1446846)
68+
69+ -- CI Train Bot <ci-train-bot@canonical.com> Mon, 18 May 2015 23:04:39 +0000
70+
771unity8 (8.02+15.04.20150511-0ubuntu1) vivid; urgency=medium
872
973 [ Albert Astals Cid ]
libs/UbuntuGestures/CandidateInactivityTimer.cpp+7−2
@@ -19,12 +19,12 @@
1919namespace UbuntuGestures {
2020
2121CandidateInactivityTimer::CandidateInactivityTimer(int touchId, QQuickItem *candidate,
22− AbstractTimerFactory &timerFactory, QObject *parent)
22+ AbstractTimer *timer, QObject *parent)
2323 : QObject(parent)
24+ , m_timer(timer)
2425 , m_touchId(touchId)
2526 , m_candidate(candidate)
2627{
27− m_timer = timerFactory.createTimer(this);
2828 connect(m_timer, &AbstractTimer::timeout,
2929 this, &CandidateInactivityTimer::onTimeout);
3030 m_timer->setInterval(durationMs);
@@ -32,6 +32,11 @@ CandidateInactivityTimer::CandidateInactivityTimer(int touchId, QQuickItem *cand
3232 m_timer->start();
3333}
3434
35+CandidateInactivityTimer::~CandidateInactivityTimer()
36+{
37+ delete m_timer;
38+}
39+
3540void CandidateInactivityTimer::onTimeout()
3641{
3742 qWarning("[TouchRegistry] Candidate for touch %d defaulted!", m_touchId);
libs/UbuntuGestures/CandidateInactivityTimer.h+3−1
@@ -29,9 +29,11 @@ class UBUNTUGESTURES_EXPORT CandidateInactivityTimer : public QObject {
2929 Q_OBJECT
3030public:
3131 CandidateInactivityTimer(int touchId, QQuickItem *candidate,
32− AbstractTimerFactory &timerFactory,
32+ AbstractTimer *timer,
3333 QObject *parent = nullptr);
3434
35+ virtual ~CandidateInactivityTimer();
36+
3537 const int durationMs = 1000;
3638
3739Q_SIGNALS:
libs/UbuntuGestures/Timer.cpp−10
@@ -115,16 +115,6 @@ FakeTimerFactory::FakeTimerFactory()
115115 m_timeSource.reset(new FakeTimeSource);
116116}
117117
118−FakeTimerFactory::~FakeTimerFactory()
119−{
120− for (int i = 0; i < timers.count(); ++i) {
121− FakeTimer *timer = timers[i].data();
122− if (timer) {
123− delete timer;
124− }
125− }
126−}
127−
128118void FakeTimerFactory::updateTime(qint64 targetTime)
129119{
130120 qint64 minTimeoutTime = targetTime;
libs/UbuntuGestures/Timer.h+1−1
@@ -101,7 +101,7 @@ class UBUNTUGESTURES_EXPORT FakeTimerFactory : public AbstractTimerFactory
101101{
102102public:
103103 FakeTimerFactory();
104− virtual ~FakeTimerFactory();
104+ virtual ~FakeTimerFactory() {}
105105
106106 void updateTime(qint64 msecsSinceReference);
107107 QSharedPointer<TimeSource> timeSource() { return m_timeSource; }
libs/UbuntuGestures/TouchRegistry.cpp+16−12
@@ -41,20 +41,10 @@ using namespace UbuntuGestures;
4141TouchRegistry *TouchRegistry::m_instance = nullptr;
4242
4343TouchRegistry::TouchRegistry(QObject *parent)
44− : TouchRegistry(parent, new TimerFactory)
45−{
46−}
47−
48−TouchRegistry::TouchRegistry(QObject *parent, AbstractTimerFactory *timerFactory)
4944 : QObject(parent)
5045 , m_inDispatchLoop(false)
51− , m_timerFactory(timerFactory)
46+ , m_timerFactory(new TimerFactory)
5247{
53− if (m_instance == nullptr) {
54− m_instance = this;
55− } else {
56− qFatal("Cannot have more than one instance of TouchRegistry. It must be a singleton.");
57− }
5848}
5949
6050TouchRegistry::~TouchRegistry()
@@ -64,6 +54,20 @@ TouchRegistry::~TouchRegistry()
6454 delete m_timerFactory;
6555}
6656
57+TouchRegistry *TouchRegistry::instance()
58+{
59+ if (m_instance == nullptr) {
60+ m_instance = new TouchRegistry;
61+ }
62+ return m_instance;
63+}
64+
65+void TouchRegistry::setTimerFactory(AbstractTimerFactory *timerFactory)
66+{
67+ delete m_timerFactory;
68+ m_timerFactory = timerFactory;
69+}
70+
6771void TouchRegistry::update(const QTouchEvent *event)
6872{
6973 #if TOUCHREGISTRY_DEBUG
@@ -261,7 +265,7 @@ void TouchRegistry::addCandidateOwnerForTouch(int id, QQuickItem *candidate)
261265 candidateInfo.state = CandidateInfo::Undecided;
262266 candidateInfo.item = candidate;
263267 candidateInfo.inactivityTimer = new CandidateInactivityTimer(id, candidate,
264− *m_timerFactory,
268+ m_timerFactory->createTimer(),
265269 this);
266270 connect(candidateInfo.inactivityTimer, &CandidateInactivityTimer::candidateDefaulted,
267271 this, &TouchRegistry::rejectCandidateOwnerForTouch);
libs/UbuntuGestures/TouchRegistry.h+8−6
@@ -25,6 +25,7 @@
2525
2626#include "UbuntuGesturesGlobal.h"
2727#include "CandidateInactivityTimer.h"
28+#include "Timer.h"
2829#include "Pool.h"
2930
3031namespace UbuntuGestures {
@@ -93,15 +94,10 @@ class UBUNTUGESTURES_EXPORT TouchRegistry : public QObject
9394{
9495 Q_OBJECT
9596public:
96− TouchRegistry(QObject *parent = nullptr);
97− // Useful for tests, where you should feed a fake timer
98− TouchRegistry(QObject *parent, UbuntuGestures::AbstractTimerFactory *timerFactory);
99−
10097 virtual ~TouchRegistry();
10198
10299 // Returns a pointer to the application's TouchRegistry instance.
103− // If no instance has been allocated, null is returned.
104− static TouchRegistry *instance() { return m_instance; }
100+ static TouchRegistry *instance();
105101
106102 void update(const QTouchEvent *event);
107103
@@ -128,10 +124,16 @@ public:
128124 // but would nonetheless like to be kept up-to-date on its state.
129125 void addTouchWatcher(int touchId, QQuickItem *watcherItem);
130126
127+ // Useful for tests, where you should use fake timers
128+ void setTimerFactory(UbuntuGestures::AbstractTimerFactory *timerFactory);
129+
131130private Q_SLOTS:
132131 void rejectCandidateOwnerForTouch(int id, QQuickItem *candidate);
133132
134133private:
134+ // Only instance() can cronstruct one
135+ TouchRegistry(QObject *parent = nullptr);
136+
135137 class CandidateInfo {
136138 public:
137139 enum {
plugins/AccountsService/plugin.h+1−1
@@ -28,7 +28,7 @@ class AccountsServicePlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
plugins/Dash/CardCreator.js+2
@@ -644,6 +644,8 @@ function cardString(template, components) {
644644 var implicitHeight = 'implicitHeight: ';
645645 if (hasSummary) {
646646 implicitHeight += 'summary.y + summary.height + units.gu(1);\n';
647+ } else if (headerAsOverlay) {
648+ implicitHeight += 'artShapeHolder.height;\n';
647649 } else if (hasHeaderRow) {
648650 implicitHeight += 'row.y + row.height + units.gu(1);\n';
649651 } else if (hasMascot) {
plugins/Dash/plugin.h+1−1
@@ -27,7 +27,7 @@ class DashPlugin : public QQmlExtensionPlugin
2727 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2828
2929public:
30− void registerTypes(const char *uri);
30+ void registerTypes(const char *uri) override;
3131};
3232
3333#endif
plugins/Greeter/Unity/Launcher/launchermodelas.h+9−9
@@ -37,19 +37,19 @@ public:
3737 LauncherModel(QObject *parent = 0);
3838 ~LauncherModel();
3939
40− int rowCount(const QModelIndex &parent = QModelIndex()) const;
40+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
4141
42− QVariant data(const QModelIndex &index, int role) const;
42+ QVariant data(const QModelIndex &index, int role) const override;
4343
44− Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const;
45− Q_INVOKABLE void move(int oldIndex, int newIndex);
46− Q_INVOKABLE void pin(const QString &appId, int index = -1);
47− Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
48− Q_INVOKABLE void setUser(const QString &username);
44+ Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
45+ Q_INVOKABLE void move(int oldIndex, int newIndex) override;
46+ Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
47+ Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
48+ Q_INVOKABLE void setUser(const QString &username) override;
4949 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
5050
51− unity::shell::application::ApplicationManagerInterface* applicationManager() const;
52− void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager);
51+ unity::shell::application::ApplicationManagerInterface* applicationManager() const override;
52+ void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager) override;
5353
5454 bool onlyPinned() const override;
5555 void setOnlyPinned(bool onlyPinned) override;
plugins/Greeter/Unity/Launcher/plugin.h+1−1
@@ -26,7 +26,7 @@ class UnityLauncherPlugin : public QQmlExtensionPlugin
2626 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2727
2828public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
3030};
3131
3232#endif
plugins/Greeter/Unity/Launcher/quicklistmodel.h+2−2
@@ -45,8 +45,8 @@ public:
4545
4646 QuickListEntry get(int index) const;
4747
48− int rowCount(const QModelIndex &parent = QModelIndex()) const;
49− QVariant data(const QModelIndex &index, int role) const;
48+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
49+ QVariant data(const QModelIndex &index, int role) const override;
5050
5151private:
5252 QList<QuickListEntry> m_list;
plugins/LightDM/UsersModel.cpp+1−1
@@ -32,7 +32,7 @@ class MangleModel : public QSortFilterProxyModel
3232public:
3333 explicit MangleModel(QObject* parent=0);
3434
35− virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
35+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
3636};
3737
3838MangleModel::MangleModel(QObject* parent)
plugins/LightDM/liblightdm/GreeterPrivate.cpp+29−5
@@ -56,7 +56,8 @@ public:
5656 this, SLOT(handleMessage(pam_handle *, QString, QLightDM::Greeter::MessageType)));
5757 // This next connect is how we pass ResponseFutures between threads
5858 connect(this, SIGNAL(showPrompt(pam_handle *, QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)),
59− this, SLOT(handlePrompt(pam_handle *, QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)));
59+ this, SLOT(handlePrompt(pam_handle *, QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)),
60+ Qt::BlockingQueuedConnection);
6061 }
6162
6263 ~GreeterImpl()
@@ -68,6 +69,13 @@ public:
6869 {
6970 // Clear out any existing PAM interactions first
7071 cancelPam();
72+ if (pamHandle != nullptr) {
73+ // While we were cancelling pam above, we processed Qt events.
74+ // Which may have allowed someone to call start() on us again.
75+ // In which case, we'll bail on our current start() call.
76+ // This isn't racy because it's all in the same thread.
77+ return;
78+ }
7179
7280 AppData *appData = new AppData();
7381 appData->impl = this;
@@ -79,7 +87,7 @@ public:
7987
8088 if (pam_start("lightdm", username.toUtf8(), &conversation, &pamHandle) == PAM_SUCCESS) {
8189 appData->handle = pamHandle;
82− futureWatcher.setFuture(QtConcurrent::run(authenticateWithPam, pamHandle));
90+ futureWatcher.setFuture(QtConcurrent::mapped(QList<pam_handle*>() << pamHandle, authenticateWithPam));
8391 } else {
8492 delete appData;
8593 greeterPrivate->authenticated = false;
@@ -88,7 +96,7 @@ public:
8896 }
8997 }
9098
91− static int authenticateWithPam(pam_handle* pamHandle)
99+ static int authenticateWithPam(pam_handle* const& pamHandle)
92100 {
93101 int pamStatus = pam_authenticate(pamHandle, 0);
94102 if (pamStatus == PAM_SUCCESS) {
@@ -242,11 +250,22 @@ private Q_SLOTS:
242250private:
243251 void cancelPam()
244252 {
245− // Unfortunately we can't simply cancel our QFuture because QtConcurrent::run doesn't support cancel
246253 if (pamHandle != nullptr) {
254+ QFuture<int> pamFuture = futureWatcher.future();
247255 pam_handle *handle = pamHandle;
248256 pamHandle = nullptr; // to disable normal finishPam() handling
249− while (respond(QString())); // clear our local queue of QFutures
257+ pamFuture.cancel();
258+
259+ // Note the empty loop, we just want to clear the futures queue.
260+ // Any further prompts from the pam thread will be immediately
261+ // responded to/dismissed in handlePrompt().
262+ while (respond(QString()));
263+
264+ // Now let signal/slot handling happen so the thread can finish
265+ while (!pamFuture.isFinished()) {
266+ QCoreApplication::processEvents();
267+ }
268+
250269 pam_end(handle, PAM_CONV_ERR);
251270 }
252271 }
@@ -266,6 +285,11 @@ GreeterPrivate::GreeterPrivate(Greeter* parent)
266285{
267286}
268287
288+GreeterPrivate::~GreeterPrivate()
289+{
290+ delete m_impl;
291+}
292+
269293void GreeterPrivate::handleAuthenticate()
270294{
271295 m_impl->start(authenticationUser);
plugins/LightDM/liblightdm/GreeterPrivate.h+1−1
@@ -30,7 +30,7 @@ class GreeterPrivate
3030{
3131public:
3232 explicit GreeterPrivate(Greeter* parent=0);
33− virtual ~GreeterPrivate() = default;
33+ virtual ~GreeterPrivate();
3434
3535 // These variables may not be used by all subclasses, that's no problem
3636 bool authenticated;
plugins/LightDM/liblightdm/UsersModel.h+2−2
@@ -53,8 +53,8 @@ public:
5353 BackgroundPathRole
5454 };
5555
56− int rowCount(const QModelIndex &parent) const;
57− QVariant data(const QModelIndex &index, int role) const;
56+ int rowCount(const QModelIndex &parent) const override;
57+ QVariant data(const QModelIndex &index, int role) const override;
5858
5959private:
6060 UsersModelPrivate * const d_ptr;
plugins/LightDM/plugin.h+1−1
@@ -29,7 +29,7 @@ class LightDMPlugin : public QQmlExtensionPlugin
2929 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
3030
3131public:
32− void registerTypes(const char *uri);
32+ void registerTypes(const char *uri) override;
3333};
3434
3535#endif
plugins/Lights/plugin.h+1−1
@@ -28,7 +28,7 @@ class LightsPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
plugins/Powerd/plugin.h+1−1
@@ -29,7 +29,7 @@ class PowerdPlugin : public QQmlExtensionPlugin
2929 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
3030
3131public:
32− void registerTypes(const char *uri);
32+ void registerTypes(const char *uri) override;
3333};
3434
3535#endif
plugins/ScreenGrabber/plugin.h+1−1
@@ -27,7 +27,7 @@ class ScreenGrabberPlugin : public QQmlExtensionPlugin
2727 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2828
2929public:
30− void registerTypes(const char *uri);
30+ void registerTypes(const char *uri) override;
3131};
3232
3333#endif // SCREENGRABBER_PLUGIN_H
plugins/SessionBroadcast/plugin.h+1−1
@@ -27,7 +27,7 @@ class SessionBroadcastPlugin : public QQmlExtensionPlugin
2727 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2828
2929public:
30− void registerTypes(const char *uri);
30+ void registerTypes(const char *uri) override;
3131};
3232
3333#endif
plugins/Ubuntu/DownloadDaemonListener/plugin.h+2−2
@@ -31,7 +31,7 @@ class BackendPlugin : public QQmlExtensionPlugin
3131 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
3232
3333public:
34− void registerTypes(const char *uri);
35− void initializeEngine(QQmlEngine *engine, const char *uri);
34+ void registerTypes(const char *uri) override;
35+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
3636};
3737#endif // BACKEND_PLUGIN_H
plugins/Ubuntu/Gestures/CMakeLists.txt+1
@@ -7,6 +7,7 @@ set(UbuntuGesturesQml_SOURCES
77 Damper.cpp
88 Direction.cpp
99 DirectionalDragArea.cpp
10+ FloatingFlickable.cpp
1011 PressedOutsideNotifier.cpp
1112 TouchDispatcher.cpp
1213 TouchGate.cpp
plugins/Ubuntu/Gestures/Direction.cpp+6−3
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -25,12 +25,15 @@ bool Direction::isHorizontal(Direction::Type type)
2525
2626bool Direction::isVertical(Direction::Type type)
2727{
28− return type == Direction::Upwards || type == Direction::Downwards;
28+ return type == Direction::Upwards
29+ || type == Direction::Downwards
30+ || type == Direction::Vertical;
2931}
3032
3133bool Direction::isPositive(Direction::Type type)
3234{
3335 return type == Rightwards
3436 || type == Downwards
35− || type == Horizontal;
37+ || type == Horizontal
38+ || type == Vertical;
3639}
plugins/Ubuntu/Gestures/Direction.h+3−2
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -34,7 +34,8 @@ public:
3434 Leftwards, // Along the negative direction of the X axis
3535 Downwards, // Along the positive direction of the Y axis
3636 Upwards, // Along the negative direction of the Y axis
37− Horizontal // Along the X axis, in any direction
37+ Horizontal, // Along the X axis, in any direction
38+ Vertical // Along the Y axis, in any direction
3839 };
3940
4041 Q_INVOKABLE static bool isHorizontal(Direction::Type type);
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+5−2
@@ -506,7 +506,7 @@ const QTouchEvent::TouchPoint *DirectionalDragAreaPrivate::fetchTargetTouchPoint
506506
507507bool DirectionalDragAreaPrivate::movingInRightDirection() const
508508{
509− if (direction == Direction::Horizontal) {
509+ if (direction == Direction::Horizontal || direction == Direction::Vertical) {
510510 return true;
511511 } else {
512512 QPointF movementVector(dampedScenePos.x() - previousDampedScenePos.x(),
@@ -532,7 +532,7 @@ bool DirectionalDragAreaPrivate::movedFarEnoughAlongGestureAxis() const
532532 ddaDebug(" movedFarEnoughAlongGestureAxis: scalarProjection=" << scalarProjection
533533 << ", distanceThreshold=" << distanceThreshold);
534534
535− if (direction == Direction::Horizontal) {
535+ if (direction == Direction::Horizontal || direction == Direction::Vertical) {
536536 return qAbs(scalarProjection) > distanceThreshold;
537537 } else {
538538 return scalarProjection > distanceThreshold;
@@ -712,6 +712,8 @@ void DirectionalDragArea::itemChange(ItemChange change, const ItemChangeData &va
712712{
713713 if (change == QQuickItem::ItemSceneChange) {
714714 if (value.window != nullptr) {
715+ value.window->installEventFilter(TouchRegistry::instance());
716+
715717 // TODO: Handle window->screen() changes (ie window changing screens)
716718 qreal pixelsPerMm = value.window->screen()->physicalDotsPerInch() / 25.4;
717719 d->setPixelsPerMm(pixelsPerMm);
@@ -843,6 +845,7 @@ void DirectionalDragAreaPrivate::updateSceneDirectionVector()
843845 localDirection.ry() = -1.;
844846 break;
845847 case Direction::Downwards:
848+ case Direction::Vertical:
846849 localDirection.rx() = 0.;
847850 localDirection.ry() = 1;
848851 break;
plugins/Ubuntu/Gestures/DirectionalDragArea.h+2−2
@@ -125,8 +125,8 @@ Q_SIGNALS:
125125 void immediateRecognitionChanged(bool value);
126126
127127protected:
128− virtual void touchEvent(QTouchEvent *event);
129− virtual void itemChange(ItemChange change, const ItemChangeData &value);
128+ void touchEvent(QTouchEvent *event) override;
129+ void itemChange(ItemChange change, const ItemChangeData &value) override;
130130
131131public: // so tests can access it
132132 DirectionalDragAreaPrivate *d;
plugins/Ubuntu/Gestures/FloatingFlickable.cppnew file+150
@@ -0,0 +1,150 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "FloatingFlickable.h"
18+
19+#include <private/qquickflickable_p.h>
20+#include "DirectionalDragArea.h"
21+
22+#include <QDebug>
23+
24+FloatingFlickable::FloatingFlickable(QQuickItem *parent)
25+ : QQuickItem(parent)
26+ , m_mousePressed(false)
27+{
28+ m_dragArea = new DirectionalDragArea(this);
29+ m_dragArea->setWidth(width());
30+ m_dragArea->setHeight(height());
31+ m_dragArea->setDirection(Direction::Horizontal);
32+ connect(m_dragArea, &DirectionalDragArea::touchXChanged,
33+ this, &FloatingFlickable::onDragAreaTouchPosChanged);
34+ connect(m_dragArea, &DirectionalDragArea::touchYChanged,
35+ this, &FloatingFlickable::onDragAreaTouchPosChanged);
36+ connect(m_dragArea, &DirectionalDragArea::draggingChanged,
37+ this, &FloatingFlickable::onDragAreaDraggingChanged);
38+ connect(m_dragArea, &DirectionalDragArea::directionChanged, this, &FloatingFlickable::directionChanged);
39+
40+ m_flickable = new QQuickFlickable(this);
41+ m_flickable->setEnabled(false);
42+ m_flickable->setWidth(width());
43+ m_flickable->setHeight(height());
44+ connect(m_flickable, &QQuickFlickable::contentWidthChanged, this, &FloatingFlickable::contentWidthChanged);
45+ connect(m_flickable, &QQuickFlickable::contentHeightChanged, this, &FloatingFlickable::contentHeightChanged);
46+ connect(m_flickable, &QQuickFlickable::contentXChanged, this, &FloatingFlickable::contentXChanged);
47+ connect(m_flickable, &QQuickFlickable::contentYChanged, this, &FloatingFlickable::contentYChanged);
48+
49+ connect(this, &QQuickItem::widthChanged, this, &FloatingFlickable::updateChildrenWidth);
50+ connect(this, &QQuickItem::heightChanged, this, &FloatingFlickable::updateChildrenHeight);
51+}
52+
53+qreal FloatingFlickable::contentWidth() const
54+{
55+ return m_flickable->contentWidth();
56+}
57+
58+void FloatingFlickable::setContentWidth(qreal contentWidth)
59+{
60+ m_flickable->setContentWidth(contentWidth);
61+}
62+
63+qreal FloatingFlickable::contentHeight() const
64+{
65+ return m_flickable->contentHeight();
66+}
67+
68+void FloatingFlickable::setContentHeight(qreal contentHeight)
69+{
70+ m_flickable->setContentHeight(contentHeight);
71+}
72+
73+qreal FloatingFlickable::contentX() const
74+{
75+ return m_flickable->contentX();
76+}
77+
78+void FloatingFlickable::setContentX(qreal contentX)
79+{
80+ m_flickable->setContentX(contentX);
81+}
82+
83+qreal FloatingFlickable::contentY() const
84+{
85+ return m_flickable->contentY();
86+}
87+
88+void FloatingFlickable::setContentY(qreal contentY)
89+{
90+ m_flickable->setContentY(contentY);
91+}
92+
93+Direction::Type FloatingFlickable::direction() const
94+{
95+ return m_dragArea->direction();
96+}
97+
98+void FloatingFlickable::setDirection(Direction::Type direction)
99+{
100+ m_dragArea->setDirection(direction);
101+ if (Direction::isHorizontal(direction)) {
102+ m_flickable->setFlickableDirection(QQuickFlickable::HorizontalFlick);
103+ } else {
104+ m_flickable->setFlickableDirection(QQuickFlickable::VerticalFlick);
105+ }
106+}
107+
108+void FloatingFlickable::updateChildrenWidth()
109+{
110+ m_dragArea->setWidth(width());
111+ m_flickable->setWidth(width());
112+}
113+
114+void FloatingFlickable::updateChildrenHeight()
115+{
116+ m_dragArea->setHeight(height());
117+ m_flickable->setHeight(height());
118+}
119+
120+void FloatingFlickable::onDragAreaTouchPosChanged(qreal)
121+{
122+ if (m_mousePressed) {
123+ QMouseEvent mouseEvent(QEvent::MouseMove,
124+ QPointF(m_dragArea->touchX(),m_dragArea->touchY()),
125+ Qt::NoButton, Qt::LeftButton, Qt::NoModifier);
126+
127+ QCoreApplication::sendEvent(m_flickable, &mouseEvent);
128+
129+ }
130+}
131+
132+void FloatingFlickable::onDragAreaDraggingChanged(bool dragging)
133+{
134+ if (dragging && !m_mousePressed) {
135+ QMouseEvent mouseEvent(QEvent::MouseButtonPress,
136+ QPointF(m_dragArea->touchX(),m_dragArea->touchY()),
137+ Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
138+
139+ QCoreApplication::sendEvent(m_flickable, &mouseEvent);
140+ m_mousePressed = true;
141+
142+ } else if (!dragging && m_mousePressed) {
143+ QMouseEvent mouseEvent(QEvent::MouseButtonRelease,
144+ QPointF(m_dragArea->touchX(),m_dragArea->touchY()),
145+ Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
146+
147+ QCoreApplication::sendEvent(m_flickable, &mouseEvent);
148+ m_mousePressed = false;
149+ }
150+}
plugins/Ubuntu/Gestures/FloatingFlickable.hnew file+86
@@ -0,0 +1,86 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef FLOATING_FLICKABLE_H
18+#define FLOATING_FLICKABLE_H
19+
20+#include <QQuickItem>
21+#include "UbuntuGesturesQmlGlobal.h"
22+#include "Direction.h"
23+
24+class DirectionalDragArea;
25+class QQuickFlickable;
26+
27+/*
28+ A Flickable that can be put in front of the item to be flicked and
29+ still have the item-to-be-flicked receive input events that are not flicks.
30+
31+ Ie, it's a Flickable that, input-wise, is transparent to non-flick gestures.
32+
33+ With a regular Flickable you would have to make the item-to-be-flicked a child
34+ of Flicakble to achieve the same result. FloatingFlickable has no such requirement
35+ or limitation.
36+ */
37+class UBUNTUGESTURESQML_EXPORT FloatingFlickable : public QQuickItem {
38+ Q_OBJECT
39+
40+ Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
41+ Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
42+ Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
43+ Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
44+
45+ Q_PROPERTY(Direction::Type direction READ direction WRITE setDirection NOTIFY directionChanged)
46+
47+Q_SIGNALS:
48+ void contentWidthChanged();
49+ void contentHeightChanged();
50+ void contentXChanged();
51+ void contentYChanged();
52+ void directionChanged();
53+
54+public:
55+ FloatingFlickable(QQuickItem *parent = nullptr);
56+
57+ qreal contentWidth() const;
58+ void setContentWidth(qreal contentWidth);
59+
60+ qreal contentHeight() const;
61+ void setContentHeight(qreal contentHeight);
62+
63+ qreal contentX() const;
64+ void setContentX(qreal contentX);
65+
66+ qreal contentY() const;
67+ void setContentY(qreal contentY);
68+
69+ Direction::Type direction() const;
70+ void setDirection(Direction::Type);
71+
72+private Q_SLOTS:
73+ void updateChildrenWidth();
74+ void updateChildrenHeight();
75+ void onDragAreaTouchPosChanged(qreal);
76+ void onDragAreaDraggingChanged(bool value);
77+
78+private:
79+ DirectionalDragArea *m_dragArea;
80+ QQuickFlickable *m_flickable;
81+ bool m_mousePressed;
82+
83+ friend class tst_FloatingFlickable;
84+};
85+
86+#endif // FLOATING_FLICKABLE_H
plugins/Ubuntu/Gestures/TouchGate.cpp+10
@@ -18,6 +18,7 @@
1818
1919#include <QCoreApplication>
2020#include <QDebug>
21+#include <QQuickWindow>
2122
2223#include <TouchOwnershipEvent.h>
2324#include <TouchRegistry.h>
@@ -102,6 +103,15 @@ void TouchGate::touchEvent(QTouchEvent *event)
102103 }
103104}
104105
106+void TouchGate::itemChange(ItemChange change, const ItemChangeData &value)
107+{
108+ if (change == QQuickItem::ItemSceneChange) {
109+ if (value.window != nullptr) {
110+ value.window->installEventFilter(TouchRegistry::instance());
111+ }
112+ }
113+}
114+
105115void TouchGate::touchOwnershipEvent(TouchOwnershipEvent *event)
106116{
107117 // TODO: Optimization: batch those actions as TouchOwnershipEvents
plugins/Ubuntu/Gestures/TouchGate.h+1
@@ -57,6 +57,7 @@ Q_SIGNALS:
5757
5858protected:
5959 void touchEvent(QTouchEvent *event) override;
60+ void itemChange(ItemChange change, const ItemChangeData &value) override;
6061
6162private Q_SLOTS:
6263 void onEnabledChanged();
plugins/Ubuntu/Gestures/plugin.cpp+3−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
1818#include "AxisVelocityCalculator.h"
1919#include "Direction.h"
2020#include "DirectionalDragArea.h"
21+#include "FloatingFlickable.h"
2122#include "PressedOutsideNotifier.h"
2223#include "TouchGate.h"
2324
@@ -34,6 +35,7 @@ void UbuntuGesturesQmlPlugin::registerTypes(const char *uri)
3435 qmlRegisterSingletonType<Direction>(uri, 0, 1, "Direction", directionSingleton);
3536 qmlRegisterType<DirectionalDragArea>(uri, 0, 1, "DirectionalDragArea");
3637 qmlRegisterType<AxisVelocityCalculator>(uri, 0, 1, "AxisVelocityCalculator");
38+ qmlRegisterType<FloatingFlickable>(uri, 0, 1, "FloatingFlickable");
3739 qmlRegisterType<PressedOutsideNotifier>(uri, 0, 1, "PressedOutsideNotifier");
3840 qmlRegisterType<TouchGate>(uri, 0, 1, "TouchGate");
3941}
plugins/Ubuntu/Gestures/plugin.h+1−1
@@ -24,7 +24,7 @@ class UbuntuGesturesQmlPlugin : public QQmlExtensionPlugin
2424 Q_OBJECT
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626public:
27− void registerTypes(const char *uri);
27+ void registerTypes(const char *uri) override;
2828};
2929
3030
plugins/Ubuntu/Payments/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
2929};
3030
3131#endif // PAYMENTS_PLUGIN_H
plugins/Ubuntu/SystemImage/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
2929};
3030
3131#endif // SYSTEMIMAGE_PLUGIN_H
plugins/Unity/Connectivity/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
2929};
3030
3131#endif // CONNECTIVITY_PLUGIN_H
plugins/Unity/DashCommunicator/plugin.h+1−1
@@ -28,7 +28,7 @@ class DashCommunicatorPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
plugins/Unity/Indicators/indicatorsmodel.h+5−5
@@ -50,11 +50,11 @@ public:
5050 void setProfile(const QString& profile);
5151
5252 /* QAbstractItemModel */
53− QHash<int, QByteArray> roleNames() const;
54− int columnCount(const QModelIndex &parent = QModelIndex()) const;
55− QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
56− QModelIndex parent (const QModelIndex &index) const;
57− int rowCount(const QModelIndex &parent = QModelIndex()) const;
53+ QHash<int, QByteArray> roleNames() const override;
54+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
55+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
56+ QModelIndex parent (const QModelIndex &index) const override;
57+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
5858
5959
6060Q_SIGNALS:
plugins/Unity/Indicators/menucontentactivator.cpp+4−4
@@ -28,10 +28,10 @@ public:
2828 connect(&m_timer, &QTimer::timeout,
2929 this, &UnityIndicators::AbstractTimer::timeout);
3030 }
31− virtual int interval() const { return m_timer.interval(); }
32− virtual void setInterval(int msecs) { m_timer.setInterval(msecs); }
33− virtual void start() { m_timer.start(); UnityIndicators::AbstractTimer::start(); }
34− virtual void stop() { m_timer.stop(); UnityIndicators::AbstractTimer::stop(); }
31+ int interval() const override { return m_timer.interval(); }
32+ void setInterval(int msecs) override { m_timer.setInterval(msecs); }
33+ void start() override { m_timer.start(); UnityIndicators::AbstractTimer::start(); }
34+ void stop() override { m_timer.stop(); UnityIndicators::AbstractTimer::stop(); }
3535private:
3636 QTimer m_timer;
3737};
plugins/Unity/Indicators/plugin.h+1−1
@@ -27,7 +27,7 @@ class IndicatorsPlugin : public QQmlExtensionPlugin
2727 Q_OBJECT
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929public:
30− void registerTypes(const char *uri);
30+ void registerTypes(const char *uri) override;
3131};
3232
3333#endif // INDICATORS2_PLUGIN_H
plugins/Unity/Launcher/launchermodel.h+10−10
@@ -41,19 +41,19 @@ public:
4141 LauncherModel(QObject *parent = 0);
4242 ~LauncherModel();
4343
44− int rowCount(const QModelIndex &parent = QModelIndex()) const;
44+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
4545
46− QVariant data(const QModelIndex &index, int role) const;
46+ QVariant data(const QModelIndex &index, int role) const override;
4747
48− Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const;
49− Q_INVOKABLE void move(int oldIndex, int newIndex);
50− Q_INVOKABLE void pin(const QString &appId, int index = -1);
51− Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
52− Q_INVOKABLE void setUser(const QString &username);
48+ Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
49+ Q_INVOKABLE void move(int oldIndex, int newIndex) override;
50+ Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
51+ Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
52+ Q_INVOKABLE void setUser(const QString &username) override;
5353 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
5454
55− unity::shell::application::ApplicationManagerInterface* applicationManager() const;
56− void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager);
55+ unity::shell::application::ApplicationManagerInterface* applicationManager() const override;
56+ void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager) override;
5757
5858 bool onlyPinned() const override;
5959 void setOnlyPinned(bool onlyPinned) override;
@@ -61,7 +61,7 @@ public:
6161 int findApplication(const QString &appId);
6262
6363public Q_SLOTS:
64− void requestRemove(const QString &appId);
64+ void requestRemove(const QString &appId) override;
6565 Q_INVOKABLE void refresh();
6666
6767private:
plugins/Unity/Launcher/plugin.h+1−1
@@ -28,7 +28,7 @@ class UnityLauncherPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
plugins/Unity/Launcher/quicklistmodel.h+2−2
@@ -48,8 +48,8 @@ public:
4848
4949 QuickListEntry get(int index) const;
5050
51− int rowCount(const QModelIndex &parent = QModelIndex()) const;
52− QVariant data(const QModelIndex &index, int role) const;
51+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
52+ QVariant data(const QModelIndex &index, int role) const override;
5353
5454private:
5555 QList<QuickListEntry> m_list;
plugins/Unity/Session/plugin.h+1−1
@@ -28,7 +28,7 @@ class SessionPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
plugins/Utils/HomeKeyWatcher.h+1−1
@@ -49,7 +49,7 @@ public:
4949
5050 virtual ~HomeKeyWatcher();
5151
52− bool eventFilter(QObject *watched, QEvent *event);
52+ bool eventFilter(QObject *watched, QEvent *event) override;
5353
5454 void update(QEvent *event);
5555
plugins/Utils/plugin.h+2−2
@@ -28,8 +28,8 @@ class UtilsPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
32− void initializeEngine(QQmlEngine *engine, const char *uri);
31+ void registerTypes(const char *uri) override;
32+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
3333};
3434
3535#endif
plugins/Utils/qlimitproxymodelqml.h+2−2
@@ -32,8 +32,8 @@ public:
3232
3333 /* getters */
3434 int limit() const;
35− int rowCount(const QModelIndex &parent = QModelIndex()) const;
36− QHash<int, QByteArray> roleNames() const;
35+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
36+ QHash<int, QByteArray> roleNames() const override;
3737
3838 /* setters */
3939 void setModel(QAbstractItemModel *model);
plugins/Utils/qvariantlistmodel.h+6−6
@@ -54,14 +54,14 @@ public:
5454
5555 ~QVariantListModel();
5656
57− int rowCount(const QModelIndex &parent = QModelIndex()) const;
58− QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
57+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
58+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
5959
60− QVariant data(const QModelIndex &index, int role) const;
61− bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
60+ QVariant data(const QModelIndex &index, int role) const override;
61+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
6262
63− bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
64− bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
63+ bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
64+ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
6565
6666 QVariantList variantList() const;
6767 void setVariantList(const QVariantList &list);
plugins/Utils/timeformatter.h+1−1
@@ -62,7 +62,7 @@ public:
6262 GDateTimeFormatter(QObject *parent = 0);
6363
6464protected:
65− virtual QString formatTime() const;
65+ QString formatTime() const override;
6666};
6767
6868#endif
plugins/Utils/unitysortfilterproxymodelqml.h+2−2
@@ -36,12 +36,12 @@ public:
3636 Q_INVOKABLE int count();
3737 Q_INVOKABLE int findFirst(int role, const QVariant& value) const;
3838 Q_INVOKABLE int mapRowToSource(int row);
39− virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
39+ bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
4040
4141 /* getters */
4242 int totalCount() const;
4343 bool invertMatch() const;
44− QHash<int, QByteArray> roleNames() const;
44+ QHash<int, QByteArray> roleNames() const override;
4545
4646 /* setters */
4747 void setModel(QAbstractItemModel *model);
plugins/Utils/windowkeysfilter.h+1−1
@@ -39,7 +39,7 @@ class WindowKeysFilter : public QQuickItem
3939public:
4040 WindowKeysFilter(QQuickItem *parent = 0);
4141
42− bool eventFilter(QObject *watched, QEvent *event);
42+ bool eventFilter(QObject *watched, QEvent *event) override;
4343
4444private Q_SLOTS:
4545 void setupFilterOnWindow(QQuickWindow *window);
plugins/Wizard/plugin.h+1−1
@@ -26,7 +26,7 @@ class WizardPlugin : public QQmlExtensionPlugin
2626 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2727
2828public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
3030};
3131
3232#endif
po/am.po+4−4
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity8\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-03-19 23:16+0000\n"
11+"PO-Revision-Date: 2015-05-24 14:07+0000\n"
1212"Last-Translator: samson <Unknown>\n"
1313"Language-Team: Amharic <am@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n > 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:47+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
18+"X-Launchpad-Export-Date: 2015-05-25 06:04+0000\n"
19+"X-Generator: Launchpad (build 17514)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -371,7 +371,7 @@ msgstr "እዚህ መታ ይድርጉ ለመቀጠል"
371371
372372#: qml/Tutorial/TutorialContent.qml:81
373373msgid "Click here to finish."
374−msgstr ""
374+msgstr "ለመጨረስ እዚህ ይጫኑ"
375375
376376#: qml/Tutorial/TutorialLeftFinish.qml:24
377377msgid "These are the shortcuts to favorite apps"
po/ast.po+86−86
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity8\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-03-02 18:12+0000\n"
12−"Last-Translator: ivarela <ivarela@ubuntu.com>\n"
11+"PO-Revision-Date: 2015-06-11 23:39+0000\n"
12+"Last-Translator: enolp <enolp@softastur.org>\n"
1313"Language-Team: Asturian <ast@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
18+"X-Launchpad-Export-Date: 2015-06-16 11:20+0000\n"
19+"X-Generator: Launchpad (build 17557)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -25,11 +25,11 @@ msgstr "Contraseña: "
2525#: plugins/Unity/Launcher/launcheritem.cpp:45
2626#: plugins/Unity/Launcher/launcheritem.cpp:100
2727msgid "Pin shortcut"
28−msgstr "Anclar"
28+msgstr "Anclar atayu"
2929
3030#: plugins/Unity/Launcher/launcheritem.cpp:100
3131msgid "Unpin shortcut"
32−msgstr "Desanclar"
32+msgstr "Desanclar atayu"
3333
3434#: qml/Components/DelayedLockscreen.qml:49
3535msgid "Device Locked"
@@ -37,7 +37,7 @@ msgstr "Preséu bloquiáu"
3737
3838#: qml/Components/DelayedLockscreen.qml:64
3939msgid "You have been locked out due to too many failed passphrase attempts."
40−msgstr "Quedasti bloquiáu polos escesivos intentos fallíos de frase de pasu."
40+msgstr "Quedasti bloquiáu polos escesivos intentos fallíos de fras de pasu."
4141
4242#: qml/Components/DelayedLockscreen.qml:65
4343msgid "You have been locked out due to too many failed passcode attempts."
@@ -48,27 +48,27 @@ msgstr ""
4848#, qt-format
4949msgid "Please wait %1 minute and then try again…"
5050msgid_plural "Please wait %1 minutes and then try again…"
51−msgstr[0] "Espera %1 minutu y vuelvi a intentalo…"
52−msgstr[1] "Espera %1 minutos y vuelvi a intentalo…"
51+msgstr[0] "Por favor, espera %1 minutu y vuelvi a intentalo…"
52+msgstr[1] "Por favor, espera %1 minutos y vuelvi a intentalo…"
5353
5454#: qml/Components/Dialogs.qml:69
5555msgctxt "Title: Lock/Log out dialog"
5656msgid "Log out"
57−msgstr ""
57+msgstr "Zarrar sesión"
5858
5959#: qml/Components/Dialogs.qml:70
6060msgid "Are you sure you want to log out?"
61−msgstr "De xuru que quies zarrar la sesión?"
61+msgstr "¿De xuru que quies zarrar la sesión?"
6262
6363#: qml/Components/Dialogs.qml:72
6464msgctxt "Button: Lock the system"
6565msgid "Lock"
66−msgstr ""
66+msgstr "Bloquiar"
6767
6868#: qml/Components/Dialogs.qml:79
6969msgctxt "Button: Log out from the system"
7070msgid "Log Out"
71−msgstr ""
71+msgstr "Zarrar sesión"
7272
7373#: qml/Components/Dialogs.qml:86 qml/Components/Dialogs.qml:117
7474#: qml/Components/Dialogs.qml:173
@@ -78,30 +78,30 @@ msgstr "Encaboxar"
7878#: qml/Components/Dialogs.qml:98
7979msgctxt "Title: Reboot/Shut down dialog"
8080msgid "Shut down"
81−msgstr ""
81+msgstr "Apagáu"
8282
8383#: qml/Components/Dialogs.qml:99
8484msgid "Are you sure you want to shut down?"
85−msgstr "De xuru que quies apagar?"
85+msgstr "¿De xuru que quies apagar?"
8686
8787#: qml/Components/Dialogs.qml:101
8888msgctxt "Button: Reboot the system"
8989msgid "Reboot"
90−msgstr ""
90+msgstr "Reaniciar"
9191
9292#: qml/Components/Dialogs.qml:109
9393msgctxt "Button: Shut down the system"
9494msgid "Shut down"
95−msgstr ""
95+msgstr "Apagar"
9696
9797#: qml/Components/Dialogs.qml:129
9898msgctxt "Title: Reboot dialog"
9999msgid "Reboot"
100−msgstr ""
100+msgstr "Reaniciu"
101101
102102#: qml/Components/Dialogs.qml:130
103103msgid "Are you sure you want to reboot?"
104−msgstr "De xuru que quies reaniciar?"
104+msgstr "¿De xuru que quies reaniciar?"
105105
106106#: qml/Components/Dialogs.qml:132
107107msgid "No"
@@ -121,18 +121,18 @@ msgid ""
121121"Are you sure you would like\n"
122122"to power off?"
123123msgstr ""
124−"De xuru que quies\n"
124+"¿De xuru que te prestaría\n"
125125"apagar?"
126126
127127#: qml/Components/Dialogs.qml:155
128128msgctxt "Button: Power off the system"
129129msgid "Power off"
130−msgstr ""
130+msgstr "Apagar"
131131
132132#: qml/Components/Dialogs.qml:164
133133msgctxt "Button: Restart the system"
134134msgid "Restart"
135−msgstr ""
135+msgstr "Reaniciar"
136136
137137#: qml/Components/Lockscreen.qml:245
138138msgid "Return to Call"
@@ -157,22 +157,22 @@ msgstr "Ver too"
157157#: qml/Dash/GenericScopeView.qml:594
158158msgctxt "Label: Hint for dash search line edit"
159159msgid "Search"
160−msgstr ""
160+msgstr "Guetar"
161161
162162#: qml/Dash/PageHeader.qml:269
163163msgctxt "Button: Open the Ubuntu Store"
164164msgid "Store"
165−msgstr ""
165+msgstr "Tienda"
166166
167167#: qml/Dash/PageHeader.qml:276
168168msgctxt "Button: Start a search in the current dash scope"
169169msgid "Search"
170−msgstr ""
170+msgstr "Guetar"
171171
172172#: qml/Dash/PageHeader.qml:286
173173msgctxt "Button: Show the current dash scope settings"
174174msgid "Settings"
175−msgstr ""
175+msgstr "Axustes"
176176
177177#: qml/Dash/PageHeader.qml:293
178178msgid "Remove from Favorites"
@@ -204,19 +204,19 @@ msgstr "Unviar"
204204
205205#: qml/Dash/PullToRefreshScopeStyle.qml:55
206206msgid "Pull to refresh…"
207−msgstr "Tirar p'anovar..."
207+msgstr "Tira p'anovar..."
208208
209209#: qml/Dash/PullToRefreshScopeStyle.qml:60
210210msgid "Release to refresh…"
211−msgstr "Soltar p'anovar..."
211+msgstr "Sueltar p'anovar..."
212212
213213#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
214214msgid "Enable location data"
215−msgstr "Activar datos de llocalización"
215+msgstr "Habilitar datos d'allugamientu"
216216
217217#: qml/Dash/ScopesList.qml:66
218218msgid "Manage"
219−msgstr "Alministrar"
219+msgstr "Xestionar"
220220
221221#: qml/Dash/ScopesList.qml:112
222222msgid "Home"
@@ -232,52 +232,52 @@ msgstr "Desbloquiar"
232232
233233#: qml/Greeter/LoginList.qml:236
234234msgid "Retry"
235−msgstr ""
235+msgstr "Reintentar"
236236
237237#: qml/Greeter/LoginList.qml:237
238238msgid "Tap to unlock"
239−msgstr ""
239+msgstr "Calca pa desbloquiar"
240240
241241#: qml/Greeter/NarrowView.qml:53 qml/Wizard/Pages/passwd-confirm.qml:53
242242msgid "Sorry, incorrect passphrase."
243−msgstr "Fras de pasu incorreuta"
243+msgstr "Perdón, fras de pasu incorreuta"
244244
245245#: qml/Greeter/NarrowView.qml:54 qml/Wizard/Pages/passwd-confirm.qml:54
246246msgid "Sorry, incorrect passcode."
247−msgstr "Códigu de pasu incorreutu"
247+msgstr "Perdón, códigu de pasu incorreutu."
248248
249249#: qml/Greeter/NarrowView.qml:55
250250msgid "This will be your last attempt."
251−msgstr "Esti ye'l caberu intentu."
251+msgstr "Esti sedra'l to caberu intentu"
252252
253253#: qml/Greeter/NarrowView.qml:57
254254msgid ""
255255"If passphrase is entered incorrectly, your phone will conduct a factory "
256256"reset and all personal data will be deleted."
257257msgstr ""
258−"Si s'inxerta la fras incorreutamente, el teléfonu va volver a la "
259−"configuración de fábrica y van perdese tolos datos personales."
258+"Si s'inxerta la fras de pasu incorreutamente, el to teléfonu va reafitase y "
259+"van desaniciase tolos datos personales."
260260
261261#: qml/Greeter/NarrowView.qml:58
262262msgid ""
263263"If passcode is entered incorrectly, your phone will conduct a factory reset "
264264"and all personal data will be deleted."
265265msgstr ""
266−"Si s'inxerta'l códigu incorreutamente, el teléfonu va volver a la "
267−"configuración de fábrica y van perdese tolos datos personales."
266+"Si s'inxerta'l códigu de pasu incorreutamente, el to teléfonu va reafitase y "
267+"van desaniciase tolos datos personales."
268268
269269#: qml/Greeter/NarrowView.qml:115
270270#, qt-format
271271msgid "Enter %1"
272−msgstr "Escribi %1"
272+msgstr "Introduz %1"
273273
274274#: qml/Greeter/NarrowView.qml:116 qml/Wizard/Pages/passwd-set.qml:60
275275msgid "Enter passphrase"
276−msgstr "Escribi la frase contraseña"
276+msgstr "Introduz la fras de pasu"
277277
278278#: qml/Greeter/NarrowView.qml:117
279279msgid "Enter passcode"
280−msgstr "Escribi'l códigu de pasu"
280+msgstr "Introduz el códigu de pasu"
281281
282282#: qml/Greeter/NarrowView.qml:118
283283#, qt-format
@@ -290,7 +290,7 @@ msgstr "Sentímoslo, contraseña incorreuta"
290290
291291#: qml/Greeter/NarrowView.qml:120
292292msgid "Please re-enter"
293−msgstr "Vuelvi a escribila"
293+msgstr "Por favor, reintroduzla"
294294
295295#: qml/Greeter/NarrowView.qml:121
296296msgid "Sorry, incorrect passcode"
@@ -302,7 +302,7 @@ msgstr "Amosar contraseña"
302302
303303#: qml/Panel/ActiveCallHint.qml:79
304304msgid "Tap to return to call..."
305−msgstr "Tocar pa tornar a la llamada..."
305+msgstr "Toca pa tornar a la llamada..."
306306
307307#: qml/Panel/ActiveCallHint.qml:92
308308msgid "Conference"
@@ -310,11 +310,11 @@ msgstr "Conferencia"
310310
311311#: qml/Panel/Indicators/MenuItemFactory.qml:639
312312msgid "Nothing is playing"
313−msgstr "Nun hai nada en reproducción"
313+msgstr "Nun ta reproduciéndose nada"
314314
315315#: qml/Panel/Indicators/MenuItemFactory.qml:787
316316msgid "In queue…"
317−msgstr "N'espera…"
317+msgstr "Na cola..."
318318
319319#: qml/Panel/Indicators/MenuItemFactory.qml:791
320320msgid "Downloading"
@@ -339,7 +339,7 @@ msgstr "Falló, toca pa reintentar"
339339#: qml/Panel/Indicators/MessageMenuItemFactory.qml:149
340340msgctxt "Label: Hint in message indicator line edit"
341341msgid "Reply"
342−msgstr ""
342+msgstr "Responder"
343343
344344#: qml/Panel/Indicators/ModemInfoItem.qml:105
345345msgid "Unlock SIM"
@@ -351,7 +351,7 @@ msgstr "Roaming"
351351
352352#: qml/Tutorial/TutorialBottomFinish.qml:24
353353msgid "This action does different things for different apps"
354−msgstr "Esta aición tiene efeutos distintos en cada aplicación"
354+msgstr "Esta aición fai coses distintes p'aplicaciones estremaes"
355355
356356#: qml/Tutorial/TutorialBottomFinish.qml:25
357357msgid "Tap here to finish."
@@ -363,7 +363,7 @@ msgstr "Abrir menús especiales"
363363
364364#: qml/Tutorial/TutorialBottom.qml:29
365365msgid "Swipe up from the bottom edge."
366−msgstr ""
366+msgstr "Esliza dende'l berbesu d'embaxo."
367367
368368#: qml/Tutorial/TutorialContent.qml:81 qml/Tutorial/TutorialLeftFinish.qml:25
369369#: qml/Tutorial/TutorialRight.qml:144
@@ -372,11 +372,11 @@ msgstr "Toca equí pa siguir."
372372
373373#: qml/Tutorial/TutorialContent.qml:81
374374msgid "Click here to finish."
375−msgstr ""
375+msgstr "Primi equí pa finar."
376376
377377#: qml/Tutorial/TutorialLeftFinish.qml:24
378378msgid "These are the shortcuts to favorite apps"
379−msgstr ""
379+msgstr "Estos son los atayos a les aplicaciones favorites"
380380
381381#: qml/Tutorial/TutorialLeft.qml:26
382382msgid "Open the launcher"
@@ -384,44 +384,44 @@ msgstr "Abrir el llanzador"
384384
385385#: qml/Tutorial/TutorialLeft.qml:27
386386msgid "Short swipe from the left edge."
387−msgstr ""
387+msgstr "Esliza un poco dende'l berbesu esquierdu."
388388
389389#: qml/Tutorial/TutorialPage.qml:178
390390msgid "You almost got it!"
391−msgstr ""
391+msgstr "¡Yá cuasi finamos!"
392392
393393#: qml/Tutorial/TutorialPage.qml:195
394394msgid "Try again."
395−msgstr ""
395+msgstr "Intentar de nueves"
396396
397397#: qml/Tutorial/TutorialRight.qml:31
398398msgid "To view open apps"
399−msgstr ""
399+msgstr "Pa ver aplicaciones abiertes"
400400
401401#: qml/Tutorial/TutorialRight.qml:32
402402msgid "Long swipe from the right edge."
403−msgstr ""
403+msgstr "Eslizamientu llargu dende'l berbesu drechu."
404404
405405#: qml/Tutorial/TutorialRight.qml:122
406406msgid "View all your running tasks."
407−msgstr ""
407+msgstr "Mira toles tos aplicaciones n'execución."
408408
409409#: qml/Wizard/Page.qml:89
410410msgctxt "Button: Go back one page in the Wizard"
411411msgid "Back"
412−msgstr ""
412+msgstr "Atrás"
413413
414414#: qml/Wizard/Pages/10-welcome.qml:27
415415msgid "Hi!"
416−msgstr "Hola!"
416+msgstr "¡Hola!"
417417
418418#: qml/Wizard/Pages/10-welcome.qml:44
419419msgid "Welcome to your Ubuntu phone."
420−msgstr "Dámoste l'acoyida a Ubuntu Phone"
420+msgstr "Bienllegáu/ada al to teléfonu d'Ubuntu"
421421
422422#: qml/Wizard/Pages/10-welcome.qml:52
423423msgid "Let’s get started."
424−msgstr "Entamamos."
424+msgstr "Entamemos."
425425
426426#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
427427#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
@@ -432,7 +432,7 @@ msgstr "Siguir"
432432
433433#: qml/Wizard/Pages/20-sim.qml:25
434434msgid "Add a SIM card and restart your device"
435−msgstr "Amiesta una tarxeta SIM y reanicia'l preséu"
435+msgstr "Amiesta una tarxeta SIM y reanicia'l to preséu"
436436
437437#: qml/Wizard/Pages/20-sim.qml:59
438438msgid "Without it, you won’t be able to make calls or use text messaging."
@@ -440,49 +440,49 @@ msgstr "Ensin ella, nun vas poder facer llamaes nin unviar mensaxes."
440440
441441#: qml/Wizard/Pages/20-sim.qml:73 qml/Wizard/Pages/40-wifi.qml:215
442442msgid "Skip"
443−msgstr "Omitir"
443+msgstr "Saltar"
444444
445445#: qml/Wizard/Pages/30-passwd-type.qml:39
446446msgid "Lock security"
447−msgstr "Seguridá de bloquéu"
447+msgstr "Seguranza del bloquéu"
448448
449449#: qml/Wizard/Pages/30-passwd-type.qml:74
450450msgid "Please select how you’d like to unlock your phone."
451−msgstr "Seleiciona cómo te prestaría desbloquiar el teléfonu."
451+msgstr "Por favor, esbilla como te prestaría desbloquiar el teléfonu."
452452
453453#: qml/Wizard/Pages/30-passwd-type.qml:97
454454msgctxt "Label: Type of security method"
455455msgid "Swipe"
456−msgstr ""
456+msgstr "Eslizar"
457457
458458#: qml/Wizard/Pages/30-passwd-type.qml:98
459459msgctxt "Label: Description of security method"
460460msgid "No security"
461−msgstr ""
461+msgstr "Ensin seguranza"
462462
463463#: qml/Wizard/Pages/30-passwd-type.qml:100
464464msgctxt "Label: Type of security method"
465465msgid "Passcode"
466−msgstr ""
466+msgstr "Códigu de pasu"
467467
468468#: qml/Wizard/Pages/30-passwd-type.qml:101
469469msgctxt "Label: Description of security method"
470470msgid "4 digits only"
471−msgstr ""
471+msgstr "Namái 4 díxitos"
472472
473473#: qml/Wizard/Pages/30-passwd-type.qml:103
474474msgctxt "Label: Type of security method"
475475msgid "Passphrase"
476−msgstr ""
476+msgstr "Fras de pasu"
477477
478478#: qml/Wizard/Pages/30-passwd-type.qml:104
479479msgctxt "Label: Description of security method"
480480msgid "Numbers and letters"
481−msgstr ""
481+msgstr "Númberos y lletres"
482482
483483#: qml/Wizard/Pages/40-wifi.qml:29
484484msgid "Connect to Wi‑Fi"
485−msgstr "Coneutar a WiFi"
485+msgstr "Coneutase al WiFi"
486486
487487#: qml/Wizard/Pages/40-wifi.qml:168
488488msgid "Available networks…"
@@ -494,11 +494,11 @@ msgstr "Nun hai redes disponibles"
494494
495495#: qml/Wizard/Pages/50-location.qml:27
496496msgid "Location"
497−msgstr "Llocalización"
497+msgstr "Allugamientu"
498498
499499#: qml/Wizard/Pages/50-location.qml:62
500500msgid "Let the phone detect your location:"
501−msgstr "Permitir al teléfonu deteutar la llocalización:"
501+msgstr "Dexar al teléfonu deteutar l'allugamientu:"
502502
503503#: qml/Wizard/Pages/50-location.qml:69
504504msgid "Using GPS only (less accurate)"
@@ -507,7 +507,7 @@ msgstr "Namái usando GPS (menos precisión)"
507507#: qml/Wizard/Pages/50-location.qml:86
508508msgid "Using GPS, anonymized Wi-Fi and cellular network info (recommended)"
509509msgstr ""
510−"Usando GPS, Wifi anónimes ya información de redes móviles (recomiéndase)"
510+"Usando GPS, Wi-fi anónimes ya información de redes móviles (aconseyao)"
511511
512512#. TRANSLATORS: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
513513#: qml/Wizard/Pages/50-location.qml:103
@@ -515,8 +515,8 @@ msgid ""
515515"By selecting this option you agree to the Nokia HERE <a href='#'>terms and "
516516"conditions</a>."
517517msgstr ""
518−"Seleicionando esta opción, aceutes los <a href='#'>términos y "
519−"condiciones</a> de Nokia HERE."
518+"Esbillando esta opción aceutes los <a href='#'>términos y condiciones</a> de "
519+"Nokia HERE."
520520
521521#: qml/Wizard/Pages/50-location.qml:112
522522msgid "Not at all"
@@ -528,7 +528,7 @@ msgstr "Pues cambialo dempués n'<b>Axustes del sistema</b>."
528528
529529#: qml/Wizard/Pages/60-reporting.qml:24
530530msgid "Improving your experience"
531−msgstr "Ameyorar la esperiencia"
531+msgstr "Ameyorando la to esperiencia"
532532
533533#: qml/Wizard/Pages/60-reporting.qml:36
534534msgid ""
@@ -543,7 +543,7 @@ msgid ""
543543"This can be disabled in <b>System Settings</b> under <b>Security &amp; "
544544"Privacy</b>"
545545msgstr ""
546−"Esto pue desactivase nos <b>Axustes del sistema</b> en <b>Seguranza y "
546+"Esto pue deshabilitase nos <b>Axustes del sistema</b> en <b>Seguranza y "
547547"privacidá</b>"
548548
549549#: qml/Wizard/Pages/80-finished.qml:24
@@ -552,11 +552,11 @@ msgstr "Too fecho"
552552
553553#: qml/Wizard/Pages/80-finished.qml:39
554554msgid "Nice work!"
555−msgstr "Bon trabayu!"
555+msgstr "¡Bon trabayu!"
556556
557557#: qml/Wizard/Pages/80-finished.qml:46
558558msgid "Your phone is now ready to use."
559−msgstr "El teléfonu yá ta preparáu pa usar."
559+msgstr "El teléfonu yá ta tresnáu pa usase."
560560
561561#: qml/Wizard/Pages/80-finished.qml:53
562562msgid "Finish"
@@ -568,24 +568,24 @@ msgstr "Términos y condiciones"
568568
569569#: qml/Wizard/Pages/passwd-confirm.qml:49
570570msgid "Confirm passphrase"
571−msgstr "Confirmar fras secreta"
571+msgstr "Confirmar frase de pasu"
572572
573573#: qml/Wizard/Pages/passwd-confirm.qml:50
574574msgid "Confirm passcode"
575−msgstr "Confirmar el códigu de pasu"
575+msgstr "Confirmar códigu de pasu"
576576
577577#: qml/Wizard/Pages/passwd-confirm.qml:53
578578#: qml/Wizard/Pages/passwd-confirm.qml:54
579579msgid "Please try again."
580−msgstr "Vuelvi a intentalo."
580+msgstr "Por favor, vuelvi a intentalo."
581581
582582#: qml/Wizard/Pages/passwd-set.qml:61
583583msgid "Choose your passcode"
584−msgstr "Escueyi'l códigu de pasu"
584+msgstr "Escueyi'l to códigu de pasu"
585585
586586#: qml/Wizard/Pages/passwd-set.qml:68
587587msgid "Passphrase must be 4 characters long"
588−msgstr "La fras de contraseña tien de ser de 4 caráuteres"
588+msgstr "La fras de pasu tien de ser 4 caráuteres de llargor"
589589
590590#: qml/Wizard/StackButton.qml:39
591591#, qt-format
po/eo.po+6−6
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2013-06-26 22:35+0000\n"
12−"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11+"PO-Revision-Date: 2015-06-06 23:37+0000\n"
12+"Last-Translator: Eliovir <Unknown>\n"
1313"Language-Team: Esperanto <eo@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
18+"X-Launchpad-Export-Date: 2015-06-08 05:26+0000\n"
19+"X-Generator: Launchpad (build 17540)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -197,7 +197,7 @@ msgstr ""
197197
198198#: qml/Dash/Previews/PreviewRatingInput.qml:166
199199msgid "Send"
200−msgstr ""
200+msgstr "Sendi"
201201
202202#: qml/Dash/PullToRefreshScopeStyle.qml:55
203203msgid "Pull to refresh…"
@@ -291,7 +291,7 @@ msgstr ""
291291
292292#: qml/Notifications/NotificationMenuItemFactory.qml:128
293293msgid "Show password"
294−msgstr ""
294+msgstr "Montri pasvorton"
295295
296296#: qml/Panel/ActiveCallHint.qml:79
297297msgid "Tap to return to call..."
po/fi.po+4−4
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-03-25 07:55+0000\n"
11+"PO-Revision-Date: 2015-05-19 09:14+0000\n"
1212"Last-Translator: Jiri Grönroos <Unknown>\n"
1313"Language-Team: Finnish <fi@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
18+"X-Launchpad-Export-Date: 2015-05-22 05:09+0000\n"
19+"X-Generator: Launchpad (build 17514)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -373,7 +373,7 @@ msgstr "Napauta tästä jatkaaksesi."
373373
374374#: qml/Tutorial/TutorialContent.qml:81
375375msgid "Click here to finish."
376−msgstr ""
376+msgstr "Viimeistele napsauttamalla tästä."
377377
378378#: qml/Tutorial/TutorialLeftFinish.qml:24
379379msgid "These are the shortcuts to favorite apps"
po/ia.po+94−83
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity8\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-04-27 10:07+0000\n"
12−"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11+"PO-Revision-Date: 2015-06-08 18:58+0000\n"
12+"Last-Translator: karm <melo@carmu.com>\n"
1313"Language-Team: Interlingua <ia@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-28 05:33+0000\n"
19−"X-Generator: Launchpad (build 17453)\n"
18+"X-Launchpad-Export-Date: 2015-06-09 05:42+0000\n"
19+"X-Generator: Launchpad (build 17549)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -29,7 +29,7 @@ msgstr "Via-breve a pin"
2929
3030#: plugins/Unity/Launcher/launcheritem.cpp:100
3131msgid "Unpin shortcut"
32−msgstr "Via-breve levar pin"
32+msgstr "Via-breve a levar pin"
3333
3434#: qml/Components/DelayedLockscreen.qml:49
3535msgid "Device Locked"
@@ -49,13 +49,13 @@ msgstr ""
4949#, qt-format
5050msgid "Please wait %1 minute and then try again…"
5151msgid_plural "Please wait %1 minutes and then try again…"
52−msgstr[0] "Per favor attende %1 minuta e postea tentar de nove"
52+msgstr[0] "Per favor attende %1 minuta e postea tenta de nove"
5353msgstr[1] "Per favor attende %1 minutas e postea tentar de nove"
5454
5555#: qml/Components/Dialogs.qml:69
5656msgctxt "Title: Lock/Log out dialog"
5757msgid "Log out"
58−msgstr ""
58+msgstr "Clauder de session"
5959
6060#: qml/Components/Dialogs.qml:70
6161msgid "Are you sure you want to log out?"
@@ -64,12 +64,12 @@ msgstr "Desira tu vermente Clauder le Session"
6464#: qml/Components/Dialogs.qml:72
6565msgctxt "Button: Lock the system"
6666msgid "Lock"
67−msgstr ""
67+msgstr "Blocar"
6868
6969#: qml/Components/Dialogs.qml:79
7070msgctxt "Button: Log out from the system"
7171msgid "Log Out"
72−msgstr ""
72+msgstr "Claude session"
7373
7474#: qml/Components/Dialogs.qml:86 qml/Components/Dialogs.qml:117
7575#: qml/Components/Dialogs.qml:173
@@ -79,7 +79,7 @@ msgstr "Cancellar"
7979#: qml/Components/Dialogs.qml:98
8080msgctxt "Title: Reboot/Shut down dialog"
8181msgid "Shut down"
82−msgstr ""
82+msgstr "Stoppar"
8383
8484#: qml/Components/Dialogs.qml:99
8585msgid "Are you sure you want to shut down?"
@@ -88,21 +88,21 @@ msgstr "Desira tu vermente Stoppar"
8888#: qml/Components/Dialogs.qml:101
8989msgctxt "Button: Reboot the system"
9090msgid "Reboot"
91−msgstr ""
91+msgstr "Reinitiar"
9292
9393#: qml/Components/Dialogs.qml:109
9494msgctxt "Button: Shut down the system"
9595msgid "Shut down"
96−msgstr ""
96+msgstr "Stoppar"
9797
9898#: qml/Components/Dialogs.qml:129
9999msgctxt "Title: Reboot dialog"
100100msgid "Reboot"
101−msgstr ""
101+msgstr "Reinitiar"
102102
103103#: qml/Components/Dialogs.qml:130
104104msgid "Are you sure you want to reboot?"
105−msgstr "Desira tu vermente Reinitiar"
105+msgstr "Desira tu vermente reinitiar"
106106
107107#: qml/Components/Dialogs.qml:132
108108msgid "No"
@@ -115,7 +115,7 @@ msgstr "Si"
115115#: qml/Components/Dialogs.qml:152
116116msgctxt "Title: Power off/Restart dialog"
117117msgid "Power"
118−msgstr ""
118+msgstr "Energia"
119119
120120#: qml/Components/Dialogs.qml:153
121121msgid ""
@@ -123,17 +123,17 @@ msgid ""
123123"to power off?"
124124msgstr ""
125125"Desira tu vermente \n"
126−"Stoppar le energia?"
126+"stoppar le energia?"
127127
128128#: qml/Components/Dialogs.qml:155
129129msgctxt "Button: Power off the system"
130130msgid "Power off"
131−msgstr ""
131+msgstr "Stoppar le energia"
132132
133133#: qml/Components/Dialogs.qml:164
134134msgctxt "Button: Restart the system"
135135msgid "Restart"
136−msgstr ""
136+msgstr "Reinitiar"
137137
138138#: qml/Components/Lockscreen.qml:245
139139msgid "Return to Call"
@@ -158,22 +158,22 @@ msgstr "Vider toto"
158158#: qml/Dash/GenericScopeView.qml:594
159159msgctxt "Label: Hint for dash search line edit"
160160msgid "Search"
161−msgstr ""
161+msgstr "Cerca"
162162
163163#: qml/Dash/PageHeader.qml:269
164164msgctxt "Button: Open the Ubuntu Store"
165165msgid "Store"
166−msgstr ""
166+msgstr "Salva"
167167
168168#: qml/Dash/PageHeader.qml:276
169169msgctxt "Button: Start a search in the current dash scope"
170170msgid "Search"
171−msgstr ""
171+msgstr "Cerca"
172172
173173#: qml/Dash/PageHeader.qml:286
174174msgctxt "Button: Show the current dash scope settings"
175175msgid "Settings"
176−msgstr ""
176+msgstr "Configurationes"
177177
178178#: qml/Dash/PageHeader.qml:293
179179msgid "Remove from Favorites"
@@ -213,7 +213,7 @@ msgstr "Relaxar pro renovar…"
213213
214214#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
215215msgid "Enable location data"
216−msgstr ""
216+msgstr "Habilita le datos del location"
217217
218218#: qml/Dash/ScopesList.qml:66
219219msgid "Manage"
@@ -233,11 +233,11 @@ msgstr "Liberar"
233233
234234#: qml/Greeter/LoginList.qml:236
235235msgid "Retry"
236−msgstr ""
236+msgstr "Re-provar"
237237
238238#: qml/Greeter/LoginList.qml:237
239239msgid "Tap to unlock"
240−msgstr ""
240+msgstr "Pulsa pro liberar"
241241
242242#: qml/Greeter/NarrowView.qml:53 qml/Wizard/Pages/passwd-confirm.qml:53
243243msgid "Sorry, incorrect passphrase."
@@ -299,7 +299,7 @@ msgstr "Displacente, codice-contrasigno incorrecte"
299299
300300#: qml/Notifications/NotificationMenuItemFactory.qml:128
301301msgid "Show password"
302−msgstr "Monstra le contrasigno"
302+msgstr "Monstrar le contrasigno"
303303
304304#: qml/Panel/ActiveCallHint.qml:79
305305msgid "Tap to return to call..."
@@ -340,7 +340,7 @@ msgstr "Fallite, colpar pro re-provar"
340340#: qml/Panel/Indicators/MessageMenuItemFactory.qml:149
341341msgctxt "Label: Hint in message indicator line edit"
342342msgid "Reply"
343−msgstr ""
343+msgstr "Responde"
344344
345345#: qml/Panel/Indicators/ModemInfoItem.qml:105
346346msgid "Unlock SIM"
@@ -352,162 +352,165 @@ msgstr "Roaming"
352352
353353#: qml/Tutorial/TutorialBottomFinish.qml:24
354354msgid "This action does different things for different apps"
355−msgstr ""
355+msgstr "Iste action ha effectos differente pro applicationes differente"
356356
357357#: qml/Tutorial/TutorialBottomFinish.qml:25
358358msgid "Tap here to finish."
359−msgstr ""
359+msgstr "Pulsa ci pro finir"
360360
361361#: qml/Tutorial/TutorialBottom.qml:28
362362msgid "Open special menus"
363−msgstr ""
363+msgstr "Aperi le menus special"
364364
365365#: qml/Tutorial/TutorialBottom.qml:29
366366msgid "Swipe up from the bottom edge."
367−msgstr ""
367+msgstr "Stria in alto ex le bordo basse."
368368
369369#: qml/Tutorial/TutorialContent.qml:81 qml/Tutorial/TutorialLeftFinish.qml:25
370370#: qml/Tutorial/TutorialRight.qml:144
371371msgid "Tap here to continue."
372−msgstr ""
372+msgstr "Pulsa ci pro continuar"
373373
374374#: qml/Tutorial/TutorialContent.qml:81
375375msgid "Click here to finish."
376−msgstr ""
376+msgstr "Clicca ci pro finir"
377377
378378#: qml/Tutorial/TutorialLeftFinish.qml:24
379379msgid "These are the shortcuts to favorite apps"
380−msgstr ""
380+msgstr "Iste es le vias breve al applicationes favorite"
381381
382382#: qml/Tutorial/TutorialLeft.qml:26
383383msgid "Open the launcher"
384−msgstr ""
384+msgstr "Aperi le lanceator"
385385
386386#: qml/Tutorial/TutorialLeft.qml:27
387387msgid "Short swipe from the left edge."
388−msgstr ""
388+msgstr "Stria curte ex le bordo sinistre."
389389
390390#: qml/Tutorial/TutorialPage.qml:178
391391msgid "You almost got it!"
392−msgstr ""
392+msgstr "Tu ha quasi obtenite lo!"
393393
394394#: qml/Tutorial/TutorialPage.qml:195
395395msgid "Try again."
396−msgstr ""
396+msgstr "Prova de novo"
397397
398398#: qml/Tutorial/TutorialRight.qml:31
399399msgid "To view open apps"
400−msgstr ""
400+msgstr "Aperi le applicationes pro vider"
401401
402402#: qml/Tutorial/TutorialRight.qml:32
403403msgid "Long swipe from the right edge."
404−msgstr ""
404+msgstr "Stria longemente ex le bordo dextre."
405405
406406#: qml/Tutorial/TutorialRight.qml:122
407407msgid "View all your running tasks."
408−msgstr ""
408+msgstr "Vide tote tu tasks fluente"
409409
410410#: qml/Wizard/Page.qml:89
411411msgctxt "Button: Go back one page in the Wizard"
412412msgid "Back"
413−msgstr ""
413+msgstr "Retro"
414414
415415#: qml/Wizard/Pages/10-welcome.qml:27
416416msgid "Hi!"
417−msgstr ""
417+msgstr "Salute!"
418418
419419#: qml/Wizard/Pages/10-welcome.qml:44
420420msgid "Welcome to your Ubuntu phone."
421−msgstr ""
421+msgstr "Benvenite a tu telephono Ubuntu."
422422
423423#: qml/Wizard/Pages/10-welcome.qml:52
424424msgid "Let’s get started."
425−msgstr ""
425+msgstr "Que nos initia."
426426
427427#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
428428#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
429429#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
430430#: qml/Wizard/Pages/passwd-set.qml:90
431431msgid "Continue"
432−msgstr ""
432+msgstr "Continua"
433433
434434#: qml/Wizard/Pages/20-sim.qml:25
435435msgid "Add a SIM card and restart your device"
436−msgstr ""
436+msgstr "Adde un carta SIM e reinitia tu dispositivo"
437437
438438#: qml/Wizard/Pages/20-sim.qml:59
439439msgid "Without it, you won’t be able to make calls or use text messaging."
440440msgstr ""
441+"Sin illo, tu non es habile a facer appellos o usar le messages de texto."
441442
442443#: qml/Wizard/Pages/20-sim.qml:73 qml/Wizard/Pages/40-wifi.qml:215
443444msgid "Skip"
444−msgstr ""
445+msgstr "Salta"
445446
446447#: qml/Wizard/Pages/30-passwd-type.qml:39
447448msgid "Lock security"
448−msgstr ""
449+msgstr "Bloco de securitate"
449450
450451#: qml/Wizard/Pages/30-passwd-type.qml:74
451452msgid "Please select how you’d like to unlock your phone."
452−msgstr ""
453+msgstr "Per favor selige in qual maniera disblocar tu telephono."
453454
454455#: qml/Wizard/Pages/30-passwd-type.qml:97
455456msgctxt "Label: Type of security method"
456457msgid "Swipe"
457−msgstr ""
458+msgstr "Striar"
458459
459460#: qml/Wizard/Pages/30-passwd-type.qml:98
460461msgctxt "Label: Description of security method"
461462msgid "No security"
462−msgstr ""
463+msgstr "Nulle securitate"
463464
464465#: qml/Wizard/Pages/30-passwd-type.qml:100
465466msgctxt "Label: Type of security method"
466467msgid "Passcode"
467−msgstr ""
468+msgstr "Codice-contrasigno"
468469
469470#: qml/Wizard/Pages/30-passwd-type.qml:101
470471msgctxt "Label: Description of security method"
471472msgid "4 digits only"
472−msgstr ""
473+msgstr "4 cifras sol"
473474
474475#: qml/Wizard/Pages/30-passwd-type.qml:103
475476msgctxt "Label: Type of security method"
476477msgid "Passphrase"
477−msgstr ""
478+msgstr "Phrase-contrasigno"
478479
479480#: qml/Wizard/Pages/30-passwd-type.qml:104
480481msgctxt "Label: Description of security method"
481482msgid "Numbers and letters"
482−msgstr ""
483+msgstr "Numeros e litteras"
483484
484485#: qml/Wizard/Pages/40-wifi.qml:29
485486msgid "Connect to Wi‑Fi"
486−msgstr ""
487+msgstr "Connecter al Wi‑Fi"
487488
488489#: qml/Wizard/Pages/40-wifi.qml:168
489490msgid "Available networks…"
490−msgstr ""
491+msgstr "Retes disponibile..."
491492
492493#: qml/Wizard/Pages/40-wifi.qml:169
493494msgid "No available networks."
494−msgstr ""
495+msgstr "Nulle rete disponibile."
495496
496497#: qml/Wizard/Pages/50-location.qml:27
497498msgid "Location"
498−msgstr ""
499+msgstr "Location"
499500
500501#: qml/Wizard/Pages/50-location.qml:62
501502msgid "Let the phone detect your location:"
502−msgstr ""
503+msgstr "Lassar le telephono disvelar tu position:"
503504
504505#: qml/Wizard/Pages/50-location.qml:69
505506msgid "Using GPS only (less accurate)"
506−msgstr ""
507+msgstr "Usar sol le GPS (minus accurate)"
507508
508509#: qml/Wizard/Pages/50-location.qml:86
509510msgid "Using GPS, anonymized Wi-Fi and cellular network info (recommended)"
510511msgstr ""
512+"Usar le GPS, le Wi-Fi in modo anonyme e le informationes del rete cellular "
513+"(recommendate)"
511514
512515#. TRANSLATORS: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
513516#: qml/Wizard/Pages/50-location.qml:103
@@ -515,81 +518,89 @@ msgid ""
515518"By selecting this option you agree to the Nokia HERE <a href='#'>terms and "
516519"conditions</a>."
517520msgstr ""
521+"Per le selection de iste option tu esser de accordo con le Nokia HERE <a "
522+"href='#'>terminos e conditiones</a>."
518523
519524#: qml/Wizard/Pages/50-location.qml:112
520525msgid "Not at all"
521−msgstr ""
526+msgstr "No, del toto"
522527
523528#: qml/Wizard/Pages/50-location.qml:124
524529msgid "You can change your mind later in <b>System Settings</b>."
525530msgstr ""
531+"Tu pote cambiar tu desiderata plus tarde in <b>Configurationes del "
532+"systema</b>."
526533
527534#: qml/Wizard/Pages/60-reporting.qml:24
528535msgid "Improving your experience"
529−msgstr ""
536+msgstr "Affinamento de tu experientia"
530537
531538#: qml/Wizard/Pages/60-reporting.qml:36
532539msgid ""
533540"Your phone is set up to automatically report errors to Canonical and its "
534541"partners, the makers of the operating system."
535542msgstr ""
543+"Tu telephono es configurate a reportar automaticamente le errores a "
544+"Canonical e su socios, le fabricantes del systema operative."
536545
537546#: qml/Wizard/Pages/60-reporting.qml:43
538547msgid ""
539548"This can be disabled in <b>System Settings</b> under <b>Security &amp; "
540549"Privacy</b>"
541550msgstr ""
551+"Isto pote esser impedite in <b>Preparationes del systema</b> sub "
552+"<b>Securitate &amp; Confidentialitate</b>"
542553
543554#: qml/Wizard/Pages/80-finished.qml:24
544555msgid "All done"
545−msgstr ""
556+msgstr "Toto preste"
546557
547558#: qml/Wizard/Pages/80-finished.qml:39
548559msgid "Nice work!"
549−msgstr ""
560+msgstr "Belle obra!"
550561
551562#: qml/Wizard/Pages/80-finished.qml:46
552563msgid "Your phone is now ready to use."
553−msgstr ""
564+msgstr "Tu telephono es ora preste al uso."
554565
555566#: qml/Wizard/Pages/80-finished.qml:53
556567msgid "Finish"
557−msgstr ""
568+msgstr "Fin"
558569
559570#: qml/Wizard/Pages/here-terms.qml:27
560571msgid "Terms & Conditions"
561−msgstr ""
572+msgstr "Terminos & Conditiones"
562573
563574#: qml/Wizard/Pages/passwd-confirm.qml:49
564575msgid "Confirm passphrase"
565−msgstr ""
576+msgstr "Confirma le phrase-contrasigno"
566577
567578#: qml/Wizard/Pages/passwd-confirm.qml:50
568579msgid "Confirm passcode"
569−msgstr ""
580+msgstr "Confirma le codice-contrasigno"
570581
571582#: qml/Wizard/Pages/passwd-confirm.qml:53
572583#: qml/Wizard/Pages/passwd-confirm.qml:54
573584msgid "Please try again."
574−msgstr ""
585+msgstr "Reproba per favor."
575586
576587#: qml/Wizard/Pages/passwd-set.qml:61
577588msgid "Choose your passcode"
578−msgstr ""
589+msgstr "Selige tu codice-contrasigno"
579590
580591#: qml/Wizard/Pages/passwd-set.qml:68
581592msgid "Passphrase must be 4 characters long"
582−msgstr ""
593+msgstr "Le phrase-contrasigno debe esser longe 4 characteres"
583594
584595#: qml/Wizard/StackButton.qml:39
585596#, qt-format
586597msgid "〈 %1"
587−msgstr ""
598+msgstr "〈 %1"
588599
589600#: qml/Wizard/StackButton.qml:42
590601#, qt-format
591602msgid "%1 〉"
592−msgstr ""
603+msgstr "%1 〉"
593604
594605#~ msgid "Log out"
595606#~ msgstr "Clauder le Session"
@@ -641,13 +652,6 @@ msgstr ""
641652#~ msgid "Well done"
642653#~ msgstr "Ben!"
643654
644−#~ msgid ""
645−#~ "You have now mastered the edge gestures and can start using the "
646−#~ "phone<br><br>Tap on the screen to start"
647−#~ msgstr ""
648−#~ "Tu ha ora maestrate le gestos del bordo e pote initiar usar le "
649−#~ "telephono<br><br>colpar sur le schermo pro initiar"
650−
651655#~ msgid "Search"
652656#~ msgstr "Cercar"
653657
@@ -671,3 +675,10 @@ msgstr ""
671675
672676#~ msgid "Speaking..."
673677#~ msgstr "Parlante..."
678+
679+#~ msgid ""
680+#~ "You have now mastered the edge gestures and can start using the "
681+#~ "phone<br><br>Tap on the screen to start"
682+#~ msgstr ""
683+#~ "Tu es ora maestrate le gestos del bordo e pote initiar usar le "
684+#~ "telephono<br><br>colpar sur le schermo pro initiar"
po/nb.po+8−8
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-03-20 14:03+0000\n"
12−"Last-Translator: Åka Sikrom <Unknown>\n"
11+"PO-Revision-Date: 2015-06-03 02:43+0000\n"
12+"Last-Translator: Eirik Garatun <eikknud@gmail.com>\n"
1313"Language-Team: Norwegian Bokmal <nb@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
18+"X-Launchpad-Export-Date: 2015-06-05 05:58+0000\n"
19+"X-Generator: Launchpad (build 17540)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -163,17 +163,17 @@ msgstr "Søk"
163163#: qml/Dash/PageHeader.qml:269
164164msgctxt "Button: Open the Ubuntu Store"
165165msgid "Store"
166−msgstr ""
166+msgstr "Butikk"
167167
168168#: qml/Dash/PageHeader.qml:276
169169msgctxt "Button: Start a search in the current dash scope"
170170msgid "Search"
171−msgstr ""
171+msgstr "Søk"
172172
173173#: qml/Dash/PageHeader.qml:286
174174msgctxt "Button: Show the current dash scope settings"
175175msgid "Settings"
176−msgstr ""
176+msgstr "Innstillinger"
177177
178178#: qml/Dash/PageHeader.qml:293
179179msgid "Remove from Favorites"
@@ -373,7 +373,7 @@ msgstr "Trykk her for å fortsette."
373373
374374#: qml/Tutorial/TutorialContent.qml:81
375375msgid "Click here to finish."
376−msgstr ""
376+msgstr "Trykk her for å fullføre."
377377
378378#: qml/Tutorial/TutorialLeftFinish.qml:24
379379msgid "These are the shortcuts to favorite apps"
po/pt.po+7−7
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity8\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-04-18 02:15+0000\n"
11+"PO-Revision-Date: 2015-05-19 03:42+0000\n"
1212"Last-Translator: António Miranda <Unknown>\n"
1313"Language-Team: Portuguese <pt@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
18+"X-Launchpad-Export-Date: 2015-05-22 05:09+0000\n"
19+"X-Generator: Launchpad (build 17514)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -262,7 +262,7 @@ msgid ""
262262"If passcode is entered incorrectly, your phone will conduct a factory reset "
263263"and all personal data will be deleted."
264264msgstr ""
265−"Se o código seja introduzido incorretamente, todos os dados pessoais do seu "
265+"Se o código não for introduzido corretamente, todos os dados pessoais do seu "
266266"telemóvel serão apagados."
267267
268268#: qml/Greeter/NarrowView.qml:115
@@ -276,7 +276,7 @@ msgstr "Indique a palavra-passe"
276276
277277#: qml/Greeter/NarrowView.qml:117
278278msgid "Enter passcode"
279−msgstr "Introduza código"
279+msgstr "Introduza o código"
280280
281281#: qml/Greeter/NarrowView.qml:118
282282#, qt-format
@@ -293,7 +293,7 @@ msgstr "Por favor, volte a introduzir"
293293
294294#: qml/Greeter/NarrowView.qml:121
295295msgid "Sorry, incorrect passcode"
296−msgstr "Código incorreta"
296+msgstr "Código incorreto"
297297
298298#: qml/Notifications/NotificationMenuItemFactory.qml:128
299299msgid "Show password"
@@ -371,7 +371,7 @@ msgstr "Toque aqui para continuar."
371371
372372#: qml/Tutorial/TutorialContent.qml:81
373373msgid "Click here to finish."
374−msgstr ""
374+msgstr "Clique aqui para finalizar."
375375
376376#: qml/Tutorial/TutorialLeftFinish.qml:24
377377msgid "These are the shortcuts to favorite apps"
po/sl.po+8−8
@@ -8,16 +8,16 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-03-23 07:24+0000\n"
12−"Last-Translator: Damir Jerovšek <Unknown>\n"
11+"PO-Revision-Date: 2015-06-05 06:39+0000\n"
12+"Last-Translator: Martin Srebotnjak <miles@filmsi.net>\n"
1313"Language-Team: Slovenian <sl@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || "
1818"n%100==4 ? 3 : 0);\n"
19−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
20−"X-Generator: Launchpad (build 17430)\n"
19+"X-Launchpad-Export-Date: 2015-06-06 05:31+0000\n"
20+"X-Generator: Launchpad (build 17540)\n"
2121
2222#: plugins/LightDM/Greeter.cpp:112
2323msgid "Password: "
@@ -164,17 +164,17 @@ msgstr "Iskanje"
164164#: qml/Dash/PageHeader.qml:269
165165msgctxt "Button: Open the Ubuntu Store"
166166msgid "Store"
167−msgstr ""
167+msgstr "Trgovina"
168168
169169#: qml/Dash/PageHeader.qml:276
170170msgctxt "Button: Start a search in the current dash scope"
171171msgid "Search"
172−msgstr ""
172+msgstr "Iskanje"
173173
174174#: qml/Dash/PageHeader.qml:286
175175msgctxt "Button: Show the current dash scope settings"
176176msgid "Settings"
177−msgstr ""
177+msgstr "Nastavitve"
178178
179179#: qml/Dash/PageHeader.qml:293
180180msgid "Remove from Favorites"
@@ -374,7 +374,7 @@ msgstr "Tapnite tukaj za nadaljevanje."
374374
375375#: qml/Tutorial/TutorialContent.qml:81
376376msgid "Click here to finish."
377−msgstr ""
377+msgstr "Kliknite tu za zaključek."
378378
379379#: qml/Tutorial/TutorialLeftFinish.qml:24
380380msgid "These are the shortcuts to favorite apps"
qml/Dash/Previews/PreviewRatingDisplay.qml+9−44
@@ -49,53 +49,18 @@ PreviewWidget {
4949 objectName: "reviewsRepeater"
5050 model: root.widgetData["reviews"]
5151
52− delegate: Column {
53− id: reviewItem
52+ delegate: PreviewRatingSingleDisplay {
5453 objectName: "reviewItem" + index
55− anchors { left: parent.left; right: parent.right;}
56− spacing: units.gu(1)
5754
58− Rating {
59− id: rating
60− objectName: "rating"
61− size: 5
62− value: modelData["rating"] || -1
63− visible: value >= 0
64− interactive: false
55+ anchors { left: parent.left; right: parent.right; }
6556
66− property var urlIconEmpty: widgetData["rating-icon-empty"]
67− property var urlIconFull: widgetData["rating-icon-full"]
68− property var urlIconHalf: widgetData["rating-icon-half"]
69− }
70−
71− Label {
72− id: authorLabel
73− objectName: "authorLabel"
74− anchors { left: parent.left; right: parent.right }
75− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
76− opacity: .8
77− text: modelData["author"] || ""
78− visible: text !== ""
79− wrapMode: Text.Wrap
80− }
81−
82− Label {
83− id: reviewLabel
84− objectName: "reviewLabel"
85− anchors { left: parent.left; right: parent.right }
86− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
87− opacity: .8
88− text: modelData["review"] || ""
89− visible: text !== ""
90− wrapMode: Text.Wrap
91− }
92−
93− Item {
94− id: spacing
95− anchors { left: parent.left; right: parent.right }
96− height: units.gu(2)
97− visible: rating.visible || authorLabel.visible || reviewLabel.visible
98− }
57+ rating: modelData["rating"] || -1
58+ author: modelData["author"] || ""
59+ review: modelData["review"] || ""
60+ urlIconEmpty: widgetData["rating-icon-empty"]
61+ urlIconFull: widgetData["rating-icon-full"]
62+ urlIconHalf: widgetData["rating-icon-half"]
63+ labelColor: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
9964 }
10065 }
10166 }
qml/Dash/Previews/PreviewRatingEdit.qmlnew file+80
@@ -0,0 +1,80 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 0.1
19+import "../../Components"
20+
21+/*! \brief Preview widget for editable rating.
22+
23+ Shows a single display rating that can be switched by the user to edit mode
24+ and then behaves as a rating display widget
25+
26+ The display part uses widgetData["author"], widgetData["review"] and widgetData["rating"].
27+
28+ The edit part uses the same fields as the "rating-input" widget
29+*/
30+
31+PreviewWidget {
32+ id: root
33+ implicitHeight: display.visible ? display.implicitHeight : input.implicitHeight
34+
35+ Button {
36+ id: editIcon
37+ objectName: "editButton"
38+
39+ iconName: "edit"
40+ width: height
41+ anchors.right: parent.right
42+ visible: display.visible
43+ onClicked: display.visible = false
44+ }
45+
46+ PreviewRatingSingleDisplay {
47+ id: display
48+ objectName: "display"
49+
50+ anchors.left: parent.left
51+ anchors.right: editIcon.left
52+
53+ rating: widgetData["rating"] || -1
54+ author: widgetData["author"] || ""
55+ review: widgetData["review"] || ""
56+ urlIconEmpty: widgetData["rating-icon-empty"]
57+ urlIconFull: widgetData["rating-icon-full"]
58+ urlIconHalf: widgetData["rating-icon-half"]
59+ labelColor: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
60+ }
61+
62+ PreviewRatingInput {
63+ id: input
64+ objectName: "input"
65+
66+ visible: !display.visible
67+ width: parent.width
68+
69+ widgetId: root.widgetId
70+ widgetData: root.widgetData
71+ isCurrentPreview: root.isCurrentPreview
72+ scopeStyle: root.scopeStyle
73+
74+ ratingValue: widgetData["rating"]
75+ reviewText: widgetData["review"]
76+
77+ onTriggered: root.triggered(widgetId, actionId, data);
78+ }
79+
80+}
qml/Dash/Previews/PreviewRatingInput.qml+3
@@ -48,6 +48,9 @@ PreviewWidget {
4848 }
4949 }
5050
51+ property alias ratingValue: rating.value
52+ property alias reviewText: reviewTextArea.text
53+
5154 function submit() {
5255 // checks rating-input requirements
5356 if (((widgetData["required"] === "both" ||
qml/Dash/Previews/PreviewRatingSingleDisplay.qmlnew file+70
@@ -0,0 +1,70 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 0.1
19+import "../../Components"
20+
21+Column {
22+ id: reviewItem
23+ spacing: units.gu(1)
24+
25+ property alias rating: ratingItem.value
26+ property alias author: authorLabel.text
27+ property alias review: reviewLabel.text
28+ property alias urlIconEmpty: ratingItem.urlIconEmpty
29+ property alias urlIconFull: ratingItem.urlIconFull
30+ property alias urlIconHalf: ratingItem.urlIconHalf
31+ property alias labelColor: authorLabel.color
32+
33+ Rating {
34+ id: ratingItem
35+ objectName: "rating"
36+ size: 5
37+ visible: value >= 0
38+ interactive: false
39+
40+ property var urlIconEmpty
41+ property var urlIconFull
42+ property var urlIconHalf
43+ }
44+
45+ Label {
46+ id: authorLabel
47+ objectName: "authorLabel"
48+ anchors { left: parent.left; right: parent.right }
49+ opacity: .8
50+ visible: text !== ""
51+ wrapMode: Text.Wrap
52+ }
53+
54+ Label {
55+ id: reviewLabel
56+ objectName: "reviewLabel"
57+ anchors { left: parent.left; right: parent.right }
58+ color: authorLabel.color
59+ opacity: .8
60+ visible: text !== ""
61+ wrapMode: Text.Wrap
62+ }
63+
64+ Item {
65+ id: spacing
66+ anchors { left: parent.left; right: parent.right }
67+ height: units.gu(2)
68+ visible: rating.visible || authorLabel.visible || reviewLabel.visible
69+ }
70+}
qml/Dash/Previews/PreviewWidgetFactory.qml+1
@@ -57,6 +57,7 @@ Loader {
5757 case "progress": return "PreviewProgress.qml";
5858 case "payments": return "PreviewPayments.qml";
5959 case "rating-input": return "PreviewRatingInput.qml";
60+ case "rating-edit": return "PreviewRatingEdit.qml";
6061 case "reviews": return "PreviewRatingDisplay.qml";
6162 case "table": return "PreviewTable.qml";
6263 case "text": return "PreviewTextSummary.qml";
qml/Greeter/Greeter.qml+4−2
@@ -143,8 +143,10 @@ Showable {
143143 enabled = false;
144144 if (LightDM.Greeter.startSessionSync()) {
145145 sessionStarted();
146− loader.item.notifyAuthenticationSucceeded();
147− } else {
146+ if (loader.item) {
147+ loader.item.notifyAuthenticationSucceeded();
148+ }
149+ } else if (loader.item) {
148150 loader.item.notifyAuthenticationFailed();
149151 }
150152 enabled = true;
qml/Panel/Indicators/IndicatorsLight.qml+8
@@ -26,6 +26,8 @@ import Unity.Indicators 0.1 as Indicators
2626QtObject {
2727 id: root
2828
29+ property color color: "darkgreen"
30+
2931 property var _actionGroup: QMenuModel.QDBusActionGroup {
3032 busType: 1
3133 busName: "com.canonical.indicator.messages"
@@ -50,4 +52,10 @@ QtObject {
5052 return (Powerd.status === Powerd.Off && _rootState.hasMessages) ? Lights.On : Lights.Off
5153 }
5254 }
55+
56+ property var _colorBinding: Binding {
57+ target: Lights
58+ property: "color"
59+ value: root.color
60+ }
5361}
qml/Shell.qml−1
@@ -140,7 +140,6 @@ Item {
140140
141141 GSettings {
142142 id: backgroundSettings
143− objectName: "backgroundSettings"
144143 schema.id: "org.gnome.desktop.background"
145144 }
146145
qml/Stages/DecoratedWindow.qml+1
@@ -42,6 +42,7 @@ FocusScope {
4242
4343 WindowDecoration {
4444 id: decoration
45+ objectName: application ? "appWindowDecoration_" + application.appId : "appWindowDecoration_null"
4546 anchors { left: parent.left; top: parent.top; right: parent.right }
4647 height: units.gu(3)
4748 title: model.name
qml/Stages/DesktopStage.qml+20−14
@@ -20,9 +20,8 @@ import QtQuick 2.3
2020import Ubuntu.Components 1.1
2121import Unity.Application 0.1
2222import "../Components/PanelState"
23−import Utils 0.1
2423
25−FocusScope {
24+Rectangle {
2625 id: root
2726
2827 anchors.fill: parent
@@ -52,8 +51,6 @@ FocusScope {
5251
5352 property alias background: wallpaper.source
5453
55− property var windowStateStorage: WindowStateStorage
56−
5754 CrossFadeImage {
5855 id: wallpaper
5956 anchors.fill: parent
@@ -81,7 +78,16 @@ FocusScope {
8178 id: priv
8279
8380 readonly property string focusedAppId: ApplicationManager.focusedApplicationId
84− readonly property var focusedAppDelegate: focusedAppId ? appRepeater.itemAt(indexOf(focusedAppId)) : null
81+ readonly property var focusedAppDelegate: {
82+ var index = indexOf(focusedAppId);
83+ return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
84+ }
85+
86+ onFocusedAppDelegateChanged: {
87+ if (focusedAppDelegate) {
88+ focusedAppDelegate.focus = true;
89+ }
90+ }
8591
8692 function indexOf(appId) {
8793 for (var i = 0; i < ApplicationManager.count; i++) {
@@ -112,13 +118,19 @@ FocusScope {
112118 id: appRepeater
113119 model: ApplicationManager
114120
115− delegate: Item {
121+ delegate: FocusScope {
116122 id: appDelegate
117123 z: ApplicationManager.count - index
118124 y: units.gu(3)
119125 width: units.gu(60)
120126 height: units.gu(50)
121127
128+ onFocusChanged: {
129+ if (focus) {
130+ ApplicationManager.requestFocusApplication(model.appId);
131+ }
132+ }
133+
122134 readonly property int minWidth: units.gu(10)
123135 readonly property int minHeight: units.gu(10)
124136
@@ -142,14 +154,13 @@ FocusScope {
142154 ]
143155
144156 WindowMoveResizeArea {
145− windowStateStorage: root.windowStateStorage
146157 target: appDelegate
147158 minWidth: appDelegate.minWidth
148159 minHeight: appDelegate.minHeight
149160 resizeHandleWidth: units.gu(0.5)
150161 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
151162
152− onPressed: decoratedWindow.focus = true;
163+ onPressed: appDelegate.focus = true;
153164 }
154165
155166 DecoratedWindow {
@@ -158,12 +169,7 @@ FocusScope {
158169 anchors.fill: parent
159170 application: ApplicationManager.get(index)
160171 active: ApplicationManager.focusedApplicationId === model.appId
161−
162− onFocusChanged: {
163− if (focus) {
164− ApplicationManager.requestFocusApplication(model.appId);
165− }
166− }
172+ focus: true
167173
168174 onClose: ApplicationManager.stopApplication(model.appId)
169175 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
qml/Stages/PhoneStage.qml+5−4
@@ -176,15 +176,16 @@ Rectangle {
176176 id: priv
177177
178178 property string focusedAppId: root.applicationManager.focusedApplicationId
179− property var focusedApplication: root.applicationManager.findApplication(focusedAppId)
180− property var focusedAppDelegate: null
181179 property bool focusedAppOrientationChangesEnabled: false
180+ readonly property int firstSpreadIndex: root.focusFirstApp ? 1 : 0
181+ readonly property var focusedAppDelegate: {
182+ var index = indexOf(focusedAppId);
183+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
184+ }
182185
183186 property real oldInverseProgress: 0
184187 property bool animateX: false
185188
186− onFocusedAppIdChanged: focusedAppDelegate = spreadRepeater.itemAt(0);
187−
188189 onFocusedAppDelegateChanged: {
189190 if (focusedAppDelegate) {
190191 focusedAppDelegate.focus = true;
qml/Stages/TabletStage.qml+10−12
@@ -119,6 +119,11 @@ Rectangle {
119119 id: priv
120120
121121 property string focusedAppId: ApplicationManager.focusedApplicationId
122+ readonly property var focusedAppDelegate: {
123+ var index = indexOf(focusedAppId);
124+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
125+ }
126+
122127 property string oldFocusedAppId: ""
123128 property bool mainAppOrientationChangesEnabled: false
124129
@@ -150,19 +155,11 @@ Rectangle {
150155
151156 appId0 = ApplicationManager.count >= 1 ? ApplicationManager.get(0).appId : "";
152157 appId1 = ApplicationManager.count > 1 ? ApplicationManager.get(1).appId : "";
153−
154− // Update the QML focus accordingly
155− updateSpreadDelegateFocus();
156158 }
157159
158− function updateSpreadDelegateFocus() {
159− if (priv.focusedAppId) {
160− var focusedAppIndex = priv.indexOf(priv.focusedAppId);
161− if (focusedAppIndex !== -1) {
162− spreadRepeater.itemAt(focusedAppIndex).focus = true;
163− } else {
164− console.warn("TabletStage: Failed to find the SpreadDelegate for appID=" + priv.focusedAppId);
165− }
160+ onFocusedAppDelegateChanged: {
161+ if (focusedAppDelegate) {
162+ focusedAppDelegate.focus = true;
166163 }
167164 }
168165
@@ -597,7 +594,8 @@ Rectangle {
597594
598595 delegate: TransformedTabletSpreadDelegate {
599596 id: spreadTile
600− objectName: "spreadDelegate_" + model.appId
597+ objectName: model.appId ? "tabletSpreadDelegate_" + model.appId
598+ : "tabletSpreadDelegate_null";
601599 width: {
602600 if (wantsMainStage) {
603601 return spreadView.width;
src/Dash/main.cpp−6
@@ -31,9 +31,6 @@
3131#include "../ApplicationArguments.h"
3232#include "../CachingNetworkManagerFactory.h"
3333
34−// Ubuntu Gestures
35−#include <TouchRegistry.h>
36−
3734int main(int argc, const char *argv[])
3835{
3936 QGuiApplication *application = new QGuiApplication(argc, (char**)argv);
@@ -97,9 +94,6 @@ int main(int argc, const char *argv[])
9794 view->setTitle("Scopes");
9895 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
9996
100− TouchRegistry touchRegistry;
101− view->installEventFilter(&touchRegistry);
102−
10397 // You will need this if you want to interact with touch-only components using a mouse
10498 // Needed only when manually testing on a desktop.
10599 MouseTouchAdaptor *mouseTouchAdaptor = 0;
src/main.cpp−5
@@ -35,9 +35,6 @@
3535#include "CachingNetworkManagerFactory.h"
3636#include "UnityCommandLineParser.h"
3737
38−// Ubuntu Gestures
39−#include <TouchRegistry.h>
40−
4138int main(int argc, const char *argv[])
4239{
4340 bool isMirServer = false;
@@ -99,8 +96,6 @@ int main(int argc, const char *argv[])
9996 if (parser.hasFrameless()) {
10097 view->setFlags(Qt::FramelessWindowHint);
10198 }
102− TouchRegistry touchRegistry;
103− view->installEventFilter(&touchRegistry);
10499
105100 // You will need this if you want to interact with touch-only components using a mouse
106101 // Needed only when manually testing on a desktop.
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+13−3
@@ -21,6 +21,7 @@
2121
2222import logging
2323import os
24+import threading
2425
2526from autopilot.platform import model
2627
@@ -90,10 +91,19 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
9091 """Greeter should hide when an app is opened"""
9192 process_helpers.lock_unity()
9293
93− application_name = self.launch_fake_app()
94+ # FIXME - this is because the device greeter uses a password.
95+ # Need to be able to selectively enable mocks so that we can use the fake greeter.
96+ def unlock_thread_worker(greeter):
97+ greeter.wait_swiped_away()
98+ process_helpers.unlock_unity()
99+ greeter.created.wait_for(False)
100+
94101 greeter = self.main_window.get_greeter()
95− greeter.wait_swiped_away()
96− process_helpers.unlock_unity()
102+ unlock_thread = threading.Thread(target=unlock_thread_worker, args=(greeter,))
103+ unlock_thread.start()
104+ application_name = self.launch_fake_app()
105+ unlock_thread.join(10)
106+
97107 self.assert_current_focused_application(application_name)
98108
99109 def test_greeter_hides_on_app_focus(self):
tests/autopilot/unity8/fixture_setup.py+131−3
@@ -17,19 +17,147 @@
1717# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818#
1919
20−import fixtures
21−import logging
2220import os
2321import subprocess
22+import threading
23+import fixtures
24+import logging
2425
2526import ubuntuuitoolkit
2627from autopilot import introspection
28+from autopilot.matchers import Eventually
29+from testtools.matchers import Equals
30+from ubuntuuitoolkit import fixture_setup
2731
2832from unity8 import (
2933 get_binary_path,
34+ sensors,
3035 process_helpers
3136)
3237
38+from unity8.shell import emulators
39+
40+from unity8.shell.emulators import (
41+ main_window as main_window_emulator
42+)
43+
44+from unity8 import (
45+ get_mocks_library_path,
46+ get_default_extra_mock_libraries,
47+ get_data_dirs
48+)
49+
50+logger = logging.getLogger(__name__)
51+
52+
53+class LaunchUnityWithFakeSensors(fixtures.Fixture):
54+
55+ """Fixture to launch Unity8 with an injectable sensors backend.
56+
57+ :ivar unity_proxy: The Autopilot proxy object for the Unity shell.
58+
59+ """
60+
61+ unity_proxy = None
62+ main_win = None
63+
64+ def setUp(self):
65+ """Restart Unity8 with testability and create sensors."""
66+ super().setUp()
67+ self.useFixture(
68+ fixture_setup.InitctlEnvironmentVariable(
69+ UBUNTU_PLATFORM_API_TEST_OVERRIDE='sensors'))
70+
71+ self.addCleanup(process_helpers.stop_job, 'unity8')
72+ restart_thread = threading.Thread(
73+ target=self._restart_unity_with_testability)
74+ restart_thread.start()
75+
76+ self._create_sensors()
77+
78+ restart_thread.join()
79+ self.fake_sensors = sensors.FakePlatformSensors()
80+
81+ def _get_lightdm_mock_path(self):
82+ lib_path = get_mocks_library_path()
83+ lightdm_mock_path = os.path.abspath(
84+ os.path.join(lib_path, "LightDM", "liblightdm")
85+ )
86+
87+ if not os.path.exists(lightdm_mock_path):
88+ raise RuntimeError(
89+ "LightDM mock does not exist at path {}.".
90+ format(lightdm_mock_path)
91+ )
92+ return lightdm_mock_path
93+
94+ def _get_qml_import_path_with_mock(self):
95+ """Return the QML2_IMPORT_PATH value with the mock path prepended."""
96+ qml_import_path = [get_mocks_library_path()]
97+ if os.getenv('QML2_IMPORT_PATH') is not None:
98+ qml_import_path.append(os.getenv('QML2_IMPORT_PATH'))
99+
100+ qml_import_path = ':'.join(qml_import_path)
101+ return qml_import_path
102+
103+ def _restart_unity_with_testability(self):
104+ _environment = {}
105+
106+ data_dirs = get_data_dirs(True)
107+ if data_dirs is not None:
108+ _environment['XDG_DATA_DIRS'] = data_dirs
109+
110+ _environment['QML2_IMPORT_PATH'] = (
111+ self._get_qml_import_path_with_mock()
112+ )
113+
114+ new_ld_library_path = [
115+ get_default_extra_mock_libraries(),
116+ self._get_lightdm_mock_path()
117+ ]
118+ if os.getenv('LD_LIBRARY_PATH') is not None:
119+ new_ld_library_path.append(os.getenv('LD_LIBRARY_PATH'))
120+ new_ld_library_path = ':'.join(new_ld_library_path)
121+ _environment['LD_LIBRARY_PATH'] = new_ld_library_path
122+
123+ # FIXME: we shouldn't be doing this
124+ # $MIR_SOCKET, fallback to $XDG_RUNTIME_DIR/mir_socket and
125+ # /tmp/mir_socket as last resort
126+ try:
127+ os.unlink(
128+ os.getenv('MIR_SOCKET',
129+ os.path.join(os.getenv('XDG_RUNTIME_DIR', "/tmp"),
130+ "mir_socket")))
131+ except OSError:
132+ pass
133+ try:
134+ os.unlink("/tmp/mir_socket")
135+ except OSError:
136+ pass
137+
138+ binary_arg = "BINARY=%s" % get_binary_path()
139+ env_args = ["%s=%s" % (k, v) for k, v in _environment.items()]
140+ args = [binary_arg] + env_args
141+ self.unity_proxy = process_helpers.restart_unity_with_testability(
142+ *args)
143+ self.main_win = self.unity_proxy.select_single(
144+ main_window_emulator.QQuickView)
145+
146+ def _create_sensors(self):
147+ # Wait for unity to start running.
148+ Eventually(Equals(True)).match(
149+ lambda: process_helpers.is_job_running('unity8'))
150+
151+ # Wait for the sensors fifo file to be created.
152+ fifo_path = '/tmp/sensor-fifo-{0}'.format(
153+ process_helpers.get_unity_pid())
154+ Eventually(Equals(True)).match(
155+ lambda: os.path.exists(fifo_path))
156+
157+ with open(fifo_path, 'w') as fifo:
158+ fifo.write('create accel 0 1000 0.1\n')
159+ fifo.write('create light 0 10 1\n')
160+ fifo.write('create proximity\n')
33161
34162logger = logging.getLogger(__name__)
35163
@@ -188,7 +316,7 @@ class LaunchMockIndicatorService(fixtures.Fixture):
188316 self.ensure_not_running = ensure_not_running
189317
190318 def setUp(self):
191− super(LaunchMockIndicatorService, self).setUp()
319+ super().setUp()
192320 if self.ensure_not_running:
193321 self.ensure_service_not_running()
194322 self.addCleanup(self.stop_service)
tests/autopilot/unity8/indicators/tests/test_action_latency.py+4−2
@@ -70,10 +70,11 @@ class TestServerValueUpdate(TestIndicatorBaseTestCase):
7070 switch_menu = self.indicator_page.get_switch_menu()
7171
7272 switch.change_state()
73+ final_value = switch.checked
7374
7475 self.assertThat(
7576 switch_menu.serverChecked,
76− Eventually(Equals(switch.checked), timeout=20)
77+ Eventually(Equals(final_value), timeout=20)
7778 )
7879
7980 def test_slider_reaches_server_value(self):
@@ -82,6 +83,7 @@ class TestServerValueUpdate(TestIndicatorBaseTestCase):
8283
8384 old_value = slider.value
8485 slider.slide_left()
86+ final_value = slider.value
8587
8688 self.assertThat(
8789 slider_menu.serverValue,
@@ -90,7 +92,7 @@ class TestServerValueUpdate(TestIndicatorBaseTestCase):
9092
9193 self.assertThat(
9294 slider_menu.serverValue,
93− Eventually(Equals(slider.value), timeout=20)
95+ Eventually(Equals(final_value), timeout=20)
9496 )
9597
9698
tests/autopilot/unity8/indicators/tests/test_display_indicator.py+1−1
@@ -18,7 +18,7 @@
1818
1919from unity8 import (
2020 fixture_setup,
21− indicators,
21+ indicators
2222)
2323from unity8.indicators import tests
2424
tests/autopilot/unity8/process_helpers.py+3−3
@@ -58,7 +58,7 @@ def unlock_unity(unity_proxy_obj=None):
5858 """
5959 if unity_proxy_obj is None:
6060 try:
61− pid = _get_unity_pid()
61+ pid = get_unity_pid()
6262 unity = _get_unity_proxy_object(pid)
6363 main_window = unity.select_single(main_window_emulator.QQuickView)
6464 except ProcessSearchError as e:
@@ -108,7 +108,7 @@ def lock_unity(unity_proxy_obj=None):
108108 """
109109 if unity_proxy_obj is None:
110110 try:
111− pid = _get_unity_pid()
111+ pid = get_unity_pid()
112112 unity = _get_unity_proxy_object(pid)
113113 main_window = unity.select_single(main_window_emulator.QQuickView)
114114 except ProcessSearchError as e:
@@ -262,7 +262,7 @@ def _get_unity_status():
262262 raise CannotAccessUnity(str(error))
263263
264264
265−def _get_unity_pid():
265+def get_unity_pid():
266266 try:
267267 return get_job_pid('unity8')
268268 except JobError as error:
tests/autopilot/unity8/sensors.pynew file+93
@@ -0,0 +1,93 @@
1+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2+#
3+# Unity Autopilot Test Suite
4+# Copyright (C) 2015 Canonical
5+#
6+# This program is free software: you can redistribute it and/or modify
7+# it under the terms of the GNU General Public License as published by
8+# the Free Software Foundation, either version 3 of the License, or
9+# (at your option) any later version.
10+#
11+# This program is distributed in the hope that it will be useful,
12+# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+# GNU General Public License for more details.
15+#
16+# You should have received a copy of the GNU General Public License
17+# along with this program. If not, see <http://www.gnu.org/licenses/>.
18+#
19+
20+"""Control module for event injection to the fake/test platform sensors."""
21+
22+from unity8 import process_helpers
23+
24+
25+class FakePlatformSensors:
26+
27+ def __init__(self, pid=None):
28+ self.pid = pid or process_helpers.get_unity_pid()
29+
30+ def set_orientation(self, action):
31+ if action == 'top_up':
32+ with open("/tmp/sensor-fifo-{0}".format(self.pid), "w") as fifo:
33+ fifo.write("70 accel -10.050858 -0.598550 0.756568\n")
34+ fifo.write("70 accel -9.797073 -0.555455 1.019930\n")
35+ fifo.write("70 accel -10.141838 -0.770933 0.632069\n")
36+ fifo.write("70 accel -12.057199 -1.259350 1.690306\n")
37+ fifo.write("70 accel -19.282900 -3.926491 3.098097\n")
38+ fifo.write("70 accel -14.480132 -14.269443 1.216254\n")
39+ fifo.write("70 accel 16.419436 4.242526 -7.714118\n")
40+ fifo.write("70 accel 5.583278 8.279149 -1.848324\n")
41+ fifo.write("70 accel 1.422156 8.547300 0.416591\n")
42+ fifo.write("70 accel 4.357447 9.988609 -0.110133\n")
43+ fifo.write("70 accel 0.699107 9.840169 0.756568\n")
44+ fifo.write("70 accel 1.364695 9.844957 -0.287304\n")
45+ fifo.flush()
46+ elif action == 'top_down':
47+ with open("/tmp/sensor-fifo-{0}".format(self.pid), "w") as fifo:
48+ fifo.write("70 accel -10.050858 -0.598550 0.756568\n")
49+ fifo.write("70 accel 9.538500 -0.603339 1.292869\n")
50+ fifo.write("70 accel 9.485827 -0.636858 1.422156\n")
51+ fifo.write("70 accel 9.677363 -0.402226 1.374272\n")
52+ fifo.write("70 accel 9.303867 -0.507571 1.283292\n")
53+ fifo.write("70 accel 8.604761 -1.015141 1.436521\n")
54+ fifo.write("70 accel 7.580042 -2.001553 0.521936\n")
55+ fifo.write("70 accel 7.503428 -4.247314 0.502782\n")
56+ fifo.write("70 accel 7.067683 -7.240066 0.842759\n")
57+ fifo.write("70 accel 6.488286 -9.873688 -0.541090\n")
58+ fifo.write("70 accel 6.229713 -9.241618 -1.048660\n")
59+ fifo.write("70 accel 4.046201 -9.198523 -0.057461\n")
60+ fifo.write("70 accel 2.398990 -9.629479 0.957681\n")
61+ fifo.write("70 accel 1.632846 -9.361329 -0.311246\n")
62+ fifo.write("70 accel -0.181959 -9.696517 -0.301669\n")
63+ fifo.flush()
64+ elif action == 'left_up':
65+ with open("/tmp/sensor-fifo-{0}".format(self.pid), "w") as fifo:
66+ fifo.write("70 accel -10.050858 -0.598550 0.756568\n")
67+ fifo.write("70 accel 0.196325 9.878476 0.948104\n")
68+ fifo.write("70 accel 0.258574 9.955091 1.091756\n")
69+ fifo.write("70 accel 0.287304 10.041282 1.134852\n")
70+ fifo.write("70 accel 1.537078 10.553641 1.561020\n")
71+ fifo.write("70 accel 8.130709 10.093954 2.561796\n")
72+ fifo.write("70 accel -0.229843 5.348647 1.723825\n")
73+ fifo.write("70 accel -9.916783 0.488417 -3.418920\n")
74+ fifo.write("70 accel -13.417107 -0.416591 -2.360683\n")
75+ fifo.write("70 accel -13.872005 -2.049437 -0.574608\n")
76+ fifo.flush()
77+ elif action == 'right_up':
78+ with open("/tmp/sensor-fifo-{0}".format(self.pid), "w") as fifo:
79+ fifo.write("70 accel -10.050858 -0.598550 0.756568\n")
80+ fifo.write("70 accel -4.550858 -0.598550 0.856568\n")
81+ fifo.write("70 accel -0.799663 9.988609 1.197101\n")
82+ fifo.write("70 accel -0.861913 9.864111 1.066701\n")
83+ fifo.write("70 accel -0.861913 9.864111 0.866701\n")
84+ fifo.write("70 accel -1.776498 9.830592 1.273715\n")
85+ fifo.write("70 accel -2.376498 9.830592 1.273715\n")
86+ fifo.write("70 accel -13.158532 2.217031 1.091756\n")
87+ fifo.write("70 accel 5.056554 1.067814 0.799663\n")
88+ fifo.write("70 accel 5.056554 1.767814 0.799663\n")
89+ fifo.write("70 accel 14.882358 2.896984 1.221043\n")
90+ fifo.write("70 accel 9.466674 -0.363919 -1.029507\n")
91+ fifo.write("70 accel 11.253524 -0.186748 -0.311246\n")
92+ fifo.write("70 accel 12.253524 -0.186748 -0.311246\n")
93+ fifo.flush()
tests/autopilot/unity8/shell/emulators/main_window.py+12
@@ -169,6 +169,18 @@ class QQuickView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
169169 objectName='pinPadButton{}'.format(button_id)
170170 )
171171
172+ def get_shell_orientation_angle(self):
173+ return self._get_shell().orientationAngle
174+
175+ def get_shell_orientation(self):
176+ return self._get_shell().orientation
177+
178+ def get_shell_primary_orientation(self):
179+ return self._get_shell().primaryOrientation
180+
181+ def get_shell_native_orientation(self):
182+ return self._get_shell().nativeOrientation
183+
172184 @autopilot_logging.log_action(logger.info)
173185 def wait_for_notification(self):
174186 """Wait for a notification dialog to appear.
tests/autopilot/unity8/shell/tests/test_rotation.pynew file+113
@@ -0,0 +1,113 @@
1+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2+#
3+# Unity Autopilot Test Suite
4+# Copyright (C) 2015 Canonical
5+#
6+# This program is free software: you can redistribute it and/or modify
7+# it under the terms of the GNU General Public License as published by
8+# the Free Software Foundation, either version 3 of the License, or
9+# (at your option) any later version.
10+#
11+# This program is distributed in the hope that it will be useful,
12+# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+# GNU General Public License for more details.
15+#
16+# You should have received a copy of the GNU General Public License
17+# along with this program. If not, see <http://www.gnu.org/licenses/>.
18+#
19+
20+"""Tests for shell-rotation"""
21+
22+from autopilot.platform import model
23+from unity8 import (
24+ fixture_setup,
25+ process_helpers
26+)
27+from unity8.shell import tests
28+import logging
29+from testtools.matchers import Equals
30+from autopilot.matchers import Eventually
31+
32+logger = logging.getLogger(__name__)
33+
34+
35+class RotationBase(tests.UnityTestCase):
36+ """Base class for all shell-rotation tests that provides helper methods."""
37+
38+ def setUp(self):
39+ if model() == 'Desktop':
40+ self.skipTest('Test cannot be run on the desktop.')
41+ super().setUp()
42+ self._qml_mock_enabled = False
43+ self._data_dirs_mock_enabled = False
44+
45+ def _assert_change_of_orientation_and_angle(self):
46+ self.assertThat(self.shell_proxy.orientation,
47+ Eventually(Equals(self.orientation)))
48+ self.assertThat(self.shell_proxy.orientationAngle,
49+ Eventually(Equals(self.angle)))
50+
51+
52+class TestFakeSensor(RotationBase):
53+ scenarios = [('top up', {'action': 'top_up', 'orientation': 1}),
54+ ('right up', {'action': 'right_up', 'orientation': 8}),
55+ ('top down', {'action': 'top_down', 'orientation': 4}),
56+ ('left up', {'action': 'left_up', 'orientation': 2})]
57+
58+ def test_fake_sensor(self):
59+ unity_with_sensors = fixture_setup.LaunchUnityWithFakeSensors()
60+ self.useFixture(unity_with_sensors)
61+ process_helpers.unlock_unity(unity_with_sensors.unity_proxy)
62+ fake_sensors = unity_with_sensors.fake_sensors
63+ o_proxy = unity_with_sensors.main_win.select_single('OrientedShell')
64+
65+ fake_sensors.set_orientation(self.action)
66+ self.assertThat(o_proxy.physicalOrientation,
67+ Eventually(Equals(self.orientation), timeout=15))
68+
69+
70+class TestRotationWithApp(RotationBase):
71+ scenarios = [
72+ ('top up, angle 0',
73+ {'action': 'top_up', 'orientation': 1, 'angle': 0}),
74+ ('right up, angle 90',
75+ {'action': 'right_up', 'orientation': 8, 'angle': 90}),
76+ ('top down, angle 180',
77+ {'action': 'top_down', 'orientation': 4, 'angle': 180}),
78+ ('left up, angle 270',
79+ {'action': 'left_up', 'orientation': 2, 'angle': 270})]
80+
81+ def test_rotation_with_webbrowser_app(self):
82+ """Do an orientation-change and verify that an app and the shell
83+ adapted correctly"""
84+
85+ unity_with_sensors = fixture_setup.LaunchUnityWithFakeSensors()
86+ self.useFixture(unity_with_sensors)
87+ process_helpers.unlock_unity(unity_with_sensors.unity_proxy)
88+ fake_sensors = unity_with_sensors.fake_sensors
89+ o_proxy = unity_with_sensors.main_win.select_single('OrientedShell')
90+ self.shell_proxy = unity_with_sensors.main_win.select_single('Shell')
91+
92+ # launch an application
93+ self.launch_upstart_application('webbrowser-app')
94+ unity_with_sensors.main_win.show_dash_from_launcher()
95+ unity_with_sensors.main_win.launch_application('webbrowser-app')
96+
97+ # skip test early, if device doesn't support a certain orientation
98+ if not (self.shell_proxy.orientation & o_proxy.supportedOrientations):
99+ self.skipTest('unsupported orientation ' + self.action)
100+
101+ self.assertThat(
102+ unity_with_sensors.main_win.get_current_focused_app_id(),
103+ Eventually(Equals('webbrowser-app')))
104+
105+ # get default orientation and angle
106+ self.orientation = self.shell_proxy.orientation
107+ self.angle = self.shell_proxy.orientationAngle
108+
109+ # check if fake sensors affect orientation and angle
110+ fake_sensors.set_orientation(self.action)
111+ self.assertThat(o_proxy.physicalOrientation,
112+ Eventually(Equals(self.orientation), timeout=15))
113+ self._assert_change_of_orientation_and_angle()
tests/libs/UbuntuGestures/tst_TouchRegistry.cpp+75−76
@@ -53,8 +53,8 @@ private Q_SLOTS:
5353 void initTestCase() {} // will be called before the first test function is executed
5454 void cleanupTestCase() {} // will be called after the last test function was executed.
5555
56− void init() {} // called right before each and every test function is executed
57− void cleanup() {} // called right after each and every test function is executed
56+ void init(); // called right before each and every test function is executed
57+ void cleanup(); // called right after each and every test function is executed
5858
5959 void requestWithNoCandidates();
6060 void lateCandidateRequestGetsNothing();
@@ -67,11 +67,23 @@ private Q_SLOTS:
6767 void rejectingTouchfterItsEnd();
6868 void removeOldUndecidedCandidates();
6969 void interimOwnerWontGetUnownedTouchEvents();
70+
71+private:
72+ TouchRegistry *touchRegistry;
7073};
7174
75+void tst_TouchRegistry::init()
76+{
77+ touchRegistry = TouchRegistry::instance();
78+}
79+
80+void tst_TouchRegistry::cleanup()
81+{
82+ delete touchRegistry;
83+}
84+
7285void tst_TouchRegistry::requestWithNoCandidates()
7386{
74− TouchRegistry touchRegistry;
7587 DummyCandidate candidate;
7688
7789 {
@@ -83,17 +95,16 @@ void tst_TouchRegistry::requestWithNoCandidates()
8395 Qt::NoModifier,
8496 Qt::TouchPointPressed,
8597 touchPoints);
86− touchRegistry.update(&touchEvent);
98+ touchRegistry->update(&touchEvent);
8799 }
88100
89− touchRegistry.requestTouchOwnership(0, &candidate);
101+ touchRegistry->requestTouchOwnership(0, &candidate);
90102
91103 QVERIFY(candidate.ownedTouches.contains(0));
92104}
93105
94106void tst_TouchRegistry::lateCandidateRequestGetsNothing()
95107{
96− TouchRegistry touchRegistry;
97108 DummyCandidate earlyCandidate;
98109 earlyCandidate.setObjectName("early");
99110 DummyCandidate lateCandidate;
@@ -108,21 +119,21 @@ void tst_TouchRegistry::lateCandidateRequestGetsNothing()
108119 Qt::NoModifier,
109120 Qt::TouchPointPressed,
110121 touchPoints);
111− touchRegistry.update(&touchEvent);
122+ touchRegistry->update(&touchEvent);
112123 }
113124
114− touchRegistry.addCandidateOwnerForTouch(0, &earlyCandidate);
115− touchRegistry.addCandidateOwnerForTouch(0, &lateCandidate);
125+ touchRegistry->addCandidateOwnerForTouch(0, &earlyCandidate);
126+ touchRegistry->addCandidateOwnerForTouch(0, &lateCandidate);
116127
117128 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
118129 QVERIFY(lateCandidate.ownedTouches.isEmpty());
119130
120− touchRegistry.requestTouchOwnership(0, &lateCandidate);
131+ touchRegistry->requestTouchOwnership(0, &lateCandidate);
121132
122133 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
123134 QVERIFY(lateCandidate.ownedTouches.isEmpty());
124135
125− touchRegistry.requestTouchOwnership(0, &earlyCandidate);
136+ touchRegistry->requestTouchOwnership(0, &earlyCandidate);
126137
127138 QVERIFY(earlyCandidate.ownedTouches.contains(0));
128139 QVERIFY(lateCandidate.ownedTouches.isEmpty());
@@ -130,7 +141,6 @@ void tst_TouchRegistry::lateCandidateRequestGetsNothing()
130141
131142void tst_TouchRegistry::lateCandidateGestOwnershipOnceEarlyCandidateQuits()
132143{
133− TouchRegistry touchRegistry;
134144 DummyCandidate earlyCandidate;
135145 DummyCandidate lateCandidate;
136146
@@ -143,21 +153,21 @@ void tst_TouchRegistry::lateCandidateGestOwnershipOnceEarlyCandidateQuits()
143153 Qt::NoModifier,
144154 Qt::TouchPointPressed,
145155 touchPoints);
146− touchRegistry.update(&touchEvent);
156+ touchRegistry->update(&touchEvent);
147157 }
148158
149− touchRegistry.addCandidateOwnerForTouch(0, &earlyCandidate);
150− touchRegistry.addCandidateOwnerForTouch(0, &lateCandidate);
159+ touchRegistry->addCandidateOwnerForTouch(0, &earlyCandidate);
160+ touchRegistry->addCandidateOwnerForTouch(0, &lateCandidate);
151161
152162 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
153163 QVERIFY(lateCandidate.ownedTouches.isEmpty());
154164
155− touchRegistry.requestTouchOwnership(0, &lateCandidate);
165+ touchRegistry->requestTouchOwnership(0, &lateCandidate);
156166
157167 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
158168 QVERIFY(lateCandidate.ownedTouches.isEmpty());
159169
160− touchRegistry.removeCandidateOwnerForTouch(0, &earlyCandidate);
170+ touchRegistry->removeCandidateOwnerForTouch(0, &earlyCandidate);
161171
162172 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
163173 QVERIFY(lateCandidate.ownedTouches.contains(0));
@@ -165,7 +175,6 @@ void tst_TouchRegistry::lateCandidateGestOwnershipOnceEarlyCandidateQuits()
165175
166176void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
167177{
168− TouchRegistry touchRegistry;
169178 QQuickItem rootItem;
170179
171180 DummyCandidate candidate0;
@@ -190,10 +199,10 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
190199 Qt::NoModifier,
191200 Qt::TouchPointPressed,
192201 touchPoints);
193− touchRegistry.update(&touchEvent);
202+ touchRegistry->update(&touchEvent);
194203 }
195204
196− touchRegistry.addCandidateOwnerForTouch(0, &candidate0);
205+ touchRegistry->addCandidateOwnerForTouch(0, &candidate0);
197206
198207 {
199208 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -208,7 +217,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
208217 Qt::NoModifier,
209218 Qt::TouchPointPressed | Qt::TouchPointMoved,
210219 touchPoints);
211− touchRegistry.update(&touchEvent);
220+ touchRegistry->update(&touchEvent);
212221 }
213222
214223 // candidate0 should have received an update on the touch he's interested on.
@@ -220,7 +229,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
220229 QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].rect().x(), 11 - candidate0.x());
221230 QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].rect().y(), 11 - candidate0.y());
222231
223− touchRegistry.addCandidateOwnerForTouch(1, &candidate1);
232+ touchRegistry->addCandidateOwnerForTouch(1, &candidate1);
224233
225234 {
226235 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -235,7 +244,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
235244 Qt::NoModifier,
236245 Qt::TouchPointPressed | Qt::TouchPointMoved,
237246 touchPoints);
238− touchRegistry.update(&touchEvent);
247+ touchRegistry->update(&touchEvent);
239248 }
240249
241250 // candidate0 gets updates only for touch 0 and
@@ -252,7 +261,6 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
252261
253262void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
254263{
255− TouchRegistry touchRegistry;
256264 QQuickItem rootItem;
257265
258266 DummyCandidate watcher;
@@ -271,10 +279,10 @@ void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
271279 Qt::NoModifier,
272280 Qt::TouchPointPressed,
273281 touchPoints);
274− touchRegistry.update(&touchEvent);
282+ touchRegistry->update(&touchEvent);
275283 }
276284
277− touchRegistry.addTouchWatcher(0, &watcher);
285+ touchRegistry->addTouchWatcher(0, &watcher);
278286
279287 {
280288 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -289,7 +297,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
289297 Qt::NoModifier,
290298 Qt::TouchPointPressed | Qt::TouchPointMoved,
291299 touchPoints);
292− touchRegistry.update(&touchEvent);
300+ touchRegistry->update(&touchEvent);
293301 }
294302
295303 // watcher should have received an update on the touch he's interested on.
@@ -314,7 +322,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
314322 Qt::NoModifier,
315323 Qt::TouchPointPressed | Qt::TouchPointMoved,
316324 touchPoints);
317− touchRegistry.update(&touchEvent);
325+ touchRegistry->update(&touchEvent);
318326 }
319327
320328 // watcher gets updates only for touch 0
@@ -326,7 +334,6 @@ void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
326334
327335void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
328336{
329− TouchRegistry touchRegistry;
330337 DummyCandidate item;
331338
332339 {
@@ -338,10 +345,10 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
338345 Qt::NoModifier,
339346 Qt::TouchPointPressed,
340347 touchPoints);
341− touchRegistry.update(&touchEvent);
348+ touchRegistry->update(&touchEvent);
342349 }
343350
344− touchRegistry.addCandidateOwnerForTouch(0, &item);
351+ touchRegistry->addCandidateOwnerForTouch(0, &item);
345352
346353 {
347354 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -354,7 +361,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
354361 Qt::NoModifier,
355362 Qt::TouchPointPressed | Qt::TouchPointMoved,
356363 touchPoints);
357− touchRegistry.update(&touchEvent);
364+ touchRegistry->update(&touchEvent);
358365 }
359366
360367 QCOMPARE(item.unownedTouchEvents.count(), 1);
@@ -362,7 +369,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
362369 QCOMPARE(item.unownedTouchEvents[0].touchPoints[0].id(), 0);
363370 item.unownedTouchEvents.clear();
364371
365− touchRegistry.addTouchWatcher(1, &item);
372+ touchRegistry->addTouchWatcher(1, &item);
366373
367374 {
368375 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -375,7 +382,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
375382 Qt::NoModifier,
376383 Qt::TouchPointMoved,
377384 touchPoints);
378− touchRegistry.update(&touchEvent);
385+ touchRegistry->update(&touchEvent);
379386 }
380387
381388 QCOMPARE(item.unownedTouchEvents.count(), 1);
@@ -395,7 +402,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
395402 Qt::NoModifier,
396403 Qt::TouchPointReleased | Qt::TouchPointMoved,
397404 touchPoints);
398− touchRegistry.update(&touchEvent);
405+ touchRegistry->update(&touchEvent);
399406 }
400407
401408 QCOMPARE(item.unownedTouchEvents.count(), 1);
@@ -404,7 +411,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
404411 QVERIFY(item.unownedTouchEvents[0].containsTouchWithId(1));
405412 item.unownedTouchEvents.clear();
406413
407− touchRegistry.removeCandidateOwnerForTouch(0, &item);
414+ touchRegistry->removeCandidateOwnerForTouch(0, &item);
408415
409416 {
410417 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -415,7 +422,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
415422 Qt::NoModifier,
416423 Qt::TouchPointReleased,
417424 touchPoints);
418− touchRegistry.update(&touchEvent);
425+ touchRegistry->update(&touchEvent);
419426 }
420427
421428 QCOMPARE(item.unownedTouchEvents.count(), 1);
@@ -423,7 +430,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
423430 QVERIFY(item.unownedTouchEvents[0].containsTouchWithId(1));
424431 item.unownedTouchEvents.clear();
425432
426− QVERIFY(touchRegistry.m_touchInfoPool.isEmpty());
433+ QVERIFY(touchRegistry->m_touchInfoPool.isEmpty());
427434}
428435
429436/*
@@ -432,7 +439,6 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
432439 */
433440void tst_TouchRegistry::candidatesAndWatchers_1()
434441{
435− TouchRegistry touchRegistry;
436442 DummyCandidate item;
437443
438444 {
@@ -444,10 +450,10 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
444450 Qt::NoModifier,
445451 Qt::TouchPointPressed,
446452 touchPoints);
447− touchRegistry.update(&touchEvent);
453+ touchRegistry->update(&touchEvent);
448454 }
449455
450− touchRegistry.addCandidateOwnerForTouch(0, &item);
456+ touchRegistry->addCandidateOwnerForTouch(0, &item);
451457
452458 {
453459 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -460,14 +466,14 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
460466 Qt::NoModifier,
461467 Qt::TouchPointPressed | Qt::TouchPointMoved,
462468 touchPoints);
463− touchRegistry.update(&touchEvent);
469+ touchRegistry->update(&touchEvent);
464470 }
465471
466− touchRegistry.addTouchWatcher(1, &item);
472+ touchRegistry->addTouchWatcher(1, &item);
467473
468− touchRegistry.removeCandidateOwnerForTouch(0, &item);
474+ touchRegistry->removeCandidateOwnerForTouch(0, &item);
469475
470− touchRegistry.addTouchWatcher(0, &item);
476+ touchRegistry->addTouchWatcher(0, &item);
471477
472478 {
473479 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -480,7 +486,7 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
480486 Qt::NoModifier,
481487 Qt::TouchPointReleased | Qt::TouchPointMoved,
482488 touchPoints);
483− touchRegistry.update(&touchEvent);
489+ touchRegistry->update(&touchEvent);
484490 }
485491
486492 {
@@ -492,10 +498,10 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
492498 Qt::NoModifier,
493499 Qt::TouchPointReleased,
494500 touchPoints);
495− touchRegistry.update(&touchEvent);
501+ touchRegistry->update(&touchEvent);
496502 }
497503
498− QVERIFY(touchRegistry.m_touchInfoPool.isEmpty());
504+ QVERIFY(touchRegistry->m_touchInfoPool.isEmpty());
499505
500506 item.unownedTouchEvents.clear();
501507
@@ -508,7 +514,7 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
508514 Qt::NoModifier,
509515 Qt::TouchPointPressed,
510516 touchPoints);
511− touchRegistry.update(&touchEvent);
517+ touchRegistry->update(&touchEvent);
512518 }
513519
514520 // Haven't made any subscription for that new touch 0.
@@ -521,8 +527,6 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
521527 */
522528void tst_TouchRegistry::candidatesAndWatchers_2()
523529{
524− TouchRegistry touchRegistry;
525−
526530 DummyCandidate directionalDragArea;
527531 directionalDragArea.setObjectName("DirectionalDragArea");
528532
@@ -539,14 +543,14 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
539543 Qt::NoModifier,
540544 Qt::TouchPointPressed,
541545 touchPoints);
542− touchRegistry.update(&touchEvent);
546+ touchRegistry->update(&touchEvent);
543547 }
544548
545549 // [TouchRegistry] addCandidateOwnerForTouch id 0 candidate DirectionalDragArea
546− touchRegistry.addCandidateOwnerForTouch(0, &directionalDragArea);
550+ touchRegistry->addCandidateOwnerForTouch(0, &directionalDragArea);
547551
548552 // [TouchRegistry] requestTouchOwnership id 0 candidate TouchGate
549− touchRegistry.requestTouchOwnership(0, &touchGate);
553+ touchRegistry->requestTouchOwnership(0, &touchGate);
550554
551555 //[TouchRegistry] got TouchUpdate (id:0, state:moved, scenePos:(147,1023)) (id:1, state:pressed, scenePos:(327,792))
552556 {
@@ -560,24 +564,24 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
560564 Qt::NoModifier,
561565 Qt::TouchPointPressed | Qt::TouchPointMoved,
562566 touchPoints);
563− touchRegistry.update(&touchEvent);
567+ touchRegistry->update(&touchEvent);
564568 }
565569
566570 // [TouchRegistry] addTouchWatcher id 1 watcher DirectionalDragArea
567− touchRegistry.addTouchWatcher(1, &directionalDragArea);
571+ touchRegistry->addTouchWatcher(1, &directionalDragArea);
568572
569573 // [TouchRegistry] removeCandidateOwnerForTouch id 0 candidate DirectionalDragArea
570− touchRegistry.removeCandidateOwnerForTouch(0, &directionalDragArea);
574+ touchRegistry->removeCandidateOwnerForTouch(0, &directionalDragArea);
571575
572576 //[TouchRegistry] sending TouchWonershipEvent(id = 0 gained) to candidate TouchGate
573577 QCOMPARE(touchGate.ownedTouches.count(), 1);
574578 QVERIFY(touchGate.ownedTouches.contains(0));
575579
576580 // [TouchRegistry] addTouchWatcher id 0 watcher DirectionalDragArea
577− touchRegistry.addTouchWatcher(0, &directionalDragArea);
581+ touchRegistry->addTouchWatcher(0, &directionalDragArea);
578582
579583 // [TouchRegistry] requestTouchOwnership id 1 candidate TouchGate
580− touchRegistry.requestTouchOwnership(1, &touchGate);
584+ touchRegistry->requestTouchOwnership(1, &touchGate);
581585
582586 //[TouchRegistry] sending TouchWonershipEvent(id = 1 gained) to candidate TouchGate
583587 QCOMPARE(touchGate.ownedTouches.count(), 2);
@@ -598,7 +602,7 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
598602 Qt::NoModifier,
599603 Qt::TouchPointMoved,
600604 touchPoints);
601− touchRegistry.update(&touchEvent);
605+ touchRegistry->update(&touchEvent);
602606 }
603607
604608 //vvvvv DDA Watchers are being ignored from now on vvvvvvv
@@ -624,7 +628,7 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
624628 Qt::NoModifier,
625629 Qt::TouchPointMoved | Qt::TouchPointReleased,
626630 touchPoints);
627− touchRegistry.update(&touchEvent);
631+ touchRegistry->update(&touchEvent);
628632 }
629633
630634 QCOMPARE(directionalDragArea.unownedTouchEvents.count(), 1);
@@ -646,7 +650,7 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
646650 Qt::NoModifier,
647651 Qt::TouchPointReleased,
648652 touchPoints);
649− touchRegistry.update(&touchEvent);
653+ touchRegistry->update(&touchEvent);
650654 }
651655
652656 QCOMPARE(directionalDragArea.unownedTouchEvents.count(), 1);
@@ -658,7 +662,6 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
658662
659663void tst_TouchRegistry::rejectingTouchfterItsEnd()
660664{
661− TouchRegistry touchRegistry;
662665 DummyCandidate earlyCandidate;
663666 DummyCandidate lateCandidate;
664667
@@ -671,16 +674,16 @@ void tst_TouchRegistry::rejectingTouchfterItsEnd()
671674 Qt::NoModifier,
672675 Qt::TouchPointPressed,
673676 touchPoints);
674− touchRegistry.update(&touchEvent);
677+ touchRegistry->update(&touchEvent);
675678 }
676679
677− touchRegistry.addCandidateOwnerForTouch(0, &earlyCandidate);
678− touchRegistry.addCandidateOwnerForTouch(0, &lateCandidate);
680+ touchRegistry->addCandidateOwnerForTouch(0, &earlyCandidate);
681+ touchRegistry->addCandidateOwnerForTouch(0, &lateCandidate);
679682
680683 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
681684 QVERIFY(lateCandidate.ownedTouches.isEmpty());
682685
683− touchRegistry.requestTouchOwnership(0, &lateCandidate);
686+ touchRegistry->requestTouchOwnership(0, &lateCandidate);
684687
685688 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
686689 QVERIFY(lateCandidate.ownedTouches.isEmpty());
@@ -694,25 +697,25 @@ void tst_TouchRegistry::rejectingTouchfterItsEnd()
694697 Qt::NoModifier,
695698 Qt::TouchPointPressed,
696699 touchPoints);
697− touchRegistry.update(&touchEvent);
700+ touchRegistry->update(&touchEvent);
698701 }
699702
700703 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
701704 QVERIFY(lateCandidate.ownedTouches.isEmpty());
702705
703− touchRegistry.removeCandidateOwnerForTouch(0, &earlyCandidate);
706+ touchRegistry->removeCandidateOwnerForTouch(0, &earlyCandidate);
704707
705708 QCOMPARE(lateCandidate.ownedTouches.count(), 1);
706709 QCOMPARE(lateCandidate.ownedTouches.contains(0), 1);
707710
708711 // Check that there's no trace left of touch 0 as we no longer need to keep tabs on it.
709− QVERIFY(!touchRegistry.findTouchInfo(0));
712+ QVERIFY(!touchRegistry->findTouchInfo(0));
710713}
711714
712715void tst_TouchRegistry::removeOldUndecidedCandidates()
713716{
714717 FakeTimerFactory *fakeTimerFactory = new FakeTimerFactory;
715− TouchRegistry *touchRegistry = new TouchRegistry(nullptr, fakeTimerFactory);
718+ touchRegistry->setTimerFactory(fakeTimerFactory);
716719
717720 DummyCandidate undecidedCandidate;
718721 undecidedCandidate.setObjectName("undecided");
@@ -749,8 +752,6 @@ void tst_TouchRegistry::removeOldUndecidedCandidates()
749752 QVERIFY(undecidedCandidate.lostTouches.contains(0));
750753 QVERIFY(candidateThatWantsTouch.ownedTouches.contains(0));
751754 QVERIFY(candidateThatWantsTouch.lostTouches.isEmpty());
752−
753− delete touchRegistry;
754755}
755756
756757/*
@@ -762,7 +763,7 @@ void tst_TouchRegistry::removeOldUndecidedCandidates()
762763void tst_TouchRegistry::interimOwnerWontGetUnownedTouchEvents()
763764{
764765 FakeTimerFactory *fakeTimerFactory = new FakeTimerFactory;
765− TouchRegistry *touchRegistry = new TouchRegistry(nullptr, fakeTimerFactory);
766+ touchRegistry->setTimerFactory(fakeTimerFactory);
766767
767768 DummyCandidate undecidedCandidate;
768769 undecidedCandidate.setObjectName("undecided");
@@ -814,8 +815,6 @@ void tst_TouchRegistry::interimOwnerWontGetUnownedTouchEvents()
814815
815816 QCOMPARE(undecidedCandidate.unownedTouchEvents.count(), 2);
816817 QCOMPARE(interimOwner.unownedTouchEvents.count(), 0);
817−
818− delete touchRegistry;
819818}
820819
821820////////////// TouchMemento //////////
tests/mocks/AccountsService/plugin.h+1−1
@@ -29,7 +29,7 @@ class AccountsServicePlugin : public QQmlExtensionPlugin
2929 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
3030
3131public:
32− void registerTypes(const char *uri);
32+ void registerTypes(const char *uri) override;
3333};
3434
3535#endif
tests/mocks/CMakeLists.txt+1
@@ -41,6 +41,7 @@ add_subdirectory(Ubuntu)
4141add_subdirectory(Unity)
4242add_subdirectory(QtMultimedia)
4343add_subdirectory(Wizard)
44+add_subdirectory(Utils)
4445
4546install(
4647 DIRECTORY data
tests/mocks/GSettings.1.0/fake_gsettings.h+2−2
@@ -78,10 +78,10 @@ public:
7878 ~GSettingsControllerQml();
7979
8080 QString pictureUri() const;
81− void setPictureUri(const QString &str);
81+ Q_INVOKABLE void setPictureUri(const QString &str);
8282
8383 QString usageMode() const;
84− void setUsageMode(const QString &usageMode);
84+ Q_INVOKABLE void setUsageMode(const QString &usageMode);
8585
8686Q_SIGNALS:
8787 void pictureUriChanged(const QString&);
tests/mocks/GSettings.1.0/plugin.cpp+6
@@ -19,8 +19,14 @@
1919
2020#include <QtQml/qqml.h>
2121
22+static QObject* controllerProvider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
23+{
24+ return GSettingsControllerQml::instance();
25+}
26+
2227void FakeGSettingsQmlPlugin::registerTypes(const char *uri)
2328{
29+ qmlRegisterSingletonType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController", controllerProvider);
2430 qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings");
2531 qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema",
2632 "GSettingsSchema can only be used inside of a GSettings component");
tests/mocks/GSettings.1.0/plugin.h+1−1
@@ -25,7 +25,7 @@ class FakeGSettingsQmlPlugin : public QQmlExtensionPlugin
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
2929};
3030
3131#endif // PLUGIN_H
tests/mocks/LightDM/liblightdm/UsersModel.h+2−2
@@ -53,8 +53,8 @@ public:
5353 BackgroundPathRole
5454 };
5555
56− int rowCount(const QModelIndex &parent) const;
57− QVariant data(const QModelIndex &index, int role) const;
56+ int rowCount(const QModelIndex &parent) const override;
57+ QVariant data(const QModelIndex &index, int role) const override;
5858
5959 QString mockMode() const;
6060 void setMockMode(QString mockMode);
tests/mocks/LightDM/plugin.h+1−1
@@ -26,7 +26,7 @@ class LightDMPlugin : public QQmlExtensionPlugin
2626 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2727
2828public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
3030};
3131
3232#endif
tests/mocks/Lights/plugin.h+1−1
@@ -26,7 +26,7 @@ class PowerdPlugin : public QQmlExtensionPlugin
2626 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2727
2828public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
3030};
3131
3232#endif
tests/mocks/MeeGo/QOfono/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
2929};
3030
3131#endif // MOCK_QOFONO_PLUGIN_H
tests/mocks/Powerd/plugin.h+1−1
@@ -28,7 +28,7 @@ class PowerdPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
tests/mocks/QMenuModel/plugin.h+1−1
@@ -28,7 +28,7 @@ class QMenuModelPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
tests/mocks/QMenuModel/unitymenumodel.h+6−6
@@ -61,12 +61,12 @@ public:
6161
6262 QString nameOwner() const;
6363
64− int rowCount(const QModelIndex &parent = QModelIndex()) const;
65− int columnCount(const QModelIndex &parent = QModelIndex()) const;
66− QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
67− QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
68− QModelIndex parent(const QModelIndex &index) const;
69− QHash<int, QByteArray> roleNames() const;
64+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
65+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
66+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
67+ QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override;
68+ QModelIndex parent(const QModelIndex &index) const override;
69+ QHash<int, QByteArray> roleNames() const override;
7070
7171 Q_INVOKABLE QObject * submenu(int position, QQmlComponent* actionStateParser = nullptr);
7272 Q_INVOKABLE bool loadExtendedAttributes(int position, const QVariantMap &schema);
tests/mocks/QtMultimedia/plugin.h+1−1
@@ -28,7 +28,7 @@ class MockQtMultimediaPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
tests/mocks/Ubuntu/Connectivity/plugin.h+2−2
@@ -28,8 +28,8 @@ class QmlConnectivityNetworkingPlugin : public QQmlExtensionPlugin {
2828 Q_INTERFACES(QQmlExtensionInterface)
2929
3030public:
31− void registerTypes(const char *uri);
32− void initializeEngine(QQmlEngine *engine, const char *uri);
31+ void registerTypes(const char *uri) override;
32+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
3333};
3434
3535#endif // QML_CONNECTIVITY_PLUGIN_H
tests/mocks/Ubuntu/DownloadDaemonListener/plugin.h+1−1
@@ -24,7 +24,7 @@ class FakeUbuntuDownloadDaemonListenerQmlPlugin : public QQmlExtensionPlugin
2424 Q_OBJECT
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626public:
27− void registerTypes(const char *uri);
27+ void registerTypes(const char *uri) override;
2828};
2929
3030#endif
tests/mocks/Ubuntu/Payments/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
2929};
3030
3131#endif // PAYMENTS_PLUGIN_H
tests/mocks/Ubuntu/SystemImage/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
2929};
3030
3131#endif // MOCK_SYSTEMIMAGE_PLUGIN_H
tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
2929};
3030
3131#endif // MOCK_SECURITYPRIVACY_PLUGIN_H
tests/mocks/Ubuntu/Telephony/MockCallEntry.h+1−1
@@ -53,7 +53,7 @@ Q_SIGNALS:
5353 void elapsedTimerRunningChanged();
5454
5555protected:
56− void timerEvent(QTimerEvent * event);
56+ void timerEvent(QTimerEvent * event) override;
5757
5858private:
5959 QString m_phoneNumber;
tests/mocks/Ubuntu/Telephony/plugin.h+2−2
@@ -27,8 +27,8 @@ class FakeUbuntuTelephonyQmlPlugin : public QQmlExtensionPlugin
2727 Q_OBJECT
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929public:
30− void initializeEngine(QQmlEngine *engine, const char *uri);
31− void registerTypes(const char *uri);
30+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
31+ void registerTypes(const char *uri) override;
3232
3333private:
3434 QQmlContext *mRootContext;
tests/mocks/Unity/Application/ApplicationManager.cpp+1−1
@@ -143,7 +143,7 @@ QModelIndex ApplicationManager::findIndex(ApplicationInfo* application)
143143}
144144
145145void ApplicationManager::add(ApplicationInfo *application) {
146− if (!application) {
146+ if (!application || m_runningApplications.contains(application)) {
147147 return;
148148 }
149149
tests/mocks/Unity/Application/CMakeLists.txt−4
@@ -1,7 +1,3 @@
1−include_directories(
2− ${APPLICATION_API_INCLUDE_DIRS}
3−)
4−
51set(FakeUnityApplicationQml_SOURCES
62 plugin.cpp
73 ApplicationInfo.cpp
tests/mocks/Unity/Application/ObjectListModel.h+1−1
@@ -76,7 +76,7 @@ public:
7676 return QVariant();
7777 }
7878
79− QHash<int, QByteArray> roleNames() const
79+ QHash<int, QByteArray> roleNames() const override
8080 {
8181 QHash<int, QByteArray> roleNames;
8282 roleNames.insert(RoleModelData, "modelData");
tests/mocks/Unity/Application/plugin.h+2−2
@@ -24,8 +24,8 @@ class FakeUnityApplicationQmlPlugin : public QQmlExtensionPlugin
2424 Q_OBJECT
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626public:
27− void registerTypes(const char *uri);
28− void initializeEngine(QQmlEngine *engine, const char *uri);
27+ void registerTypes(const char *uri) override;
28+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
2929};
3030
3131#endif
tests/mocks/Unity/Connectivity/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
2929};
3030
3131#endif // MOCK_CONNECTIVITY_PLUGIN_H
tests/mocks/Unity/DashCommunicator/plugin.h+1−1
@@ -28,7 +28,7 @@ class DashCommunicatorPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
tests/mocks/Unity/Indicators/fakeindicatorsmodel.h+5−5
@@ -50,11 +50,11 @@ public:
5050 QVariant modelData() const { return m_modelData; }
5151
5252 /* QAbstractItemModel */
53− QHash<int, QByteArray> roleNames() const;
54− int columnCount(const QModelIndex &parent = QModelIndex()) const;
55− QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
56− QModelIndex parent (const QModelIndex &index) const;
57− int rowCount(const QModelIndex &parent = QModelIndex()) const;
53+ QHash<int, QByteArray> roleNames() const override;
54+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
55+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
56+ QModelIndex parent (const QModelIndex &index) const override;
57+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
5858
5959Q_SIGNALS:
6060 void countChanged();
tests/mocks/Unity/Indicators/fakeplugin.h+1−1
@@ -26,7 +26,7 @@ class IndicatorsFakePlugin : public QQmlExtensionPlugin
2626 Q_OBJECT
2727 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2828public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
3030};
3131
3232#endif // INDICATORS_FAKE_PLUGIN_H
tests/mocks/Unity/Launcher/MockLauncherItem.h+2−2
@@ -43,9 +43,9 @@ public:
4343 int progress() const override;
4444 int count() const override;
4545 bool countVisible() const override;
46− bool focused() const;
46+ bool focused() const override;
4747
48− unity::shell::launcher::QuickListModelInterface *quickList() const;
48+ unity::shell::launcher::QuickListModelInterface *quickList() const override;
4949
5050private:
5151 void setPinned(bool pinned);
tests/mocks/Unity/Launcher/MockLauncherModel.h+10−10
@@ -34,20 +34,20 @@ public:
3434 MockLauncherModel(QObject* parent = 0);
3535 ~MockLauncherModel();
3636
37− int rowCount(const QModelIndex& parent) const;
37+ int rowCount(const QModelIndex& parent) const override;
3838
39− QVariant data(const QModelIndex& index, int role) const;
39+ QVariant data(const QModelIndex& index, int role) const override;
4040
41− Q_INVOKABLE unity::shell::launcher::LauncherItemInterface *get(int index) const;
42− Q_INVOKABLE void move(int oldIndex, int newIndex);
43− Q_INVOKABLE void pin(const QString &appId, int index = -1);
44− Q_INVOKABLE void requestRemove(const QString &appId);
45− Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
46− Q_INVOKABLE void setUser(const QString &username);
41+ Q_INVOKABLE unity::shell::launcher::LauncherItemInterface *get(int index) const override;
42+ Q_INVOKABLE void move(int oldIndex, int newIndex) override;
43+ Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
44+ Q_INVOKABLE void requestRemove(const QString &appId) override;
45+ Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
46+ Q_INVOKABLE void setUser(const QString &username) override;
4747 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
4848
49− unity::shell::application::ApplicationManagerInterface *applicationManager() const;
50− void setApplicationManager(unity::shell::application::ApplicationManagerInterface *applicationManager);
49+ unity::shell::application::ApplicationManagerInterface *applicationManager() const override;
50+ void setApplicationManager(unity::shell::application::ApplicationManagerInterface *applicationManager) override;
5151
5252 bool onlyPinned() const override;
5353 void setOnlyPinned(bool onlyPinned) override;
tests/mocks/Unity/Launcher/MockQuickListModel.h+2−2
@@ -30,9 +30,9 @@ class MockQuickListModel: public QuickListModelInterface
3030public:
3131 MockQuickListModel(QObject *parent = 0);
3232
33− QVariant data(const QModelIndex &index, int role) const;
33+ QVariant data(const QModelIndex &index, int role) const override;
3434
35− int rowCount(const QModelIndex &parent = QModelIndex()) const;
35+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
3636};
3737
3838#endif // MOCKQUICKLISTMODEL_H
tests/mocks/Unity/Launcher/plugin.h+1−1
@@ -29,7 +29,7 @@ class TestLauncherPlugin : public QQmlExtensionPlugin
2929 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
3030
3131public:
32− void registerTypes(const char* uri);
32+ void registerTypes(const char* uri) override;
3333};
3434
3535#endif // TESTLAUNCHER_PLUGIN_H
tests/mocks/Unity/Notifications/MockActionModel.h+3−3
@@ -32,9 +32,9 @@ public:
3232 ActionModel(QObject *parent=nullptr);
3333 virtual ~ActionModel();
3434
35− virtual int rowCount(const QModelIndex &index) const;
36− virtual QVariant data(const QModelIndex &index, int role) const;
37− virtual QHash<int, QByteArray> roleNames() const;
35+ int rowCount(const QModelIndex &index) const override;
36+ QVariant data(const QModelIndex &index, int role) const override;
37+ QHash<int, QByteArray> roleNames() const override;
3838
3939 Q_ENUMS(ActionsRoles)
4040 enum ActionsRoles {
tests/mocks/Unity/Notifications/MockNotificationModel.h+3−3
@@ -35,9 +35,9 @@ public:
3535 MockNotificationModel(QObject *parent=nullptr);
3636 virtual ~MockNotificationModel();
3737
38− virtual int rowCount(const QModelIndex &parent) const;
39− virtual QVariant data(const QModelIndex &index, int role) const;
40− virtual QHash<int, QByteArray> roleNames() const;
38+ int rowCount(const QModelIndex &parent) const override;
39+ QVariant data(const QModelIndex &index, int role) const override;
40+ QHash<int, QByteArray> roleNames() const override;
4141
4242 Q_INVOKABLE void append(MockNotification* n);
4343 MockNotification* getNotification(int id) const;
tests/mocks/Unity/Notifications/plugin.h+1−1
@@ -28,7 +28,7 @@ class TestNotificationPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char* uri);
31+ void registerTypes(const char* uri) override;
3232};
3333
3434#endif // TESTNOTIFICATION_PLUGIN_H
tests/mocks/Unity/fake_scopes.h+2−2
@@ -50,8 +50,8 @@ public:
5050 Q_INVOKABLE void clearFavorites();
5151 Q_INVOKABLE void load();
5252
53− QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
54− QModelIndex parent ( const QModelIndex & index ) const;
53+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
54+ QModelIndex parent ( const QModelIndex & index ) const override;
5555
5656 bool loaded() const override;
5757 int count() const override;
tests/mocks/Unity/fake_unity_plugin.h+1−1
@@ -28,7 +28,7 @@ class FakeUnityPlugin : public QQmlExtensionPlugin
2828 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
3232};
3333
3434#endif
tests/mocks/Utils/CMakeLists.txtnew file+40
@@ -0,0 +1,40 @@
1+pkg_search_module(GIO REQUIRED gio-2.0)
2+
3+include_directories(
4+ ${CMAKE_CURRENT_SOURCE_DIR}
5+ ${CMAKE_CURRENT_BINARY_DIR}
6+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
7+ ${GIO_INCLUDE_DIRS}
8+ ${CMAKE_SOURCE_DIR}/plugins/Utils
9+)
10+
11+set(QMLPLUGIN_SRC
12+ ${CMAKE_SOURCE_DIR}/plugins/Utils/inputwatcher.cpp
13+ ${CMAKE_SOURCE_DIR}/plugins/Utils/qlimitproxymodelqml.cpp
14+ ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
15+ ${CMAKE_SOURCE_DIR}/plugins/Utils/relativetimeformatter.cpp
16+ ${CMAKE_SOURCE_DIR}/plugins/Utils/timeformatter.cpp
17+ ${CMAKE_SOURCE_DIR}/plugins/Utils/unitymenumodelpaths.cpp
18+ ${CMAKE_SOURCE_DIR}/plugins/Utils/windowkeysfilter.cpp
19+ ${CMAKE_SOURCE_DIR}/plugins/Utils/windowscreenshotprovider.cpp
20+ ${CMAKE_SOURCE_DIR}/plugins/Utils/easingcurve.cpp
21+ constants.cpp
22+ plugin.cpp
23+ windowstatestorage.cpp
24+ )
25+
26+add_library(FakeUtils-qml SHARED
27+ ${QMLPLUGIN_SRC}
28+ )
29+
30+target_link_libraries(FakeUtils-qml ${GIO_LDFLAGS})
31+
32+# Because this is an internal support library, we want
33+# to expose all symbols in it. Consider changing this
34+# either to a static library or just using the
35+# files directly in targets.
36+set_target_properties(FakeUtils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
37+
38+qt5_use_modules(FakeUtils-qml Qml Quick DBus Network Gui)
39+
40+add_unity8_mock(Utils 0.1 Utils TARGETS FakeUtils-qml)
tests/mocks/Utils/HomeKeyWatcher.qmlnew file+21
@@ -0,0 +1,21 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+
19+QtObject {
20+ signal activated()
21+}
tests/mocks/Utils/Style.jsnew file+37
@@ -0,0 +1,37 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+.pragma library
18+
19+/*! \brief Calculate average luminance of the passed colors
20+
21+ \note If not fully opaque, luminance is dependant on blending.
22+ */
23+function luminance() {
24+ var sum = 0;
25+ // TODO this was originally
26+ // for (var k in arguments) {
27+ // but for some unkown reason was causing crashes in testDash/testDashContent
28+ // investigate when we have some time
29+ for (var k = 0; k < arguments.length; ++k) {
30+ // only way to convert string to color
31+ var c = Qt.lighter(arguments[k], 1.0);
32+
33+ sum += 0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b;
34+ }
35+
36+ return sum / arguments.length;
37+}
tests/mocks/Utils/Utils.qmltypesnew file+175
@@ -0,0 +1,175 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Utils 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "EasingCurve"
12+ prototype: "QObject"
13+ exports: ["Utils/EasingCurve 0.1"]
14+ exportMetaObjectRevisions: [0]
15+ Property { name: "type"; type: "QEasingCurve::Type" }
16+ Property { name: "period"; type: "double" }
17+ Property { name: "progress"; type: "double" }
18+ Property { name: "value"; type: "double"; isReadonly: true }
19+ }
20+ Component {
21+ name: "QAbstractProxyModel"
22+ prototype: "QAbstractItemModel"
23+ Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
24+ }
25+ Component { name: "QIdentityProxyModel"; prototype: "QAbstractProxyModel" }
26+ Component {
27+ name: "QLimitProxyModelQML"
28+ prototype: "QIdentityProxyModel"
29+ exports: ["Utils/LimitProxyModel 0.1"]
30+ exportMetaObjectRevisions: [0]
31+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
32+ Property { name: "limit"; type: "int" }
33+ Property { name: "count"; type: "int"; isReadonly: true }
34+ Signal { name: "totalCountChanged" }
35+ }
36+ Component {
37+ name: "QSortFilterProxyModel"
38+ prototype: "QAbstractProxyModel"
39+ Property { name: "filterRegExp"; type: "QRegExp" }
40+ Property { name: "filterKeyColumn"; type: "int" }
41+ Property { name: "dynamicSortFilter"; type: "bool" }
42+ Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
43+ Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
44+ Property { name: "isSortLocaleAware"; type: "bool" }
45+ Property { name: "sortRole"; type: "int" }
46+ Property { name: "filterRole"; type: "int" }
47+ Method {
48+ name: "setFilterRegExp"
49+ Parameter { name: "pattern"; type: "string" }
50+ }
51+ Method {
52+ name: "setFilterWildcard"
53+ Parameter { name: "pattern"; type: "string" }
54+ }
55+ Method {
56+ name: "setFilterFixedString"
57+ Parameter { name: "pattern"; type: "string" }
58+ }
59+ Method { name: "clear" }
60+ Method { name: "invalidate" }
61+ }
62+ Component {
63+ name: "RelativeTimeFormatter"
64+ prototype: "TimeFormatter"
65+ exports: ["Utils/RelativeTimeFormatter 0.1"]
66+ exportMetaObjectRevisions: [0]
67+ }
68+ Component {
69+ name: "TimeFormatter"
70+ prototype: "QObject"
71+ exports: ["Utils/GDateTimeFormatter 0.1", "Utils/TimeFormatter 0.1"]
72+ exportMetaObjectRevisions: [0, 0]
73+ Property { name: "format"; type: "string" }
74+ Property { name: "timeString"; type: "string"; isReadonly: true }
75+ Property { name: "time"; type: "qlonglong" }
76+ Signal {
77+ name: "formatChanged"
78+ Parameter { name: "format"; type: "string" }
79+ }
80+ Signal {
81+ name: "timeStringChanged"
82+ Parameter { name: "timeString"; type: "string" }
83+ }
84+ Signal {
85+ name: "timeChanged"
86+ Parameter { name: "time"; type: "qlonglong" }
87+ }
88+ }
89+ Component {
90+ name: "UnityMenuModelPaths"
91+ prototype: "QObject"
92+ exports: ["Utils/UnityMenuModelPaths 0.1"]
93+ exportMetaObjectRevisions: [0]
94+ Property { name: "source"; type: "QVariant" }
95+ Property { name: "busName"; type: "QByteArray"; isReadonly: true }
96+ Property { name: "actions"; type: "QVariantMap"; isReadonly: true }
97+ Property { name: "menuObjectPath"; type: "QByteArray"; isReadonly: true }
98+ Property { name: "busNameHint"; type: "QByteArray" }
99+ Property { name: "actionsHint"; type: "QByteArray" }
100+ Property { name: "menuObjectPathHint"; type: "QByteArray" }
101+ }
102+ Component {
103+ name: "UnitySortFilterProxyModelQML"
104+ prototype: "QSortFilterProxyModel"
105+ exports: ["Utils/UnitySortFilterProxyModel 0.1"]
106+ exportMetaObjectRevisions: [0]
107+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
108+ Property { name: "totalCount"; type: "int"; isReadonly: true }
109+ Property { name: "count"; type: "int"; isReadonly: true }
110+ Property { name: "invertMatch"; type: "bool" }
111+ Signal {
112+ name: "invertMatchChanged"
113+ Parameter { type: "bool" }
114+ }
115+ Method {
116+ name: "get"
117+ type: "QVariantMap"
118+ Parameter { name: "row"; type: "int" }
119+ }
120+ Method {
121+ name: "data"
122+ type: "QVariant"
123+ Parameter { name: "row"; type: "int" }
124+ Parameter { name: "role"; type: "int" }
125+ }
126+ Method { name: "count"; type: "int" }
127+ Method {
128+ name: "findFirst"
129+ type: "int"
130+ Parameter { name: "role"; type: "int" }
131+ Parameter { name: "value"; type: "QVariant" }
132+ }
133+ Method {
134+ name: "mapRowToSource"
135+ type: "int"
136+ Parameter { name: "row"; type: "int" }
137+ }
138+ Method {
139+ name: "mapFromSource"
140+ type: "int"
141+ Parameter { name: "row"; type: "int" }
142+ }
143+ Method {
144+ name: "mapToSource"
145+ type: "int"
146+ Parameter { name: "row"; type: "int" }
147+ }
148+ }
149+ Component {
150+ name: "WindowKeysFilter"
151+ defaultProperty: "data"
152+ prototype: "QQuickItem"
153+ exports: ["Utils/WindowKeysFilter 0.1"]
154+ exportMetaObjectRevisions: [0]
155+ }
156+ Component {
157+ name: "WindowStateStorage"
158+ prototype: "QObject"
159+ exports: ["Utils/WindowStateStorage 0.1"]
160+ isCreatable: false
161+ isSingleton: true
162+ exportMetaObjectRevisions: [0]
163+ Method {
164+ name: "saveGeometry"
165+ Parameter { name: "windowId"; type: "string" }
166+ Parameter { name: "rect"; type: "QRect" }
167+ }
168+ Method {
169+ name: "getGeometry"
170+ type: "QRect"
171+ Parameter { name: "windowId"; type: "string" }
172+ Parameter { name: "defaultValue"; type: "QRect" }
173+ }
174+ }
175+}
tests/mocks/Utils/constants.cppnew file+23
@@ -0,0 +1,23 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+*/
16+
17+#include "constants.h"
18+
19+Constants::Constants(QObject *parent)
20+ : QObject(parent)
21+{
22+ m_indicatorValueTimeout = 5000;
23+}
tests/mocks/Utils/constants.hnew file+43
@@ -0,0 +1,43 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+*/
16+
17+#ifndef CONSTANTS_H
18+#define CONSTANTS_H
19+
20+#include <QObject>
21+
22+/**
23+ * @brief The Constants class
24+ *
25+ * This singleton class exposes contants to Qml
26+ *
27+ */
28+
29+class Constants: public QObject
30+{
31+ Q_OBJECT
32+ Q_PROPERTY(int indicatorValueTimeout READ indicatorValueTimeout CONSTANT)
33+
34+public:
35+ Constants(QObject *parent = 0);
36+
37+ int indicatorValueTimeout() const { return m_indicatorValueTimeout; }
38+
39+private:
40+ int m_indicatorValueTimeout;
41+};
42+
43+#endif
tests/mocks/Utils/plugin.cppnew file+76
@@ -0,0 +1,76 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+// Qt
18+#include <QtQml/qqml.h>
19+#include <QDBusConnection>
20+#include <QQmlContext>
21+#include <QtQuick/QQuickWindow>
22+#include <QDebug>
23+
24+// local
25+#include "plugin.h"
26+#include "windowstatestorage.h"
27+#include "constants.h"
28+
29+// plugin
30+#include <inputwatcher.h>
31+#include <qlimitproxymodelqml.h>
32+#include <unitysortfilterproxymodelqml.h>
33+#include <relativetimeformatter.h>
34+#include <timeformatter.h>
35+#include <unitymenumodelpaths.h>
36+#include <windowkeysfilter.h>
37+#include <windowscreenshotprovider.h>
38+#include <easingcurve.h>
39+
40+static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
41+{
42+ Q_UNUSED(engine)
43+ Q_UNUSED(scriptEngine)
44+ return new WindowStateStorage();
45+}
46+
47+static QObject *createConstants(QQmlEngine *engine, QJSEngine *scriptEngine)
48+{
49+ Q_UNUSED(engine)
50+ Q_UNUSED(scriptEngine)
51+ return new Constants();
52+}
53+
54+void FakeUtilsPlugin::registerTypes(const char *uri)
55+{
56+ Q_ASSERT(uri == QLatin1String("Utils"));;
57+ qmlRegisterType<QAbstractItemModel>();
58+ qmlRegisterType<QLimitProxyModelQML>(uri, 0, 1, "LimitProxyModel");
59+ qmlRegisterType<UnitySortFilterProxyModelQML>(uri, 0, 1, "UnitySortFilterProxyModel");
60+ qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths");
61+ qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
62+ qmlRegisterType<WindowKeysFilter>(uri, 0, 1, "WindowKeysFilter");
63+ qmlRegisterType<GDateTimeFormatter>(uri, 0, 1, "GDateTimeFormatter");
64+ qmlRegisterType<EasingCurve>(uri, 0, 1, "EasingCurve");
65+ qmlRegisterType<RelativeTimeFormatter>(uri, 0, 1, "RelativeTimeFormatter");
66+ qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
67+ qmlRegisterType<InputWatcher>(uri, 0, 1, "InputWatcher");
68+ qmlRegisterSingletonType<Constants>(uri, 0, 1, "Constants", createConstants);
69+}
70+
71+void FakeUtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
72+{
73+ QQmlExtensionPlugin::initializeEngine(engine, uri);
74+
75+ engine->addImageProvider(QLatin1String("window"), new WindowScreenshotProvider);
76+}
tests/mocks/Utils/plugin.hnew file+33
@@ -0,0 +1,33 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef FAKE_UTILS_PLUGIN_H
18+#define FAKE_UTILS_PLUGIN_H
19+
20+#include <QtQml/QQmlEngine>
21+#include <QtQml/QQmlExtensionPlugin>
22+
23+class FakeUtilsPlugin : public QQmlExtensionPlugin
24+{
25+ Q_OBJECT
26+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27+
28+public:
29+ void registerTypes(const char *uri);
30+ void initializeEngine(QQmlEngine *engine, const char *uri);
31+};
32+
33+#endif
tests/mocks/Utils/qmldirnew file+5
@@ -0,0 +1,5 @@
1+module Utils
2+plugin FakeUtils-qml
3+typeinfo Utils.qmltypes
4+Style 0.1 Style.js
5+HomeKeyWatcher 0.1 HomeKeyWatcher.qml
tests/mocks/Utils/windowstatestorage.cppnew file+48
@@ -0,0 +1,48 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "windowstatestorage.h"
18+
19+#include <QRect>
20+
21+WindowStateStorage::WindowStateStorage(QObject *parent):
22+ QObject(parent)
23+{
24+}
25+
26+void WindowStateStorage::setGeometry(const QVariantMap& geometry)
27+{
28+ if (geometry != m_geometry) {
29+ m_geometry = geometry;
30+ Q_EMIT geometryChanged(m_geometry);
31+ }
32+}
33+
34+QVariantMap WindowStateStorage::geometry() const
35+{
36+ return m_geometry;
37+}
38+
39+void WindowStateStorage::saveGeometry(const QString &windowId, const QRect &rect)
40+{
41+ m_geometry[windowId] = rect;
42+}
43+
44+QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defaultValue)
45+{
46+ if (!m_geometry.contains(windowId)) return defaultValue;
47+ return m_geometry.value(windowId).toRect();
48+}
tests/mocks/Utils/windowstatestorage.hnew file+38
@@ -0,0 +1,38 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include <QObject>
18+#include <QVariantMap>
19+
20+class WindowStateStorage: public QObject
21+{
22+ Q_OBJECT
23+ Q_PROPERTY(QVariantMap geometry READ geometry WRITE setGeometry NOTIFY geometryChanged)
24+public:
25+ WindowStateStorage(QObject *parent = 0);
26+
27+ Q_INVOKABLE void saveGeometry(const QString &windowId, const QRect &rect);
28+ Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue);
29+
30+Q_SIGNALS:
31+ void geometryChanged(const QVariantMap& geometry);
32+
33+private:
34+ void setGeometry(const QVariantMap& geometry);
35+ QVariantMap geometry() const;
36+
37+ QVariantMap m_geometry;
38+};
tests/mocks/Wizard/mockplugin.h+1−1
@@ -26,7 +26,7 @@ class MockWizardPlugin : public QQmlExtensionPlugin
2626 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2727
2828public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
3030};
3131
3232#endif
tests/mocks/indicator-service/mock-indicator-service.c+76−12
@@ -27,8 +27,15 @@ typedef struct
2727 guint actions_export_id;
2828 guint menu_export_id;
2929 int action_delay;
30+ int change_interval;
3031} IndicatorTestService;
3132
33+typedef struct
34+{
35+ GSimpleAction *action;
36+ GVariant* value;
37+} Action;
38+
3239static void
3340bus_acquired (GDBusConnection *connection,
3441 const gchar *name,
@@ -96,10 +103,10 @@ actual_switch (gpointer user_data)
96103 gboolean state = g_variant_get_boolean (v);
97104 GVariant *new_state = g_variant_new_boolean (state == TRUE ? FALSE : TRUE);
98105
99− g_simple_action_set_state(G_SIMPLE_ACTION(action), new_state);
106+ g_simple_action_set_state(action, new_state);
100107
101108 g_variant_unref (v);
102− g_message ("switching");
109+ g_message ("switching %d", state);
103110 return FALSE;
104111}
105112
@@ -120,13 +127,12 @@ activate_switch (GSimpleAction *action,
120127static gboolean
121128actual_slide (gpointer user_data)
122129{
123− GSimpleAction *action = user_data;
124−
125− GVariant* new_state = g_object_get_qdata (G_OBJECT (action), slider_value_quark ());
130+ Action *slide_action = user_data;
126131
127− g_simple_action_set_state(G_SIMPLE_ACTION(action), new_state);
132+ g_simple_action_set_state(G_SIMPLE_ACTION(slide_action->action), slide_action->value);
133+ g_message ("sliding %f", g_variant_get_double(slide_action->value));
134+ free(slide_action);
128135
129− g_message ("switching");
130136 return FALSE;
131137}
132138
@@ -136,10 +142,40 @@ void change_slider (GSimpleAction *action,
136142{
137143 IndicatorTestService *indicator = user_data;
138144
139− g_object_set_qdata (G_OBJECT (action), slider_value_quark (), g_variant_ref(value));
145+ Action* slide_action = malloc(sizeof(Action));
146+ slide_action->action = action;
147+ slide_action->value = g_variant_ref(value);
140148
141− g_timeout_add(indicator->action_delay, actual_slide, action);
142− g_message ("slide delay %.03f", g_variant_get_double(value));
149+ g_timeout_add(indicator->action_delay, actual_slide, slide_action);
150+ g_message ("slide delay %f", g_variant_get_double(value));
151+}
152+
153+static gboolean
154+change_interval (gpointer user_data)
155+{
156+ g_message ("change interval");
157+
158+ IndicatorTestService *indicator = user_data;
159+
160+ GAction* action_switch = g_action_map_lookup_action(G_ACTION_MAP(indicator->actions), "action.switch");
161+ actual_switch(G_SIMPLE_ACTION(action_switch));
162+
163+ GAction* action_checkbox = g_action_map_lookup_action(G_ACTION_MAP(indicator->actions), "action.checkbox");
164+ actual_switch(G_SIMPLE_ACTION(action_checkbox));
165+
166+ GAction* action_accessPoint = g_action_map_lookup_action(G_ACTION_MAP(indicator->actions), "action.accessPoint");
167+ actual_switch(G_SIMPLE_ACTION(action_accessPoint));
168+
169+ GAction* action_slider = g_action_map_lookup_action(G_ACTION_MAP(indicator->actions), "action.slider");
170+ static double old_value = 0.25;
171+ double new_value = old_value == 0.25 ? 0.75 : 0.25;
172+ old_value = new_value;
173+ Action* slide_action = malloc(sizeof(Action));
174+ slide_action->action = G_SIMPLE_ACTION(action_slider);
175+ slide_action->value = g_variant_new_double(new_value);
176+ actual_slide(slide_action);
177+
178+ return TRUE;
143179}
144180
145181int
@@ -147,6 +183,7 @@ main (int argc, char **argv)
147183{
148184 IndicatorTestService indicator = { 0 };
149185 indicator.action_delay = -1;
186+ indicator.change_interval = -1;
150187 GMenuItem *item;
151188 GMenu *submenu;
152189 GActionEntry entries[] = {
@@ -191,6 +228,27 @@ main (int argc, char **argv)
191228 }
192229 break;
193230 }
231+
232+ case 'c':
233+ {
234+ arg += 2;
235+ if (!arg[0] && i < argc-1) {
236+ i++;
237+ int interval = -1;
238+
239+ if (sscanf(argv[i], "%d", &interval) == 1) {
240+ indicator.change_interval = interval;
241+ } else {
242+ printf("Invalid change interval value: %s\n", argv[i]);
243+ help = 1;
244+ }
245+ } else {
246+ printf("Invalid change interval value: %s\n", argv[i]);
247+ help = 1;
248+ }
249+ break;
250+ }
251+
194252 case 'h':
195253 help = 1;
196254 break;
@@ -201,8 +259,9 @@ main (int argc, char **argv)
201259
202260 if (help) {
203261 printf("Usage: %s [<options>]\n"
204− " -t DELAY Action activation delay\n"
205− " -h Show this help text\n"
262+ " -t DELAY Action activation delay\n"
263+ " -c CHANGE_INTERVAL Interval to change action values\n"
264+ " -h Show this help text\n"
206265 , argv[0]);
207266 return 0;
208267 }
@@ -249,6 +308,11 @@ main (int argc, char **argv)
249308 NULL);
250309
251310 loop = g_main_loop_new (NULL, FALSE);
311+
312+ if (indicator.change_interval != -1) {
313+ g_timeout_add(indicator.change_interval, change_interval, &indicator);
314+ }
315+
252316 g_main_loop_run (loop);
253317
254318 g_object_unref (submenu);
tests/plugins/Dash/cardcreator/5.res+1−1
@@ -163,5 +163,5 @@ UbuntuShape {
163163 radius: "medium";
164164 borderSource: "radius_pressed.sci"
165165}
166−implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);
166+implicitHeight: artShapeHolder.height;
167167}
tests/plugins/Dash/horizontaljournaltest.cpp+3−3
@@ -32,19 +32,19 @@
3232
3333class WidthModel : public QAbstractListModel {
3434public:
35− QHash<int, QByteArray> roleNames() const
35+ QHash<int, QByteArray> roleNames() const override
3636 {
3737 QHash<int, QByteArray> roles;
3838 roles.insert(Qt::DisplayRole, "modelWidth");
3939 return roles;
4040 }
4141
42− int rowCount(const QModelIndex & /*parent*/) const
42+ int rowCount(const QModelIndex & /*parent*/) const override
4343 {
4444 return m_list.count();
4545 }
4646
47− QVariant data(const QModelIndex &index, int /*role*/) const
47+ QVariant data(const QModelIndex &index, int /*role*/) const override
4848 {
4949 return m_list[index.row()];
5050 }
tests/plugins/Dash/horizontaljournaltry.cpp+1−1
@@ -29,7 +29,7 @@
2929class QWidthModela : public QStringListModel {
3030 Q_OBJECT
3131public:
32− QHash<int, QByteArray> roleNames() const
32+ QHash<int, QByteArray> roleNames() const override
3333 {
3434 QHash<int, QByteArray> roles;
3535 roles.insert(Qt::DisplayRole, "modelWidth");
tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp+3−3
@@ -37,7 +37,7 @@ public:
3737 list << "A" << "B" << "C" << "D" << "E" << "F" << "G" << "H";
3838 }
3939
40− int rowCount(const QModelIndex &parent) const
40+ int rowCount(const QModelIndex &parent) const override
4141 {
4242 if (parent.isValid())
4343 return 0;
@@ -45,14 +45,14 @@ public:
4545 return list.count();
4646 }
4747
48− QVariant data(const QModelIndex &index, int role) const
48+ QVariant data(const QModelIndex &index, int role) const override
4949 {
5050 if (role == Qt::SizeHintRole) return 50;
5151 else if (role == Qt::DisplayRole) return list[index.row()];
5252 return QVariant();
5353 }
5454
55− QHash<int, QByteArray> roleNames() const
55+ QHash<int, QByteArray> roleNames() const override
5656 {
5757 QHash<int, QByteArray> hash;
5858 hash.insert(Qt::DisplayRole, "type");
tests/plugins/Dash/organicgridtest.cpp+2−2
@@ -34,12 +34,12 @@ class DummyModel : public QAbstractListModel {
3434public:
3535 DummyModel() : m_count(0) {}
3636
37− int rowCount(const QModelIndex & /*parent*/) const
37+ int rowCount(const QModelIndex & /*parent*/) const override
3838 {
3939 return m_count;
4040 }
4141
42− QVariant data(const QModelIndex & /*index*/, int /*role*/) const
42+ QVariant data(const QModelIndex & /*index*/, int /*role*/) const override
4343 {
4444 return QVariant();
4545 }
tests/plugins/Dash/organicgridtry.cpp+2−2
@@ -31,12 +31,12 @@ class DummyModel : public QAbstractListModel {
3131public:
3232 DummyModel() : m_count(0) {}
3333
34− int rowCount(const QModelIndex & /*parent*/) const
34+ int rowCount(const QModelIndex & /*parent*/) const override
3535 {
3636 return m_count;
3737 }
3838
39− QVariant data(const QModelIndex & /*index*/, int /*role*/) const
39+ QVariant data(const QModelIndex & /*index*/, int /*role*/) const override
4040 {
4141 return QVariant();
4242 }
tests/plugins/Dash/verticaljournaltest.cpp+3−3
@@ -32,19 +32,19 @@
3232
3333class HeightModel : public QAbstractListModel {
3434public:
35− QHash<int, QByteArray> roleNames() const
35+ QHash<int, QByteArray> roleNames() const override
3636 {
3737 QHash<int, QByteArray> roles;
3838 roles.insert(Qt::DisplayRole, "modelHeight");
3939 return roles;
4040 }
4141
42− int rowCount(const QModelIndex & /*parent*/) const
42+ int rowCount(const QModelIndex & /*parent*/) const override
4343 {
4444 return m_list.count();
4545 }
4646
47− QVariant data(const QModelIndex &index, int /*role*/) const
47+ QVariant data(const QModelIndex &index, int /*role*/) const override
4848 {
4949 return m_list[index.row()];
5050 }
tests/plugins/Dash/verticaljournaltry.cpp+1−1
@@ -29,7 +29,7 @@
2929class QHeightModel : public QStringListModel {
3030 Q_OBJECT
3131public:
32− QHash<int, QByteArray> roleNames() const
32+ QHash<int, QByteArray> roleNames() const override
3333 {
3434 QHash<int, QByteArray> roles;
3535 roles.insert(Qt::DisplayRole, "modelHeight");
tests/plugins/LightDM/CMakeLists.txt+35−16
@@ -1,8 +1,38 @@
1+add_definitions(
2+ -DCURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
3+ )
4+include_directories(
5+ ${CMAKE_CURRENT_BINARY_DIR}
6+ )
7+
18add_executable(GreeterDBusTestExec
29 dbus.cpp
310 ${CMAKE_SOURCE_DIR}/plugins/LightDM/Greeter.cpp
411 )
512qt5_use_modules(GreeterDBusTestExec Core DBus Quick Test)
13+target_link_libraries(GreeterDBusTestExec
14+ -L${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm
15+ -llightdm-qt5-2
16+ )
17+target_include_directories(GreeterDBusTestExec PUBLIC
18+ ${CMAKE_SOURCE_DIR}/plugins/LightDM
19+ ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
20+ )
21+add_binary_qml_test(GreeterDBus "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks")
22+
23+add_executable(GreeterPamTestExec
24+ pam.cpp
25+ ${CMAKE_SOURCE_DIR}/plugins/LightDM/liblightdm/GreeterPrivate.cpp
26+ )
27+qt5_use_modules(GreeterPamTestExec Concurrent Core Test)
28+target_link_libraries(GreeterPamTestExec
29+ integratedLightDM
30+ )
31+target_include_directories(GreeterPamTestExec PUBLIC
32+ ${CMAKE_SOURCE_DIR}/plugins/LightDM/liblightdm
33+ )
34+add_qmltest_target(testGreeterPam "${CMAKE_CURRENT_BINARY_DIR}/GreeterPamTestExec" TRUE FALSE)
35+add_dependencies(testGreeterPam GreeterPamTestExec)
636
737add_executable(GreeterUsersModelTestExec
838 usersmodel.cpp
@@ -10,24 +40,13 @@ add_executable(GreeterUsersModelTestExec
1040 ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
1141 )
1242qt5_use_modules(GreeterUsersModelTestExec Core Test)
13−
14−include_directories(
15− ${CMAKE_CURRENT_BINARY_DIR}
43+target_link_libraries(GreeterUsersModelTestExec
44+ -L${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm
45+ -llightdm-qt5-2
46+ )
47+target_include_directories(GreeterUsersModelTestExec PUBLIC
1648 ${CMAKE_SOURCE_DIR}/plugins/LightDM
1749 ${CMAKE_SOURCE_DIR}/plugins/Utils
1850 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
1951 )
20−
21−target_link_libraries(GreeterDBusTestExec
22− MockLightDM
23− )
24−
25−target_link_libraries(GreeterUsersModelTestExec
26− MockLightDM
27− )
28−
29−add_definitions(-DCURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
30−
31−add_binary_qml_test(GreeterDBus "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks")
32−
3352add_binary_qml_test(GreeterUsersModel "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "LIBLIGHTDM_MOCK_MODE=full")
tests/plugins/LightDM/pam.cppnew file+52
@@ -0,0 +1,52 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "GreeterPrivate.h"
18+
19+#include <QtTest>
20+
21+class GreeterPamTest : public QObject
22+{
23+ Q_OBJECT
24+
25+private Q_SLOTS:
26+
27+ void init()
28+ {
29+ m_greeterpriv = new QLightDM::GreeterPrivate();
30+ }
31+
32+ void cleanup()
33+ {
34+ delete m_greeterpriv;
35+ QTRY_COMPARE(QThreadPool::globalInstance()->activeThreadCount(), 0);
36+ }
37+
38+ void testRapidFireAuthentication()
39+ {
40+ m_greeterpriv->authenticationUser = qgetenv("USER");
41+ for (int i = 0; i < 100; i++) {
42+ m_greeterpriv->handleAuthenticate();
43+ }
44+ }
45+
46+private:
47+ QLightDM::GreeterPrivate *m_greeterpriv;
48+};
49+
50+QTEST_GUILESS_MAIN(GreeterPamTest)
51+
52+#include "pam.moc"
tests/plugins/Ubuntu/Gestures/CMakeLists.txt+2−1
@@ -22,7 +22,7 @@ add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins")
2222add_definitions(-DTESTS_UTILS_MODULES_DIR="${CMAKE_BINARY_DIR}/tests/utils/modules")
2323
2424macro(add_gesture_ui_test CLASSNAME)
25− add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp)
25+ add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp TestItem.cpp)
2626 qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick)
2727 target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml UbuntuGestures)
2828
@@ -46,6 +46,7 @@ macro(add_gesture_test CLASSNAME)
4646endmacro(add_gesture_test)
4747
4848add_gesture_ui_test(DirectionalDragArea)
49+add_gesture_ui_test(FloatingFlickable)
4950add_gesture_ui_test(PressedOutsideNotifier)
5051add_gesture_ui_test(TouchDispatcher)
5152add_gesture_ui_test(TouchGate)
tests/plugins/Ubuntu/Gestures/GestureTest.cpp+2−1
@@ -53,7 +53,8 @@ void GestureTest::init()
5353
5454 m_fakeTimerFactory = new FakeTimerFactory;
5555
56− m_touchRegistry = new TouchRegistry(nullptr, m_fakeTimerFactory);
56+ m_touchRegistry = TouchRegistry::instance();
57+ m_touchRegistry->setTimerFactory(m_fakeTimerFactory);
5758 m_view->installEventFilter(m_touchRegistry);
5859
5960 qApp->processEvents();
tests/plugins/Ubuntu/Gestures/TestItem.cppnew file+30
@@ -0,0 +1,30 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "TestItem.h"
18+
19+#include <QTouchEvent>
20+
21+void TestItem::touchEvent(QTouchEvent *event)
22+{
23+ QTouchEvent *clonedEvent = new QTouchEvent(event->type(),
24+ event->device(),
25+ event->modifiers(),
26+ event->touchPointStates(),
27+ event->touchPoints());
28+
29+ touchEventsReceived.append(QSharedPointer<QTouchEvent>(clonedEvent));
30+}
tests/plugins/Ubuntu/Gestures/TestItem.hnew file+33
@@ -0,0 +1,33 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef UBUNTUGESTURES_TEST_ITEM_H
18+#define UBUNTUGESTURES_TEST_ITEM_H
19+
20+#include <QQuickItem>
21+
22+class TestItem : public QQuickItem
23+{
24+ Q_OBJECT
25+
26+public:
27+ QList<QSharedPointer<QTouchEvent>> touchEventsReceived;
28+
29+protected:
30+ void touchEvent(QTouchEvent *event) override;
31+};
32+
33+#endif // UBUNTUGESTURES_TEST_ITEM_H
tests/plugins/Ubuntu/Gestures/tst_AxisVelocityCalculator.cpp+1−1
@@ -24,7 +24,7 @@ class FakeTimeSource : public UbuntuGestures::TimeSource {
2424public:
2525 FakeTimeSource() : m_value(0) {}
2626
27− virtual qint64 msecsSinceReference() {
27+ qint64 msecsSinceReference() override {
2828 return m_value;
2929 }
3030
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp+21−21
@@ -84,7 +84,7 @@ class tst_DirectionalDragArea: public GestureTest
8484public:
8585 tst_DirectionalDragArea();
8686private Q_SLOTS:
87− void init(); // called right before each and every test function is executed
87+ void init() override; // called right before each and every test function is executed
8888
8989 void dragWithShortDirectionChange();
9090 void recognitionTimerUsage();
@@ -202,7 +202,7 @@ void tst_DirectionalDragArea::dragWithShortDirectionChange()
202202 DirectionalDragArea *edgeDragArea =
203203 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
204204 QVERIFY(edgeDragArea != 0);
205− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
205+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
206206 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
207207
208208 QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea);
@@ -297,7 +297,7 @@ void tst_DirectionalDragArea::sceneXAndX()
297297 DirectionalDragArea *edgeDragArea =
298298 m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
299299 QVERIFY(edgeDragArea != 0);
300− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
300+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
301301 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
302302 edgeDragArea->setImmediateRecognition(true);
303303
@@ -326,7 +326,7 @@ void tst_DirectionalDragArea::sceneYAndY()
326326 DirectionalDragArea *edgeDragArea =
327327 m_view->rootObject()->findChild<DirectionalDragArea*>("vnDragArea");
328328 QVERIFY(edgeDragArea != 0);
329− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
329+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
330330 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
331331 edgeDragArea->setImmediateRecognition(true);
332332
@@ -357,7 +357,7 @@ void tst_DirectionalDragArea::twoFingerTap()
357357 DirectionalDragArea *edgeDragArea =
358358 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
359359 QVERIFY(edgeDragArea != 0);
360− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
360+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
361361 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
362362
363363 // Make touches evenly spaced along the edgeDragArea
@@ -439,7 +439,7 @@ void tst_DirectionalDragArea::movingDDA()
439439 DirectionalDragArea *edgeDragArea =
440440 rightwardsLauncher->findChild<DirectionalDragArea*>("hpDragArea");
441441 Q_ASSERT(edgeDragArea != 0);
442− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
442+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
443443 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
444444
445445 QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea);
@@ -479,7 +479,7 @@ void tst_DirectionalDragArea::ignoreOldFinger()
479479 DirectionalDragArea *edgeDragArea =
480480 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
481481 Q_ASSERT(edgeDragArea != 0);
482− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
482+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
483483 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
484484
485485 // Make touches evenly spaced along the edgeDragArea
@@ -542,7 +542,7 @@ void tst_DirectionalDragArea::rotated()
542542 DirectionalDragArea *edgeDragArea =
543543 rightwardsLauncher->findChild<DirectionalDragArea*>("hpDragArea");
544544 Q_ASSERT(edgeDragArea != 0);
545− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
545+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
546546 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
547547
548548 QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea);
@@ -582,7 +582,7 @@ void tst_DirectionalDragArea::sceneDistance()
582582 DirectionalDragArea *edgeDragArea =
583583 rightwardsLauncher->findChild<DirectionalDragArea*>("hpDragArea");
584584 Q_ASSERT(edgeDragArea != 0);
585− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
585+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
586586 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
587587
588588 // to disable the position smoothing so that we can more easily check sceneDistance values
@@ -640,7 +640,7 @@ void tst_DirectionalDragArea::disabledWhileDragging()
640640 DirectionalDragArea *edgeDragArea =
641641 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
642642 Q_ASSERT(edgeDragArea != 0);
643− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
643+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
644644 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
645645
646646 QPointF touchPoint = calculateInitialTouchPos(edgeDragArea);
@@ -678,7 +678,7 @@ void tst_DirectionalDragArea::oneFingerDownFollowedByLateSecondFingerDown()
678678 DirectionalDragArea *edgeDragArea =
679679 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
680680 Q_ASSERT(edgeDragArea != 0);
681− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
681+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
682682 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
683683
684684 // Disable some constraints we're not interested in
@@ -753,7 +753,7 @@ void tst_DirectionalDragArea::givesUpWhenLosesTouch()
753753 DirectionalDragArea *edgeDragArea =
754754 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
755755 Q_ASSERT(edgeDragArea != 0);
756− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
756+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
757757 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
758758
759759 // Disable some constraints we're not interested in
@@ -798,7 +798,7 @@ void tst_DirectionalDragArea::threeFingerDrag()
798798 DirectionalDragArea *edgeDragArea =
799799 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
800800 Q_ASSERT(edgeDragArea != 0);
801− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
801+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
802802 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
803803
804804 // Disable some constraints we're not interested in
@@ -867,7 +867,7 @@ void tst_DirectionalDragArea::immediateRecognitionWhenConstraintsDisabled()
867867 DirectionalDragArea *edgeDragArea =
868868 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
869869 Q_ASSERT(edgeDragArea != 0);
870− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
870+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
871871 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
872872
873873 // Disable the minimum amount of constraints to ensure immediate recognition
@@ -900,7 +900,7 @@ void tst_DirectionalDragArea::withdrawTouchOwnershipCandidacyIfDisabledDuringRec
900900 DirectionalDragArea *edgeDragArea =
901901 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
902902 Q_ASSERT(edgeDragArea != 0);
903− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
903+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
904904 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
905905
906906 QPointF touchPoint = calculateInitialTouchPos(edgeDragArea);
@@ -964,7 +964,7 @@ void tst_DirectionalDragArea::gettingTouchOwnershipMakesMouseAreaBehindGetCancel
964964 DirectionalDragArea *edgeDragArea =
965965 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
966966 QVERIFY(edgeDragArea != nullptr);
967− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
967+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
968968 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
969969
970970 QQuickMouseArea *mouseArea =
@@ -1014,7 +1014,7 @@ void tst_DirectionalDragArea::interleavedTouches()
10141014 DirectionalDragArea *edgeDragArea =
10151015 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
10161016 QVERIFY(edgeDragArea != 0);
1017− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1017+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
10181018 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
10191019
10201020 QPointF touch0 = edgeDragArea->mapToScene(
@@ -1109,7 +1109,7 @@ void tst_DirectionalDragArea::makoRightEdgeDrag()
11091109 DirectionalDragArea *edgeDragArea =
11101110 m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
11111111 QVERIFY(edgeDragArea != nullptr);
1112− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1112+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
11131113 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
11141114
11151115 StatusSpy *statusSpy = new StatusSpy(edgeDragArea);
@@ -1154,7 +1154,7 @@ void tst_DirectionalDragArea::makoRightEdgeDrag_verticalDownwards()
11541154 DirectionalDragArea *edgeDragArea =
11551155 m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
11561156 QVERIFY(edgeDragArea != nullptr);
1157− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1157+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
11581158 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
11591159
11601160 edgeDragArea->d->setPixelsPerMm(320.0 /*mako ppi*/ * 0.03937 /* inches per mm*/);
@@ -1198,7 +1198,7 @@ void tst_DirectionalDragArea::makoLeftEdgeDrag_slowStart()
11981198 DirectionalDragArea *edgeDragArea =
11991199 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
12001200 QVERIFY(edgeDragArea != nullptr);
1201− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1201+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
12021202 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
12031203
12041204 edgeDragArea->d->setPixelsPerMm(320.0 /*mako ppi*/ * 0.03937 /* inches per mm*/);
@@ -1262,7 +1262,7 @@ void tst_DirectionalDragArea::makoLeftEdgeDrag_movesSlightlyBackwardsOnStart()
12621262 DirectionalDragArea *edgeDragArea =
12631263 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
12641264 QVERIFY(edgeDragArea != nullptr);
1265− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1265+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
12661266 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
12671267
12681268 edgeDragArea->d->setPixelsPerMm(320.0 /*mako ppi*/ * 0.03937 /* inches per mm*/);
tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.cppnew file+122
@@ -0,0 +1,122 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include <QtTest>
18+#include <QQuickView>
19+
20+// Ubuntu.Gestures plugin
21+#include <DirectionalDragArea.h>
22+#include <FloatingFlickable.h>
23+
24+#include "GestureTest.h"
25+#include "TestItem.h"
26+
27+using namespace UbuntuGestures;
28+
29+class tst_FloatingFlickable: public GestureTest
30+{
31+ Q_OBJECT
32+public:
33+ tst_FloatingFlickable();
34+private Q_SLOTS:
35+ void tapGoesThrough();
36+ void flickChangesContentX();
37+ void flickChangesContentY();
38+};
39+
40+tst_FloatingFlickable::tst_FloatingFlickable()
41+ : GestureTest(QStringLiteral("tst_FloatingFlickable.qml"))
42+{
43+}
44+
45+void tst_FloatingFlickable::tapGoesThrough()
46+{
47+ FloatingFlickable *floatingFlickable =
48+ m_view->rootObject()->findChild<FloatingFlickable*>("floatingFlickable");
49+ QVERIFY(floatingFlickable != nullptr);
50+
51+ TestItem *testItem = new TestItem;
52+ testItem->setWidth(floatingFlickable->width());
53+ testItem->setHeight(floatingFlickable->height());
54+ testItem->setParentItem(m_view->rootObject());
55+ testItem->setZ(1.0);
56+
57+ floatingFlickable->setZ(2.0);
58+
59+ QTest::touchEvent(m_view, m_device)
60+ .press(0, QPoint(floatingFlickable->width()/2, floatingFlickable->height()/2));
61+
62+ QCOMPARE(testItem->touchEventsReceived.count(), 1);
63+}
64+
65+void tst_FloatingFlickable::flickChangesContentX()
66+{
67+ FloatingFlickable *floatingFlickable =
68+ m_view->rootObject()->findChild<FloatingFlickable*>("floatingFlickable");
69+ QVERIFY(floatingFlickable != nullptr);
70+
71+ floatingFlickable->m_dragArea->removeTimeConstraints();
72+
73+ qreal startContentX = floatingFlickable->contentX();
74+
75+ QPoint startPos(floatingFlickable->width() - 5, 10);
76+ int stepCount = 20;
77+ int step = (startPos.x() - 5) / stepCount;
78+
79+ QTest::touchEvent(m_view, m_device).press(0, startPos);
80+ for (int i = 0; i < stepCount; ++i) {
81+ QTest::qWait(10);
82+ QPoint touchPos = startPos - QPoint(step*i, 0);
83+ QTest::touchEvent(m_view, m_device).move(0, touchPos);
84+ }
85+
86+ QTest::qWait(10);
87+ QTest::touchEvent(m_view, m_device).release(0, QPoint(5, 10));
88+
89+ QVERIFY(floatingFlickable->contentX() > (startContentX + floatingFlickable->width()/2));
90+}
91+
92+void tst_FloatingFlickable::flickChangesContentY()
93+{
94+ FloatingFlickable *floatingFlickable =
95+ m_view->rootObject()->findChild<FloatingFlickable*>("floatingFlickable");
96+ QVERIFY(floatingFlickable != nullptr);
97+
98+ floatingFlickable->setDirection(Direction::Vertical);
99+ floatingFlickable->m_dragArea->removeTimeConstraints();
100+
101+ qreal startContentY = floatingFlickable->contentY();
102+
103+ QPoint startPos(10, floatingFlickable->height() - 5);
104+ int stepCount = 20;
105+ int step = (startPos.y() - 5) / stepCount;
106+
107+ QTest::touchEvent(m_view, m_device).press(0, startPos);
108+ for (int i = 0; i < stepCount; ++i) {
109+ QTest::qWait(10);
110+ QPoint touchPos = startPos - QPoint(0, step*i);
111+ QTest::touchEvent(m_view, m_device).move(0, touchPos);
112+ }
113+
114+ QTest::qWait(10);
115+ QTest::touchEvent(m_view, m_device).release(0, QPoint(10, 5));
116+
117+ QVERIFY(floatingFlickable->contentY() > (startContentY + floatingFlickable->height()/2));
118+}
119+
120+QTEST_MAIN(tst_FloatingFlickable)
121+
122+#include "tst_FloatingFlickable.moc"
tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.qmlnew file+80
@@ -0,0 +1,80 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+import Ubuntu.Gestures 0.1
20+import Unity.Test 0.1
21+
22+Rectangle {
23+ id: root
24+ width: units.gu(60)
25+ height: units.gu(60)
26+ color: "white"
27+
28+ Binding {
29+ target: MouseTouchAdaptor
30+ property: "enabled"
31+ value: true
32+ }
33+
34+ Grid {
35+ id: colorGrid
36+ readonly property bool horizontal: floatingFlickable.direction === Direction.Horizontal
37+ x: horizontal ? -floatingFlickable.contentX : 0
38+ y: horizontal ? 0 : -floatingFlickable.contentY
39+ rows: horizontal ? 1 : 100
40+ columns: horizontal ? 100 : 1
41+ Repeater {
42+ model: 100
43+ Rectangle {
44+ width: colorGrid.horizontal ? units.gu(12) : root.width
45+ height: colorGrid.horizontal ? root.height : units.gu(12)
46+ color: mouseArea.pressed ? "red"
47+ : Qt.rgba(Math.random(), Math.random(), Math.random(), 1)
48+ MouseArea {
49+ id: mouseArea
50+ anchors.fill: parent
51+ }
52+ }
53+ }
54+ }
55+
56+ FloatingFlickable {
57+ id: floatingFlickable
58+ objectName: "floatingFlickable"
59+ anchors.fill: parent
60+ contentWidth: colorGrid.width
61+ contentHeight: colorGrid.height
62+ }
63+
64+ Button {
65+ anchors.bottom: parent.bottom
66+ anchors.right: parent.right
67+ anchors.margins: units.gu(1)
68+
69+ text: floatingFlickable.direction === Direction.Horizontal ? "Horizontal" : "Vertical"
70+ activeFocusOnPress: false
71+
72+ onClicked: {
73+ if (floatingFlickable.direction === Direction.Horizontal) {
74+ floatingFlickable.direction = Direction.Vertical;
75+ } else {
76+ floatingFlickable.direction = Direction.Horizontal;
77+ }
78+ }
79+ }
80+}
tests/plugins/Ubuntu/Gestures/tst_PressedOutsideNotifier.cpp+1−1
@@ -28,7 +28,7 @@ class tst_PressedOutsideNotifier: public GestureTest
2828public:
2929 tst_PressedOutsideNotifier();
3030private Q_SLOTS:
31− void init(); // called right before each and every test function is executed
31+ void init() override; // called right before each and every test function is executed
3232
3333 void touchOutsideAreaTriggersSignal();
3434 void touchInsideAreaHasNoEffect();
tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+2−25
@@ -29,16 +29,7 @@
2929#include <TouchGate.h>
3030#include <TouchRegistry.h>
3131
32−class TestItem : public QQuickItem
33−{
34− Q_OBJECT
35−
36−public:
37− QList<QSharedPointer<QTouchEvent>> touchEventsReceived;
38−
39−protected:
40− void touchEvent(QTouchEvent *event) override;
41−};
32+#include "TestItem.h"
4233
4334class CandidateItem : public QQuickItem
4435{
@@ -104,10 +95,9 @@ void tst_TouchGate::cleanupTestCase()
10495
10596void tst_TouchGate::init()
10697{
107− touchRegistry = new TouchRegistry;
98+ touchRegistry = TouchRegistry::instance();
10899
109100 view = createView();
110− view->installEventFilter(touchRegistry);
111101 view->setSource(QUrl::fromLocalFile("touchGateExample.qml"));
112102 view->show();
113103 QVERIFY(QTest::qWaitForWindowExposed(view));
@@ -381,19 +371,6 @@ void tst_TouchGate::disabledWhileHoldingTouch()
381371 }
382372}
383373
384−///////////// TestItem /////////////////////////////////////////////////////////////
385−
386−void TestItem::touchEvent(QTouchEvent *event)
387−{
388− QTouchEvent *clonedEvent = new QTouchEvent(event->type(),
389− event->device(),
390− event->modifiers(),
391− event->touchPointStates(),
392− event->touchPoints());
393−
394− touchEventsReceived.append(QSharedPointer<QTouchEvent>(clonedEvent));
395−}
396−
397374///////////// CandidateItem /////////////////////////////////////////////////////////////
398375
399376void CandidateItem::touchEvent(QTouchEvent *event)
tests/plugins/Unity/Indicators/menucontentactivatortest.cpp+2−2
@@ -30,8 +30,8 @@ public:
3030 : UnityIndicators::AbstractTimer(parent)
3131 {}
3232
33− virtual int interval() const { return m_duration; }
34− virtual void setInterval(int msecs) { m_duration = msecs; }
33+ int interval() const override { return m_duration; }
34+ void setInterval(int msecs) override { m_duration = msecs; }
3535
3636 void emitTimeout() {
3737 if (isRunning()) {
tests/plugins/Unity/Launcher/CMakeLists.txt−1
@@ -2,7 +2,6 @@ pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
22pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
33
44include_directories(
5− ${APPLICATION_API_INCLUDE_DIRS}
65 ${CMAKE_CURRENT_SOURCE_DIR}
76 ${CMAKE_CURRENT_BINARY_DIR}
87 ${CMAKE_SOURCE_DIR}/plugins/Unity/Launcher
tests/plugins/Unity/Launcher/launchermodeltest.cpp+21−21
@@ -39,13 +39,13 @@ class MockApp: public unity::shell::application::ApplicationInfoInterface
3939 Q_OBJECT
4040public:
4141 MockApp(const QString &appId, QObject *parent = 0): ApplicationInfoInterface(appId, parent), m_appId(appId), m_focused(false) { }
42− QString appId() const { return m_appId; }
43− QString name() const { return "mock"; }
44− QString comment() const { return "this is a mock"; }
45− QUrl icon() const { return QUrl(); }
46− ApplicationInfoInterface::Stage stage() const { return ApplicationInfoInterface::MainStage; }
47− ApplicationInfoInterface::State state() const { return ApplicationInfoInterface::Running; }
48− bool focused() const { return m_focused; }
42+ QString appId() const override { return m_appId; }
43+ QString name() const override { return "mock"; }
44+ QString comment() const override { return "this is a mock"; }
45+ QUrl icon() const override { return QUrl(); }
46+ ApplicationInfoInterface::Stage stage() const override { return ApplicationInfoInterface::MainStage; }
47+ ApplicationInfoInterface::State state() const override { return ApplicationInfoInterface::Running; }
48+ bool focused() const override { return m_focused; }
4949 QString splashTitle() const override { return QString(); }
5050 QUrl splashImage() const override { return QUrl(); }
5151 bool splashShowHeader() const override { return true; }
@@ -68,16 +68,16 @@ class MockAppManager: public unity::shell::application::ApplicationManagerInterf
6868 Q_OBJECT
6969public:
7070 MockAppManager(QObject *parent = 0): ApplicationManagerInterface(parent) {}
71− int rowCount(const QModelIndex &) const { return m_list.count(); }
72− QVariant data(const QModelIndex &, int ) const { return QVariant(); }
73− QString focusedApplicationId() const {
71+ int rowCount(const QModelIndex &) const override { return m_list.count(); }
72+ QVariant data(const QModelIndex &, int ) const override { return QVariant(); }
73+ QString focusedApplicationId() const override {
7474 Q_FOREACH(MockApp *app, m_list) {
7575 if (app->focused()) return app->appId();
7676 }
7777 return QString();
7878 }
79− unity::shell::application::ApplicationInfoInterface *get(int index) const { return m_list.at(index); }
80− unity::shell::application::ApplicationInfoInterface *findApplication(const QString &appId) const {
79+ unity::shell::application::ApplicationInfoInterface *get(int index) const override { return m_list.at(index); }
80+ unity::shell::application::ApplicationInfoInterface *findApplication(const QString &appId) const override {
8181 Q_FOREACH(MockApp* app, m_list) {
8282 if (app->appId() == appId) {
8383 return app;
@@ -85,8 +85,8 @@ public:
8585 }
8686 return nullptr;
8787 }
88− unity::shell::application::ApplicationInfoInterface *startApplication(const QString &, const QStringList &) { return nullptr; }
89− bool stopApplication(const QString &appId) {
88+ unity::shell::application::ApplicationInfoInterface *startApplication(const QString &, const QStringList &) override { return nullptr; }
89+ bool stopApplication(const QString &appId) override {
9090 Q_FOREACH(MockApp* app, m_list) {
9191 if (app->appId() == appId) {
9292 removeApplication(m_list.indexOf(app));
@@ -95,7 +95,7 @@ public:
9595 }
9696 return false;
9797 }
98− bool focusApplication(const QString &appId) {
98+ bool focusApplication(const QString &appId) override {
9999 Q_FOREACH(MockApp* app, m_list) {
100100 app->setFocused(app->appId() == appId);
101101 }
@@ -103,7 +103,7 @@ public:
103103 return true;
104104 }
105105
106− void unfocusCurrentApplication() { }
106+ void unfocusCurrentApplication() override { }
107107
108108 void addApplication(MockApp *app) {
109109 beginInsertRows(QModelIndex(), count(), count());
@@ -115,11 +115,11 @@ public:
115115 m_list.takeAt(index)->deleteLater();
116116 endRemoveRows();
117117 }
118− bool requestFocusApplication(const QString &appId) { Q_UNUSED(appId); return true; }
119− bool suspended() const { return false; }
120− void setSuspended(bool) {}
121− bool forceDashActive() const { return false; }
122− void setForceDashActive(bool) {}
118+ bool requestFocusApplication(const QString &appId) override { Q_UNUSED(appId); return true; }
119+ bool suspended() const override { return false; }
120+ void setSuspended(bool) override {}
121+ bool forceDashActive() const override { return false; }
122+ void setForceDashActive(bool) override {}
123123
124124private:
125125 QList<MockApp*> m_list;
tests/plugins/Utils/qlimitproxymodeltest.cpp+5−5
@@ -36,12 +36,12 @@ public:
3636 {
3737 }
3838
39− int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const
39+ int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const override
4040 {
4141 return m_list.size();
4242 }
4343
44− QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const
44+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override
4545 {
4646 if (!index.isValid() || index.row() < 0 || index.row() >= m_list.size() || role != Qt::DisplayRole) {
4747 return QVariant();
@@ -49,7 +49,7 @@ public:
4949 return QVariant(m_list[index.row()]);
5050 }
5151
52− QHash<int, QByteArray> roleNames() const
52+ QHash<int, QByteArray> roleNames() const override
5353 {
5454 return m_roles;
5555 }
@@ -65,7 +65,7 @@ public:
6565 endRemoveRows();
6666 }
6767
68− bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) {
68+ bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override {
6969 beginInsertRows(parent, row, row+count-1);
7070 for (int i=0; i<count; i++) {
7171 m_list.insert(i+row, QString::number(i));
@@ -81,7 +81,7 @@ public:
8181 return true;
8282 }
8383
84− bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) {
84+ bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override {
8585 beginRemoveRows(parent, row, row+count-1);
8686 for (int i=0; i<count; i++) {
8787 m_list.removeAt(row);
tests/plugins/Utils/unitysortfilterproxymodeltest.cpp+5−5
@@ -39,12 +39,12 @@ public:
3939 {
4040 }
4141
42− int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const
42+ int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const override
4343 {
4444 return m_list.size();
4545 }
4646
47− QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const
47+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override
4848 {
4949 if (!index.isValid() || index.row() < 0 || index.row() >= m_list.size() || role != Qt::DisplayRole) {
5050 return QVariant();
@@ -52,7 +52,7 @@ public:
5252 return QVariant(m_list[index.row()]);
5353 }
5454
55− QHash<int, QByteArray> roleNames() const
55+ QHash<int, QByteArray> roleNames() const override
5656 {
5757 return m_roles;
5858 }
@@ -61,7 +61,7 @@ public:
6161 m_roles = roles;
6262 }
6363
64− bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) {
64+ bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override {
6565 beginInsertRows(parent, row, row+count-1);
6666 for (int i=0; i<count; i++) {
6767 m_list.insert(i+row, QString("test%1").arg(i));
@@ -77,7 +77,7 @@ public:
7777 return true;
7878 }
7979
80− bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) {
80+ bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override {
8181 beginRemoveRows(parent, row, row+count-1);
8282 for (int i=0; i<count; i++) {
8383 m_list.removeAt(row);
tests/qmltests/CMakeLists.txt+1
@@ -50,6 +50,7 @@ add_qml_test(Dash/Previews PreviewImageGallery)
5050add_qml_test(Dash/Previews PreviewPayments)
5151add_qml_test(Dash/Previews PreviewProgress)
5252add_qml_test(Dash/Previews PreviewRatingDisplay)
53+add_qml_test(Dash/Previews PreviewRatingEdit)
5354add_qml_test(Dash/Previews PreviewRatingInput)
5455add_qml_test(Dash/Previews PreviewTable)
5556add_qml_test(Dash/Previews PreviewTextSummary)
tests/qmltests/Components/tst_DragHandle.cpp−8
@@ -26,7 +26,6 @@
2626#include <DirectionalDragArea.h>
2727#include <DirectionalDragArea_p.h>
2828#include <Timer.h>
29−#include <TouchRegistry.h>
3029
3130using namespace UbuntuGestures;
3231
@@ -61,7 +60,6 @@ private:
6160
6261 QQuickView *createView();
6362 QQuickView *m_view;
64− TouchRegistry *m_touchRegistry;
6563 QTouchDevice *m_device;
6664 FakeTimer *m_fakeTimer;
6765 QSharedPointer<FakeTimeSource> m_fakeTimeSource;
@@ -85,10 +83,7 @@ void tst_DragHandle::cleanupTestCase()
8583
8684void tst_DragHandle::init()
8785{
88− m_touchRegistry = new TouchRegistry;
89−
9086 m_view = createView();
91− m_view->installEventFilter(m_touchRegistry);
9287 m_view->setSource(QUrl::fromLocalFile(TEST_DIR"/tst_DragHandle.qml"));
9388 m_view->show();
9489 QVERIFY(QTest::qWaitForWindowExposed(m_view));
@@ -108,9 +103,6 @@ void tst_DragHandle::cleanup()
108103 delete m_view;
109104 m_view = 0;
110105
111− delete m_touchRegistry;
112− m_touchRegistry = 0;
113−
114106 delete m_fakeTimer;
115107 m_fakeTimer = 0;
116108
tests/qmltests/Dash/Previews/tst_PreviewRatingEdit.qmlnew file+80
@@ -0,0 +1,80 @@
1+/*
2+ * Copyright 2014 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import QtTest 1.0
19+import Ubuntu.Components 0.1
20+import "../../../../qml/Dash/Previews"
21+import Unity.Test 0.1 as UT
22+
23+Rectangle {
24+ id: root
25+ width: units.gu(40)
26+ height: units.gu(80)
27+ color: Theme.palette.selected.background
28+
29+ property var widgetData0: { "visible": "both", "required": "both", author: "Some dude", rating: 4.5, review: "Very cool app" }
30+
31+ PreviewRatingEdit {
32+ id: previewRatingEdit
33+ anchors.left: parent.left
34+ anchors.right: parent.right
35+ widgetData: widgetData0
36+ widgetId: "previewRatingInput"
37+ }
38+
39+ SignalSpy {
40+ id: spy
41+ signalName: "triggered"
42+ }
43+
44+ UT.UnityTestCase {
45+ name: "PreviewRatingEditTest"
46+ when: windowShown
47+
48+ function test_switch_and_trigger(data) {
49+ spy.target = previewRatingEdit;
50+
51+ var authorLabel = findChild(previewRatingEdit, "authorLabel");
52+ var reviewTextArea = findChild(previewRatingEdit, "reviewTextArea");
53+ var inputRating = findChild(findChild(previewRatingEdit, "input"), "rating");
54+ verify(authorLabel.visible)
55+ verify(!reviewTextArea.visible)
56+
57+ var editButton = findChild(previewRatingEdit, "editButton");
58+ mouseClick(editButton);
59+ verify(!authorLabel.visible)
60+ verify(reviewTextArea.visible)
61+
62+ compare(reviewTextArea.text, "Very cool app");
63+ compare(inputRating.value, 4.5);
64+
65+ reviewTextArea.text = "Ho Ho";
66+ inputRating.value = 3;
67+
68+ var submitButton = findChild(previewRatingEdit, "submitButton")
69+ mouseClick(submitButton);
70+
71+ compare(spy.count, 1);
72+ var args = spy.signalArguments[0];
73+ compare(args[0], previewRatingEdit.widgetId);
74+ compare(args[1], "rated");
75+ compare(args[2]["rating"], 3);
76+ compare(args[2]["review"], "Ho Ho");
77+ verify(args[2]["author"] !== undefined); // Just verifying it exists now
78+ }
79+ }
80+}
tests/qmltests/Dash/tst_DashContent.qml+7−2
@@ -142,7 +142,7 @@ Item {
142142
143143 var startX = dashContentList.width/2;
144144 var startY = dashContentList.height/2;
145− touchFlick(dashContentList, startX - units.gu(2), startY, startX, startY);
145+ touchFlick(dashContentList, startX - units.gu(4), startY, startX, startY);
146146 tryCompare(categoryListView, "contentY", units.gu(15) - categoryListView.pageHeader.height);
147147 }
148148
@@ -153,7 +153,7 @@ Item {
153153
154154 tryCompare(scope, "status", Loader.Ready);
155155
156− var categoryListView = findChild(dashContentList, "categoryListView");
156+ var categoryListView = findChild(scope, "categoryListView");
157157 categoryListView.contentY = units.gu(10);
158158
159159 compare(dashContentList.currentItem.item.objectName, "MockScope1")
@@ -353,6 +353,8 @@ Item {
353353 compare(backButton.visible, true);
354354
355355 tryCompare(navigationList1.navigation, "loaded", true);
356+ tryCompare(navigationList1, "implicitHeight", navigationList1.itemHeight * 10);
357+ tryCompare(navigationList1, "height", navigationList1.implicitHeight);
356358 navigation = findChild(dashNavigationButton, "navigation1child2");
357359 mouseClick(navigation);
358360 compare(dashNavigationButton.showList, false);
@@ -386,6 +388,9 @@ Item {
386388 mouseClick(dashNavigationButton);
387389 compare(dashNavigationButton.showList, true);
388390 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
391+ var navigationList0 = findChild(dashNavigationButton, "navigation0");
392+ tryCompare(navigationList0, "implicitHeight", navigationList0.itemHeight * 8);
393+ tryCompare(navigationList0, "height", navigationList0.implicitHeight);
389394 navigation = findChild(dashNavigationButton, "navigation0child2");
390395 mouseClick(navigation);
391396 compare(dashNavigationButton.showList, true);
tests/qmltests/Stages/ApplicationCheckBox.qml+49−20
@@ -22,27 +22,67 @@ import Unity.Application 0.1
2222RowLayout {
2323 id: root
2424 property string appId
25− property alias checked: checkbox.checked
25+ property bool checked: false
2626
2727 enabled: appId !== "unity8-dash"
2828
29+ onCheckedChanged: {
30+ if (d.bindGuard) { return; }
31+ d.bindGuard = true;
32+
33+ if (checked) {
34+ ApplicationManager.startApplication(root.appId);
35+ } else {
36+ ApplicationManager.stopApplication(root.appId);
37+ }
38+ d.bindGuard = false;
39+ }
40+
41+ QtObject {
42+ id: d
43+ property bool bindGuard: false
44+ property var application: null
45+ Component.onCompleted: {
46+ application = ApplicationManager.findApplication(root.appId);
47+ }
48+ }
49+
50+ Connections {
51+ target: ApplicationManager
52+ onCountChanged: {
53+ d.application = ApplicationManager.findApplication(root.appId);
54+ }
55+ }
56+
2957 Layout.fillWidth: true
3058 CheckBox {
3159 id: checkbox
3260 checked: false
3361 activeFocusOnPress: false
34− property bool noop: false
35− onCheckedChanged: {
36− if (noop) {
37− return;
38− }
62+
63+ onTriggered: {
64+ if (d.bindGuard) { return; }
65+ d.bindGuard = true;
66+
3967 if (checked) {
40− var application = ApplicationManager.startApplication(root.appId);
41− appConnections.target = application;
68+ ApplicationManager.startApplication(root.appId);
4269 } else {
43− appConnections.target = null;
4470 ApplicationManager.stopApplication(root.appId);
4571 }
72+ d.bindGuard = false;
73+ }
74+ onCheckedChanged: {
75+ if (d.bindGuard) { return; }
76+ d.bindGuard = true;
77+
78+ root.checked = checked;
79+
80+ d.bindGuard = false;
81+ }
82+ Binding {
83+ target: checkbox
84+ property: "checked"
85+ value: d.application != null
4686 }
4787 }
4888 Label {
@@ -50,15 +90,4 @@ RowLayout {
5090 color: "white"
5191 anchors.verticalCenter: parent.verticalCenter
5292 }
53−
54− Connections {
55− id: appConnections
56− onStateChanged: {
57− if (target.state == ApplicationInfoInterface.Stopped) {
58− checkbox.noop = true;
59− checkbox.checked = false;
60− checkbox.noop = false;
61− }
62− }
63− }
6493}
tests/qmltests/Stages/tst_DesktopStage.qml+77−67
@@ -20,6 +20,7 @@ import Ubuntu.Components 1.1
2020import Ubuntu.Components.ListItems 1.0 as ListItem
2121import Unity.Application 0.1
2222import Unity.Test 0.1
23+import Utils 0.1
2324
2425import "../../../qml/Stages"
2526
@@ -29,31 +30,18 @@ Rectangle {
2930 width: desktopStageLoader.width + controls.width
3031 height: desktopStageLoader.height
3132
32− QtObject {
33− id: fakeWindowStateStorage
34−
35− property var storedGeom: [
36− ["unity8-dash", Qt.rect(units.gu(2), units.gu(2), units.gu(50), units.gu(50))],
37− ["webbrowser-app", Qt.rect(units.gu(60), units.gu(2), units.gu(50), units.gu(50))]
38− ]
33+ Binding {
34+ target: MouseTouchAdaptor
35+ property: "enabled"
36+ value: false
37+ }
3938
40− function saveGeometry(windowId, geometry) {
41− for (var i = 0; i < storedGeom.length; ++i) {
42− if (storedGeom[i][0] === windowId) {
43− storedGeom[i][1] = geometry;
44− return;
45− }
46− }
47− // if new
48− storedGeom[storedGeom.length] = [windowId, geometry];
49− }
50− function getGeometry(windowId, defaultGeometry) {
51− for (var i = 0; i < storedGeom.length; ++i) {
52− if (storedGeom[i][0] === windowId) {
53− return storedGeom[i][1];
54− }
55− }
56− return defaultGeometry;
39+ Component.onCompleted: {
40+ // ensures apps which are tested decorations are in view.
41+ WindowStateStorage.geometry = {
42+ 'unity8-dash': Qt.rect(0, units.gu(3), units.gu(50), units.gu(40)),
43+ 'dialer-app': Qt.rect(units.gu(51), units.gu(3), units.gu(50), units.gu(40)),
44+ 'camera-app': Qt.rect(0, units.gu(44), units.gu(50), units.gu(40)),
5745 }
5846 }
5947
@@ -70,7 +58,6 @@ Rectangle {
7058 sourceComponent: Component {
7159 DesktopStage {
7260 anchors.fill: parent
73− windowStateStorage: fakeWindowStateStorage
7461 Component.onDestruction: {
7562 desktopStageLoader.itemDestroyed = true;
7663 }
@@ -108,9 +95,6 @@ Rectangle {
10895
10996 property Item desktopStage: desktopStageLoader.status === Loader.Ready ? desktopStageLoader.item : null
11097
111− function init() {
112− }
113−
11498 function cleanup() {
11599 desktopStageLoader.itemDestroyed = false;
116100 desktopStageLoader.active = false;
@@ -145,57 +129,83 @@ Rectangle {
145129 tryCompare(appWindowStates, "state", "surface");
146130 }
147131
148− function rectsIntersect(aLocal, bLocal) {
149−
150− var a = aLocal.mapToItem(null, 0, 0, aLocal.width, aLocal.height);
151− var b = bLocal.mapToItem(null, 0, 0, bLocal.width, bLocal.height);
152−
153− return !((a.y+a.height) < b.y
154− || a.y > (b.y+b.height)
155− || (a.x+a.width) < b.x
156− || a.x > (b.x+b.width));
132+ function startApplication(appId) {
133+ var app = ApplicationManager.findApplication(appId);
134+ if (!app) {
135+ app = ApplicationManager.startApplication(appId);
136+ }
137+ verify(app);
138+ waitUntilAppSurfaceShowsUp(appId);
139+ verify(app.session.surface);
140+ return app;
157141 }
158142
159− function test_tappingOnWindowChangesFocusedApp() {
160− ApplicationManager.startApplication("webbrowser-app");
161− waitUntilAppSurfaceShowsUp("webbrowser-app");
143+ function test_appFocusSwitch_data() {
144+ return [
145+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 0, focusTo: 1 },
146+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 1, focusTo: 0 },
147+ ]
148+ }
162149
163− var webbrowserWindow = findChild(desktopStage, "appWindow_webbrowser-app");
164− verify(webbrowserWindow);
165− var dashWindow = findChild(desktopStage, "appWindow_unity8-dash");
166− verify(dashWindow);
150+ function test_appFocusSwitch(data) {
151+ var i;
152+ for (i = 0; i < data.apps.length; i++) {
153+ startApplication(data.apps[i]);
154+ }
167155
168− // some sanity check
169− compare(rectsIntersect(dashWindow, webbrowserWindow), false);
156+ ApplicationManager.requestFocusApplication(data.apps[data.focusfrom]);
157+ tryCompare(ApplicationManager.findApplication(data.apps[data.focusfrom]).session.surface, "activeFocus", true);
170158
171− tap(dashWindow);
172− compare(dashWindow.application.session.surface.activeFocus, true);
159+ ApplicationManager.requestFocusApplication(data.apps[data.focusTo]);
160+ tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
161+ }
173162
174− tap(webbrowserWindow);
175− compare(webbrowserWindow.application.session.surface.activeFocus, true);
163+ function test_tappingOnWindowChangesFocusedApp_data() {
164+ return [
165+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 0, focusTo: 1 },
166+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 1, focusTo: 0 },
167+ ]
176168 }
177169
178− function test_tappingOnWindowTitleChangesFocusedApp() {
179− ApplicationManager.startApplication("webbrowser-app");
180− waitUntilAppSurfaceShowsUp("webbrowser-app");
170+ function test_tappingOnWindowChangesFocusedApp(data) {
171+ var i;
172+ for (i = 0; i < data.apps.length; i++) {
173+ startApplication(data.apps[i]);
174+ }
175+
176+ var fromAppWindow = findChild(desktopStage, "appWindow_" + data.apps[data.focusfrom]);
177+ verify(fromAppWindow);
178+ tap(fromAppWindow);
179+ compare(fromAppWindow.application.session.surface.activeFocus, true);
181180
182− var webbrowserWindow = findChild(desktopStage, "decoratedWindow_webbrowser-app");
183− verify(webbrowserWindow);
184− var webbrowserWindowTitle = findChild(webbrowserWindow, "windowDecorationTitle");
185− verify(webbrowserWindowTitle);
186− var dashWindow = findChild(desktopStage, "decoratedWindow_unity8-dash");
187− verify(dashWindow);
188− var dashWindowTitle = findChild(dashWindow, "windowDecorationTitle");
189− verify(dashWindowTitle);
181+ var toAppWindow = findChild(desktopStage, "appWindow_" + data.apps[data.focusTo]);
182+ verify(toAppWindow);
183+ tap(toAppWindow);
184+ compare(toAppWindow.application.session.surface.activeFocus, true);
185+ }
190186
191− // some sanity check
192− compare(rectsIntersect(dashWindow, webbrowserWindow), false);
187+ function test_tappingOnDecorationFocusesApplication_data() {
188+ return [
189+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 0, focusTo: 1 },
190+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 1, focusTo: 0 },
191+ ]
192+ }
193+
194+ function test_tappingOnDecorationFocusesApplication(data) {
195+ var i;
196+ for (i = 0; i < data.apps.length; i++) {
197+ startApplication(data.apps[i]);
198+ }
193199
194− tap(dashWindowTitle);
195− compare(dashWindow.application.session.surface.activeFocus, true);
200+ var fromAppDecoration = findChild(desktopStage, "appWindowDecoration_" + data.apps[data.focusfrom]);
201+ verify(fromAppDecoration);
202+ tap(fromAppDecoration);
203+ tryCompare(ApplicationManager.findApplication(data.apps[data.focusfrom]).session.surface, "activeFocus", true);
196204
197− tap(webbrowserWindowTitle);
198− compare(webbrowserWindow.application.session.surface.activeFocus, true);
205+ var toAppDecoration = findChild(desktopStage, "appWindowDecoration_" + data.apps[data.focusTo]);
206+ verify(toAppDecoration);
207+ tap(toAppDecoration);
208+ tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
199209 }
200210 }
201211}
tests/qmltests/Stages/tst_TabletStage.qml+1−1
@@ -162,7 +162,7 @@ Rectangle {
162162
163163 performEdgeSwipeToShowAppSpread();
164164
165− var appDelegate = findChild(tabletStage, "spreadDelegate_" + dialerCheckBox.appId);
165+ var appDelegate = findChild(tabletStage, "tabletSpreadDelegate_" + dialerCheckBox.appId);
166166 verify(appDelegate);
167167 tryCompare(appDelegate, "swipeToCloseEnabled", true);
168168
tests/qmltests/tst_Shell.qml+136−39
@@ -31,6 +31,7 @@ import Powerd 0.1
3131import Wizard 0.1 as Wizard
3232
3333import "../../qml"
34+import "Stages"
3435
3536Rectangle {
3637 id: root
@@ -92,19 +93,25 @@ Rectangle {
9293 }
9394 }
9495
95− Rectangle {
96+ Flickable {
9697 id: controls
97− color: "darkgrey"
98− width: units.gu(30)
98+ contentHeight: controlRect.height
99+
99100 anchors.top: root.top
100101 anchors.bottom: root.bottom
101102 anchors.right: root.right
103+ width: units.gu(30)
104+
105+ Rectangle {
106+ id: controlRect
107+ anchors { left: parent.left; right: parent.right }
108+ color: "darkgrey"
109+ height: childrenRect.height + units.gu(2)
110+
111+ Column {
112+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
113+ spacing: units.gu(1)
102114
103− Column {
104− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
105− spacing: units.gu(1)
106− Row {
107− anchors { left: parent.left; right: parent.right }
108115 Button {
109116 text: "Show Greeter"
110117 activeFocusOnPress: false
@@ -118,30 +125,54 @@ Rectangle {
118125 }
119126 }
120127 }
121− }
122− ListItem.ItemSelector {
123− anchors { left: parent.left; right: parent.right }
124− activeFocusOnPress: false
125− text: "LightDM mock mode"
126− model: ["single", "single-passphrase", "single-pin", "full"]
127− onSelectedIndexChanged: {
128− shellLoader.active = false;
129− LightDM.Greeter.mockMode = model[selectedIndex];
130− LightDM.Users.mockMode = model[selectedIndex];
131− shellLoader.active = true;
128+ ListItem.ItemSelector {
129+ anchors { left: parent.left; right: parent.right }
130+ activeFocusOnPress: false
131+ text: "LightDM mock mode"
132+ model: ["single", "single-passphrase", "single-pin", "full"]
133+ onSelectedIndexChanged: {
134+ shellLoader.active = false;
135+ LightDM.Greeter.mockMode = model[selectedIndex];
136+ LightDM.Users.mockMode = model[selectedIndex];
137+ shellLoader.active = true;
138+ }
132139 }
133− }
134− ListItem.ItemSelector {
135− anchors { left: parent.left; right: parent.right }
136− activeFocusOnPress: false
137− text: "Size"
138− model: ["phone", "tablet"]
139− onSelectedIndexChanged: {
140− shellLoader.active = false;
141− shellLoader.state = model[selectedIndex];
142− shellLoader.active = true;
140+ ListItem.ItemSelector {
141+ anchors { left: parent.left; right: parent.right }
142+ activeFocusOnPress: false
143+ text: "Size"
144+ model: ["phone", "tablet"]
145+ onSelectedIndexChanged: {
146+ shellLoader.active = false;
147+ shellLoader.state = model[selectedIndex];
148+ shellLoader.active = true;
149+ }
150+ }
151+ ListItem.ItemSelector {
152+ id: usageModeSelector
153+ anchors { left: parent.left; right: parent.right }
154+ activeFocusOnPress: false
155+ text: "Usage mode"
156+ model: ["Staged", "Windowed"]
157+ onSelectedIndexChanged: {
158+ GSettingsController.setUsageMode(model[selectedIndex]);
159+ }
160+ }
161+ MouseTouchEmulationCheckbox {
162+ id: mouseEmulation
163+ checked: true
164+ color: "white"
165+ }
166+
167+ Label { text: "Applications"; font.bold: true }
168+
169+ Repeater {
170+ id: appRepeater
171+ model: ApplicationManager.availableApplications
172+ ApplicationCheckBox {
173+ appId: modelData
174+ }
143175 }
144− MouseTouchEmulationCheckbox { color: "white" }
145176 }
146177 }
147178 }
@@ -222,6 +253,7 @@ Rectangle {
222253 function cleanup() {
223254 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
224255 tearDown();
256+ GSettingsController.setUsageMode("Staged");
225257 }
226258
227259 function loadShell(formFactor) {
@@ -659,22 +691,57 @@ Rectangle {
659691
660692 function test_launchedAppHasActiveFocus_data() {
661693 return [
662− {tag:"phone", formFactor:"phone"},
663− {tag:"tablet", formFactor:"tablet"},
664− ];
694+ {tag: "phone", formFactor: "phone", usageMode: "Staged"},
695+ {tag: "tablet", formFactor: "tablet", usageMode: "Staged"},
696+ {tag: "desktop", formFactor: "tablet", usageMode: "Windowed"}
697+ ]
665698 }
666699
667700 function test_launchedAppHasActiveFocus(data) {
701+ GSettingsController.setUsageMode(data.usageMode);
668702 loadShell(data.formFactor);
669703 swipeAwayGreeter();
670704
671− var dialerApp = ApplicationManager.startApplication("webbrowser-app");
672− verify(dialerApp);
705+ var webApp = ApplicationManager.startApplication("webbrowser-app");
706+ verify(webApp);
673707 waitUntilAppSurfaceShowsUp("webbrowser-app")
674708
675− verify(dialerApp.session.surface);
709+ verify(webApp.session.surface);
676710
677− tryCompare(dialerApp.session.surface, "activeFocus", true);
711+ tryCompare(webApp.session.surface, "activeFocus", true);
712+ }
713+
714+ function test_launchedAppKeepsActiveFocusOnUsageModeChange() {
715+ loadShell("tablet");
716+ swipeAwayGreeter();
717+
718+ var webApp = ApplicationManager.startApplication("webbrowser-app");
719+ verify(webApp);
720+ waitUntilAppSurfaceShowsUp("webbrowser-app")
721+
722+ verify(webApp.session.surface);
723+
724+ tryCompare(webApp.session.surface, "activeFocus", true);
725+
726+ GSettingsController.setUsageMode("Windowed");
727+
728+ // check that the desktop stage and window have been loaded
729+ {
730+ var desktopWindow = findChild(shell, "decoratedWindow_webbrowser-app");
731+ verify(desktopWindow);
732+ }
733+
734+ tryCompare(webApp.session.surface, "activeFocus", true);
735+
736+ GSettingsController.setUsageMode("Staged");
737+
738+ // check that the tablet stage and app surface delegate have been loaded
739+ {
740+ var desktopWindow = findChild(shell, "tabletSpreadDelegate_webbrowser-app");
741+ verify(desktopWindow);
742+ }
743+
744+ tryCompare(webApp.session.surface, "activeFocus", true);
678745 }
679746
680747 function waitUntilAppSurfaceShowsUp(appId) {
@@ -1076,8 +1143,7 @@ Rectangle {
10761143 loadShell("phone");
10771144 swipeAwayGreeter();
10781145 AccountsService.backgroundFile = data.accounts;
1079− var backgroundSettings = findInvisibleChild(shell, "backgroundSettings");
1080− backgroundSettings.pictureUri = data.gsettings;
1146+ GSettingsController.setPictureUri(data.gsettings);
10811147
10821148 if (data.output === "defaultBackground") {
10831149 tryCompare(shell, "background", shell.defaultBackground);
@@ -1134,5 +1200,36 @@ Rectangle {
11341200 tryCompare(passwordInput, "focus", true)
11351201 }
11361202 }
1203+
1204+ function test_stageLoader_data() {
1205+ return [
1206+ {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageMode: "Staged"},
1207+ {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageMode: "Staged"},
1208+ {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageMode: "Windowed"}
1209+ ]
1210+ }
1211+
1212+ function test_stageLoader(data) {
1213+ GSettingsController.setUsageMode(data.usageMode);
1214+ loadShell(data.formFactor);
1215+ var stageLoader = findChild(shell, "applicationsDisplayLoader");
1216+ verify(String(stageLoader.source).indexOf(data.source) >= 0);
1217+ }
1218+
1219+ function test_launcherInverted_data() {
1220+ return [
1221+ {tag: "phone", formFactor: "phone", usageMode: "Staged", launcherInverted: true},
1222+ {tag: "tablet", formFactor: "tablet", usageMode: "Staged", launcherInverted: true},
1223+ {tag: "desktop", formFactor: "tablet", usageMode: "Windowed", launcherInverted: false}
1224+ ]
1225+ }
1226+
1227+ function test_launcherInverted(data) {
1228+ GSettingsController.setUsageMode(data.usageMode);
1229+ loadShell(data.formFactor);
1230+
1231+ var launcher = findChild(shell, "launcher");
1232+ compare(launcher.inverted, data.launcherInverted);
1233+ }
11371234 }
11381235}
tests/uqmlscene/main.cpp−10
@@ -63,9 +63,6 @@
6363#include <QtCore/QTranslator>
6464#include <QtCore/QLibraryInfo>
6565
66−// UbuntuGestures lib
67−#include <TouchRegistry.h>
68−
6966#define UQMLSCENE_DEBUG_ACTIVE_FOCUS 0
7067
7168#if UQMLSCENE_DEBUG_ACTIVE_FOCUS
@@ -434,11 +431,6 @@ int main(int argc, char ** argv)
434431 app.setOrganizationName("Qt Project");
435432 app.setOrganizationDomain("qt-project.org");
436433
437− // Create it before loading the module, so that TestUtil
438− // doesn't create one with a fake timer factory.
439− // When interacting manually with a test we want the real deal.
440− new TouchRegistry;
441−
442434#ifndef QT_NO_TRANSLATION
443435 QTranslator translator;
444436 QTranslator qtTranslator;
@@ -512,8 +504,6 @@ int main(int argc, char ** argv)
512504 #if UQMLSCENE_DEBUG_ACTIVE_FOCUS
513505 activeFocusLogger.setWindow(qxView);
514506 #endif
515− TouchRegistry::instance()->setParent(qxView);
516− qxView->installEventFilter(TouchRegistry::instance());
517507 window = qxView;
518508 // Set window default properties; the qml can still override them
519509 QString oname = contentItem->objectName();
tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+1
@@ -22,6 +22,7 @@ import Unity.Test 0.1
2222RowLayout {
2323 id: root
2424 property alias color: label.color
25+ property alias checked: checkbox.checked
2526
2627 Binding {
2728 target: MouseTouchAdaptor
tests/utils/modules/Unity/Test/UnityTestCase.qml−2
@@ -424,8 +424,6 @@ TestCase {
424424 }
425425
426426 Component.onCompleted: {
427− UT.Util.ensureTouchRegistryInstalled();
428−
429427 var rootItem = parent;
430428 while (rootItem.parent != undefined) {
431429 rootItem = rootItem.parent;
tests/utils/modules/Unity/Test/plugin.h+1−1
@@ -26,7 +26,7 @@ class UnityTestPlugin : public QQmlExtensionPlugin
2626 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2727
2828public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
3030};
3131
3232#endif // UNITY_TEST_PLUGIN_H
tests/utils/modules/Unity/Test/testutil.cpp+8−20
@@ -31,6 +31,7 @@ TestUtil::TestUtil(QObject *parent)
3131 : QObject(parent)
3232 , m_targetWindow(0)
3333 , m_touchDevice(0)
34+ , m_putFakeTimerFactoryInTouchRegistry(false)
3435{
3536}
3637
@@ -59,7 +60,13 @@ TouchEventSequenceWrapper *TestUtil::touchEvent(QQuickItem *item)
5960{
6061 ensureTargetWindow();
6162 ensureTouchDevice();
62− ensureTouchRegistryInstalled();
63+
64+ // Tests can be *very* slow to run and we don't want things timing out because
65+ // of that. So give it fake timers to use (they will never time out)
66+ if (!m_putFakeTimerFactoryInTouchRegistry) {
67+ TouchRegistry::instance()->setTimerFactory(new FakeTimerFactory);
68+ m_putFakeTimerFactoryInTouchRegistry = true;
69+ }
6370
6471 return new TouchEventSequenceWrapper(
6572 QTest::touchEvent(m_targetWindow, m_touchDevice, /* autoCommit */ false), item);
@@ -79,22 +86,3 @@ void TestUtil::ensureTouchDevice()
7986 QWindowSystemInterface::registerTouchDevice(m_touchDevice);
8087 }
8188}
82−
83−void TestUtil::ensureTouchRegistryInstalled()
84−{
85− if (TouchRegistry::instance())
86− return;
87−
88− if (!m_targetWindow)
89− return;
90−
91− // Tests can be *very* slow to run and we don't want things timing out because
92− // of that. So give it fake timers to use (they will never time out)
93− TouchRegistry *touchRegistry = new TouchRegistry(this, new FakeTimerFactory);
94−
95− QQuickView *view = qobject_cast<QQuickView*>(m_targetWindow);
96− if (view) {
97− view->installEventFilter(touchRegistry);
98− touchRegistry->setParent(view);
99− }
100−}
tests/utils/modules/Unity/Test/testutil.h+1−1
@@ -34,7 +34,6 @@ public:
3434
3535 Q_INVOKABLE bool isInstanceOf(QObject*, QString);
3636 Q_INVOKABLE TouchEventSequenceWrapper *touchEvent(QQuickItem *item);
37− Q_INVOKABLE void ensureTouchRegistryInstalled();
3837
3938private:
4039 void ensureTargetWindow();
@@ -42,6 +41,7 @@ private:
4241
4342 QWindow *m_targetWindow;
4443 QTouchDevice *m_touchDevice;
44+ bool m_putFakeTimerFactoryInTouchRegistry;
4545};
4646
4747QML_DECLARE_TYPE(TestUtil)