Require Qt 5.6 & misc fixes
Require Qt 5.6:
We align with what we're really testing
We can use Q_ENUM/Q_FLAG instead of Q_ENUMS/Q_FLAGS (Qt 5.5)
CursorImageInfo.cpp
Join two QString::arg into one
SessionsModel.cpp
UsersModel.cpp
Remove useless Q_D
dashconnection.cpp
ColorTheme.cpp
UserMetrics.cpp
horizontaljournaltest.cpp
listviewwithpageheadersectionexternalmodeltest.cpp
organicgridtest.cpp
verticaljournaltest.cpp
QObjects should have the Q_OBJECT macro
indicatorsmodel.h
fakeindicatorsmodel.h
There's no Roles enum, remove
appdrawerproxymodel.cpp
MirSurfaceItem.cpp
Add & to the foreach variable
appdrawerproxymodel.cpp
Make the string comparison faster
easingcurve.h
Remove QEasingCurve::Type declaration, it's already in Qt
unitysortfilterproxymodelqml.h
fake_scopesoverview.h
Make some parent functions accessible to remove clang warnings
PageList.cpp
unitymenumodel.cpp
qinputdeviceinfo_mock.cpp
Better way to iterate the container
Greeter.cpp
Cheaper env var checking
mediaplayer.cpp
mediaplayer.h
Rename timerEvent, clang was not happy since QObject has another one
ApplicationInfo.h
Mark as override
MockAppDrawerModel.cpp
launchermodeltest.cpp
screens.cpp
Fix warning
fake_previewwidgetmodel.h
Forward declare struct the same way it is defined later
fake_scopes.cpp
Safer connect
horizontaljournaltest.cpp
verticaljournaltest.cpp
testutil.cpp
Use at instead of [] in temporary
launchermodelastest.cpp
Remove unused member
Use toModelIndex() instead of value<QModelIndex>()
Approved by: Michael Zanetti, Unity8 CI Bot
commit47b643a06365d1a0b7d1e4e56d3e0ef786b828ba
authorAlbert Astals Cid <albert.astals@canonical.com>
dateTue 10 Jan 2017, 14:46 (10 years ago)
parent19b53d4a126960
CMakeLists.txt+7−7
@@ -62,13 +62,13 @@ add_custom_target(cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2
6262 ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests)
6363
6464include(FindPkgConfig)
65−find_package(Qt5Core 5.4 REQUIRED)
66−find_package(Qt5Qml 5.4 REQUIRED)
67−find_package(Qt5Quick 5.4 REQUIRED)
68−find_package(Qt5Gui 5.4 REQUIRED)
69−find_package(Qt5DBus 5.4 REQUIRED)
70−find_package(Qt5Concurrent 5.4 REQUIRED)
71−find_package(Qt5Sql 5.4 REQUIRED)
65+find_package(Qt5Core 5.6 REQUIRED)
66+find_package(Qt5Qml 5.6 REQUIRED)
67+find_package(Qt5Quick 5.6 REQUIRED)
68+find_package(Qt5Gui 5.6 REQUIRED)
69+find_package(Qt5DBus 5.6 REQUIRED)
70+find_package(Qt5Concurrent 5.6 REQUIRED)
71+find_package(Qt5Sql 5.6 REQUIRED)
7272
7373pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=23)
7474pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
debian/control+5−5
@@ -51,7 +51,7 @@ Build-Depends: cmake,
5151 qml-module-qt-labs-folderlistmodel,
5252 qml-module-qt-labs-settings,
5353 qml-module-qtqml-statemachine,
54− qml-module-qtmultimedia (>= 5.4.1-1ubuntu19~overlay2),
54+ qml-module-qtmultimedia (>= 5.6),
5555 qml-module-qtquick-layouts,
5656 qml-module-qtquick-xmllistmodel,
5757 qml-module-qtquick2,
@@ -60,12 +60,12 @@ Build-Depends: cmake,
6060 qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
6161 qml-module-ubuntu-web,
6262 qt5-default,
63− qtbase5-dev (>= 5.4),
63+ qtbase5-dev (>= 5.6),
6464 qtbase5-dev-tools,
65− qtbase5-private-dev (>= 5.4),
66− qtdeclarative5-dev (>= 5.4),
65+ qtbase5-private-dev (>= 5.6),
66+ qtdeclarative5-dev (>= 5.6),
6767 qtdeclarative5-dev-tools,
68− qtdeclarative5-private-dev (>= 5.4),
68+ qtdeclarative5-private-dev (>= 5.6),
6969 qtdeclarative5-ubuntu-content1,
7070 qtdeclarative5-ubuntu-settings-components (>= 0.11),
7171 ttf-ubuntu-font-family,
plugins/AccountsService/AccountsService.h+1−1
@@ -29,7 +29,6 @@ class QDBusInterface;
2929class AccountsService: public QObject
3030{
3131 Q_OBJECT
32− Q_ENUMS(PasswordDisplayHint)
3332 Q_PROPERTY (QString user
3433 READ user
3534 WRITE setUser
@@ -86,6 +85,7 @@ public:
8685 Keyboard,
8786 Numeric,
8887 };
88+ Q_ENUM(PasswordDisplayHint)
8989
9090 explicit AccountsService(QObject *parent = 0, const QString & user = QString());
9191 ~AccountsService() = default;
plugins/Cursor/CursorImageInfo.cpp+1−2
@@ -108,8 +108,7 @@ int CursorImageInfo::frameDuration() const
108108QUrl CursorImageInfo::imageSource() const
109109{
110110 auto urlString = QString("image://cursor/%1/%2/%3")
111− .arg(m_themeName)
112− .arg(m_cursorName)
111+ .arg(m_themeName, m_cursorName)
113112 .arg(m_cursorHeight);
114113
115114 return QUrl(urlString);
plugins/Dash/abstractdashview.cpp+1−1
@@ -23,7 +23,7 @@ AbstractDashView::AbstractDashView()
2323 , m_asyncRequestedIndex(-1)
2424 , m_columnSpacing(0)
2525 , m_rowSpacing(0)
26− , m_buffer(320) // Same value used in qquickitemview.cpp in Qt 5.4
26+ , m_buffer(320) // Same value as QML_VIEW_DEFAULTCACHEBUFFER in qquickitemview.cpp (Qt 5.6)
2727 , m_displayMarginBeginning(0)
2828 , m_displayMarginEnd(0)
2929 , m_needsRelayout(false)
plugins/LightDM/IntegratedLightDM/liblightdm/Greeter.h+2−2
@@ -46,18 +46,18 @@ class Q_DECL_EXPORT Greeter : public QObject
4646 Q_PROPERTY(QString hostname READ hostname CONSTANT)
4747 Q_PROPERTY(bool hasGuestAccount READ hasGuestAccountHint CONSTANT)
4848
49− Q_ENUMS(PromptType MessageType)
50−
5149public:
5250 enum PromptType {
5351 PromptTypeQuestion,
5452 PromptTypeSecret
5553 };
54+ Q_ENUM(PromptType)
5655
5756 enum MessageType {
5857 MessageTypeInfo,
5958 MessageTypeError
6059 };
60+ Q_ENUM(MessageType)
6161
6262 explicit Greeter(QObject* parent=0);
6363 virtual ~Greeter();
plugins/LightDM/IntegratedLightDM/liblightdm/SessionsModel.cpp−1
@@ -38,7 +38,6 @@ SessionsModel::SessionsModel(QObject* parent) :
3838 QAbstractListModel(parent),
3939 d_ptr(new SessionsModelPrivate(this))
4040{
41− Q_D(SessionsModel);
4241 m_roleNames = QAbstractListModel::roleNames();
4342 m_roleNames[KeyRole] = "key";
4443 m_roleNames[TypeRole] = "type";
plugins/LightDM/IntegratedLightDM/liblightdm/SessionsModel.h+2−2
@@ -35,8 +35,6 @@ class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
3535 {
3636 Q_OBJECT
3737
38− Q_ENUMS(SessionModelRoles SessionType)
39−
4038 public:
4139
4240 enum SessionModelRoles {
@@ -46,11 +44,13 @@ class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
4644 IdRole = KeyRole, /** Deprecated */
4745 TypeRole
4846 };
47+ Q_ENUM(SessionModelRoles)
4948
5049 enum SessionType {
5150 LocalSessions,
5251 RemoteSessions
5352 };
53+ Q_ENUM(SessionType)
5454
5555 explicit SessionsModel(QObject* parent=0); /** Deprecated. Loads local sessions*/
5656 explicit SessionsModel(SessionsModel::SessionType, QObject* parent=0);
plugins/LightDM/IntegratedLightDM/liblightdm/UsersModel.h+1−2
@@ -37,8 +37,6 @@ class Q_DECL_EXPORT UsersModel : public QAbstractListModel
3737{
3838 Q_OBJECT
3939
40− Q_ENUMS(UserModelRoles)
41−
4240public:
4341 explicit UsersModel(QObject *parent = 0);
4442 virtual ~UsersModel() = default;
@@ -53,6 +51,7 @@ public:
5351 BackgroundPathRole,
5452 UidRole
5553 };
54+ Q_ENUM(UserModelRoles)
5655
5756 int rowCount(const QModelIndex &parent) const override;
5857 QVariant data(const QModelIndex &index, int role) const override;
plugins/LightDM/SessionsModel.h+1−2
@@ -28,8 +28,6 @@ class SessionsModel : public UnitySortFilterProxyModelQML
2828{
2929 Q_OBJECT
3030
31− Q_ENUMS(SessionModelRoles)
32−
3331 Q_PROPERTY(QList<QUrl> iconSearchDirectories READ iconSearchDirectories
3432 WRITE setIconSearchDirectories NOTIFY iconSearchDirectoriesChanged)
3533Q_SIGNALS:
@@ -45,6 +43,7 @@ public:
4543 TypeRole = QLightDM::SessionsModel::SessionModelRoles::TypeRole,
4644 IconRole
4745 };
46+ Q_ENUM(SessionModelRoles)
4847
4948 explicit SessionsModel(QObject* parent=nullptr);
5049
plugins/Lights/Lights.h+1−1
@@ -27,7 +27,6 @@ struct light_device_t;
2727class Lights: public QObject
2828{
2929 Q_OBJECT
30− Q_ENUMS(State)
3130 Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged)
3231 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
3332 Q_PROPERTY(int onMillisec READ onMillisec WRITE setOnMillisec NOTIFY onMillisecChanged)
@@ -38,6 +37,7 @@ public:
3837 Off,
3938 On,
4039 };
40+ Q_ENUM(State)
4141
4242 explicit Lights(QObject *parent = 0);
4343 ~Lights();
plugins/Powerd/Powerd.h+2−2
@@ -27,8 +27,6 @@
2727class Powerd: public QObject
2828{
2929 Q_OBJECT
30− Q_ENUMS(Status)
31− Q_ENUMS(DisplayStateChangeReason)
3230 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
3331
3432public:
@@ -41,11 +39,13 @@ public:
4139 SnapDecision = 5, // Display changed state due to snap decision prompt
4240 CallDone = 6, // Display changed state due to voice call end
4341 };
42+ Q_ENUM(DisplayStateChangeReason)
4443
4544 enum Status {
4645 Off,
4746 On,
4847 };
48+ Q_ENUM(Status)
4949
5050 explicit Powerd(QObject *parent = 0);
5151 ~Powerd();
plugins/UInput/uinput.h+1−1
@@ -27,7 +27,6 @@
2727class UInput : public QObject
2828{
2929 Q_OBJECT
30− Q_ENUMS(Button)
3130
3231public:
3332 enum Button {
@@ -35,6 +34,7 @@ public:
3534 ButtonRight,
3635 ButtonMiddle
3736 };
37+ Q_ENUM(Button)
3838
3939 explicit UInput(QObject *parent = nullptr);
4040 ~UInput();
plugins/Ubuntu/Gestures/Direction.h+1−1
@@ -26,7 +26,6 @@
2626 */
2727class UBUNTUGESTURESQML_EXPORT Direction : public QObject {
2828 Q_OBJECT
29− Q_ENUMS(Type)
3029
3130public:
3231 // Make sure it is kept synchronized with SDK UCSwipeArea::Direction
@@ -38,6 +37,7 @@ public:
3837 Horizontal, // Along the X axis, in any direction
3938 Vertical // Along the Y axis, in any direction
4039 };
40+ Q_ENUM(Type)
4141
4242 Q_INVOKABLE static bool isHorizontal(Direction::Type type);
4343 Q_INVOKABLE static bool isVertical(Direction::Type type);
plugins/Ubuntu/Gestures/TouchGestureArea.h+1−1
@@ -114,7 +114,6 @@ private:
114114class UBUNTUGESTURESQML_EXPORT TouchGestureArea : public QQuickItem
115115{
116116 Q_OBJECT
117− Q_ENUMS(Status)
118117
119118 Q_PROPERTY(int status READ status NOTIFY statusChanged)
120119 Q_PROPERTY(bool dragging READ dragging NOTIFY draggingChanged)
@@ -137,6 +136,7 @@ public:
137136 Recognized,
138137 Rejected
139138 };
139+ Q_ENUM(Status)
140140 TouchGestureArea(QQuickItem* parent = nullptr);
141141 ~TouchGestureArea();
142142
plugins/Unity/DashCommunicator/CMakeLists.txt+1
@@ -1,5 +1,6 @@
11include_directories(
22 ${CMAKE_CURRENT_SOURCE_DIR}
3+ ${CMAKE_CURRENT_BINARY_DIR}
34 ${libunity8-private_SOURCE_DIR}
45)
56
plugins/Unity/DashCommunicator/dashconnection.cpp+3
@@ -32,6 +32,7 @@
3232 */
3333class AsyncDBusInterface : public QDBusAbstractInterface
3434{
35+ Q_OBJECT
3536public:
3637 AsyncDBusInterface(const QString &service, const QString &path,
3738 const QString &interface, const QDBusConnection &connection,
@@ -61,3 +62,5 @@ void DashConnection::setCurrentScope(int index, bool animate, bool isSwipe)
6162 dbusInterface()->asyncCall(QStringLiteral("SetCurrentScope"), index, animate, isSwipe);
6263 }
6364}
65+
66+#include "dashconnection.moc"
plugins/Unity/Indicators/indicators.h+5−5
@@ -27,13 +27,13 @@ class UNITYINDICATORS_EXPORT ActionState : public QObject
2727{
2828 Q_OBJECT
2929public:
30− Q_ENUMS(ActionStates)
3130 enum ActionStates {
3231 Label = 0x00,
3332 IconSource = 0x01,
3433 AccessableName = 0x02,
3534 Visible = 0x03,
3635 };
36+ Q_ENUM(ActionStates)
3737
3838 ActionState(QObject*parent=0):QObject(parent) {}
3939};
@@ -42,11 +42,11 @@ class UNITYINDICATORS_EXPORT NetworkActionState : public QObject
4242{
4343 Q_OBJECT
4444public:
45− Q_ENUMS(NetworkActionStates)
4645 enum NetworkActionStates {
4746 Connection = 0x01,
4847 SignalStrength = 0x02,
4948 };
49+ Q_ENUM(NetworkActionStates)
5050
5151 NetworkActionState(QObject*parent=0):QObject(parent) {}
5252};
@@ -55,13 +55,13 @@ class UNITYINDICATORS_EXPORT NetworkConnection : public QObject
5555{
5656 Q_OBJECT
5757public:
58− Q_ENUMS(NetworkConnectionStates)
5958 enum NetworkConnectionStates {
6059 Initial = 0x00,
6160 Activating = 0x01,
6261 Activated = 0x02,
6362 Deactivating = 0x03,
6463 };
64+ Q_ENUM(NetworkConnectionStates)
6565
6666 NetworkConnection(QObject*parent=0):QObject(parent) {}
6767};
@@ -70,12 +70,12 @@ class UNITYINDICATORS_EXPORT IndicatorsModelRole : public QObject
7070{
7171 Q_OBJECT
7272public:
73− Q_ENUMS(Roles)
7473 enum Roles {
7574 Identifier = 0,
7675 Position,
7776 IndicatorProperties
7877 };
78+ Q_ENUM(Roles)
7979
8080 IndicatorsModelRole(QObject*parent=0):QObject(parent) {}
8181};
@@ -84,7 +84,6 @@ class UNITYINDICATORS_EXPORT FlatMenuProxyModelRole : public QObject
8484{
8585 Q_OBJECT
8686public:
87− Q_ENUMS(Roles)
8887 enum Roles {
8988 Action = Qt::DisplayRole + 1,
9089 Label,
@@ -93,6 +92,7 @@ public:
9392 hasSection,
9493 hasSubMenu
9594 };
95+ Q_ENUM(Roles)
9696
9797 FlatMenuProxyModelRole(QObject*parent=0):QObject(parent) {}
9898};
plugins/Unity/Indicators/indicatorsmodel.h−1
@@ -32,7 +32,6 @@ class IndicatorsManager;
3232class UNITYINDICATORS_EXPORT IndicatorsModel : public QAbstractListModel
3333{
3434 Q_OBJECT
35− Q_ENUMS(Roles)
3635 Q_PROPERTY(int count READ count NOTIFY countChanged)
3736 Q_PROPERTY(QString profile READ profile WRITE setProfile NOTIFY profileChanged)
3837
plugins/Unity/InputInfo/qinputinfo.h+2−3
@@ -57,8 +57,6 @@ class QInputDeviceManager;
5757class QInputDevice : public QObject
5858{
5959 Q_OBJECT
60− Q_ENUMS(InputType)
61− Q_FLAGS(InputType InputTypeFlags)
6260 friend class QInputDeviceManagerPrivate;
6361
6462public:
@@ -72,8 +70,9 @@ public:
7270 Keyboard = 16,
7371 Switch = 32
7472 };
75− Q_ENUMS(InputType)
73+ Q_FLAG(InputType)
7674 Q_DECLARE_FLAGS(InputTypeFlags, InputType)
75+ Q_FLAG(InputTypeFlags)
7776
7877 explicit QInputDevice(QObject *parent = 0);
7978 QString name() const;
plugins/Utils/appdrawerproxymodel.cpp+2−2
@@ -157,8 +157,8 @@ bool AppDrawerProxyModel::filterAcceptsRow(int source_row, const QModelIndex &so
157157 QStringList allWords = m_source->data(m_source->index(source_row, 0), AppDrawerModelInterface::RoleKeywords).toStringList();
158158 allWords.prepend(m_source->data(m_source->index(source_row, 0), AppDrawerModelInterface::RoleName).toString());
159159 bool found = false;
160− Q_FOREACH (const QString currentWord, allWords) {
161− if (currentWord.toLower().startsWith(m_filterString.toLower())) {
160+ Q_FOREACH (const QString ¤tWord, allWords) {
161+ if (currentWord.startsWith(m_filterString, Qt::CaseInsensitive)) {
162162 found = true;
163163 break;
164164 }
plugins/Utils/appdrawerproxymodel.h+2−2
@@ -23,8 +23,6 @@ using namespace unity::shell::launcher;
2323class AppDrawerProxyModel: public QSortFilterProxyModel
2424{
2525 Q_OBJECT
26− Q_ENUMS(GroupBy)
27− Q_ENUMS(SortBy)
2826 Q_PROPERTY(QAbstractItemModel* source READ source WRITE setSource NOTIFY sourceChanged)
2927 Q_PROPERTY(GroupBy group READ group WRITE setGroup NOTIFY groupChanged)
3028 Q_PROPERTY(QString filterLetter READ filterLetter WRITE setFilterLetter NOTIFY filterLetterChanged)
@@ -38,10 +36,12 @@ public:
3836 GroupByAll,
3937 GroupByAToZ
4038 };
39+ Q_ENUM(GroupBy)
4140 enum SortBy {
4241 SortByAToZ,
4342 SortByUsage
4443 };
44+ Q_ENUM(SortBy)
4545
4646 AppDrawerProxyModel(QObject* parent = nullptr);
4747
plugins/Utils/easingcurve.h−1
@@ -36,7 +36,6 @@
3636class EasingCurve: public QObject
3737{
3838 Q_OBJECT
39− Q_ENUMS(QEasingCurve::Type)
4039 Q_PROPERTY(QEasingCurve::Type type READ type WRITE setType NOTIFY typeChanged)
4140 Q_PROPERTY(qreal period READ period WRITE setPeriod NOTIFY periodChanged)
4241 Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged)
plugins/Utils/unitysortfilterproxymodelqml.h+5
@@ -38,6 +38,11 @@ public:
3838 Q_INVOKABLE int mapRowToSource(int row);
3939 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
4040
41+ // Make the QSortFilterProxyModel variants also accessible
42+ using QSortFilterProxyModel::data;
43+ using QSortFilterProxyModel::mapFromSource;
44+ using QSortFilterProxyModel::mapToSource;
45+
4146 /* getters */
4247 int totalCount() const;
4348 bool invertMatch() const;
plugins/Utils/windowstatestorage.h+1−3
@@ -25,7 +25,6 @@
2525class WindowStateStorage: public QObject
2626{
2727 Q_OBJECT
28− Q_ENUMS(WindowState)
2928public:
3029 enum WindowState {
3130 WindowStateNormal = 1 << 0,
@@ -42,10 +41,9 @@ public:
4241 WindowStateMaximizedBottomRight = 1 << 11,
4342 WindowStateRestored = 1 << 12
4443 };
44+ Q_ENUM(WindowState)
4545 Q_DECLARE_FLAGS(WindowStates, WindowState)
46−#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
4746 Q_FLAG(WindowStates)
48−#endif
4947
5048 WindowStateStorage(QObject *parent = 0);
5149 virtual ~WindowStateStorage();
plugins/Wizard/PageList.cpp+2−5
@@ -73,11 +73,8 @@ PageList::PageList(QObject *parent)
7373 // If there was a system update installed, skip until the last page to just greet the user
7474 QSettings settings;
7575 if (settings.value(QStringLiteral("Wizard/SkipUntilFinishedPage")).toBool()) {
76− const QString lastPage = m_pages.lastKey();
77− Q_FOREACH(const QString &page, m_pages.keys()) {
78− if (Q_UNLIKELY(page != lastPage)) {
79− m_pages.remove(page);
80− }
76+ while (m_pages.count() > 1) {
77+ m_pages.erase(m_pages.begin());
8178 }
8279
8380 // ... and reset it again for the next run
plugins/Wizard/timezonemodel.h+1−1
@@ -27,7 +27,6 @@ class TimeZoneLocationModel: public QAbstractListModel
2727 Q_PROPERTY(bool listUpdating READ listUpdating NOTIFY listUpdatingChanged)
2828 Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged)
2929 Q_PROPERTY(QString country READ country WRITE setCountry NOTIFY countryChanged)
30− Q_ENUMS(Roles)
3130
3231public:
3332 explicit TimeZoneLocationModel(QObject *parent = nullptr);
@@ -42,6 +41,7 @@ public:
4241 LatitudeRole,
4342 LongitudeRole
4443 };
44+ Q_ENUM(Roles)
4545
4646 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
4747 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
src/libunity8-private/abstractdbusservicemonitor.h+1−1
@@ -30,7 +30,6 @@ class QDBusServiceWatcher;
3030class Q_DECL_EXPORT AbstractDBusServiceMonitor : public QObject
3131{
3232 Q_OBJECT
33− Q_ENUMS(Bus)
3433 Q_PROPERTY(bool serviceAvailable READ serviceAvailable NOTIFY serviceAvailableChanged)
3534
3635public:
@@ -38,6 +37,7 @@ public:
3837 SessionBus,
3938 SystemBus,
4039 };
40+ Q_ENUM(Bus)
4141
4242 explicit AbstractDBusServiceMonitor(const QString &service, const QString &path, const QString &interface,
4343 const Bus bus = SessionBus,
tests/mocks/AccountsService/AccountsService.h+1−1
@@ -27,7 +27,6 @@ class MockUsersModel;
2727class AccountsService: public QObject
2828{
2929 Q_OBJECT
30− Q_ENUMS(PasswordDisplayHint)
3130 Q_PROPERTY (QString user
3231 READ user
3332 WRITE setUser
@@ -94,6 +93,7 @@ public:
9493 Keyboard,
9594 Numeric
9695 };
96+ Q_ENUM(PasswordDisplayHint)
9797
9898 explicit AccountsService(QObject *parent = 0);
9999
tests/mocks/LightDM/IntegratedLightDM/liblightdm/Greeter.cpp+1−1
@@ -173,7 +173,7 @@ void Greeter::respond(const QString &response)
173173
174174void Greeter::sendAuthenticationComplete()
175175{
176− if (qgetenv("UNITY_TESTING").isEmpty()) {
176+ if (qEnvironmentVariableIsEmpty("UNITY_TESTING")) {
177177 // simulate PAM's delay
178178 QTimer::singleShot(1000, this, &Greeter::authenticationComplete);
179179 } else {
tests/mocks/LightDM/IntegratedLightDM/liblightdm/Greeter.h+2−2
@@ -42,8 +42,6 @@ class Q_DECL_EXPORT Greeter : public QObject
4242 Q_PROPERTY(QString hostname READ hostname CONSTANT)
4343 Q_PROPERTY(bool hasGuestAccount READ hasGuestAccountHint CONSTANT)
4444
45− Q_ENUMS(PromptType MessageType)
46−
4745 //Mock-only API for testing purposes
4846 Q_PROPERTY(QString mockMode READ mockMode WRITE setMockMode NOTIFY mockModeChanged)
4947
@@ -52,11 +50,13 @@ public:
5250 PromptTypeQuestion,
5351 PromptTypeSecret
5452 };
53+ Q_ENUM(PromptType)
5554
5655 enum MessageType {
5756 MessageTypeInfo,
5857 MessageTypeError
5958 };
59+ Q_ENUM(MessageType)
6060
6161 explicit Greeter(QObject* parent=0);
6262 virtual ~Greeter();
tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModel.cpp−1
@@ -33,7 +33,6 @@ SessionsModel::SessionsModel(QObject* parent) :
3333 QAbstractListModel(parent),
3434 d_ptr(new SessionsModelPrivate(this))
3535{
36− Q_D(SessionsModel);
3736 m_roleNames = QAbstractListModel::roleNames();
3837 m_roleNames[KeyRole] = "key";
3938 m_roleNames[TypeRole] = "type";
tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModel.h+2−2
@@ -29,8 +29,6 @@ class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
2929 {
3030 Q_OBJECT
3131
32− Q_ENUMS(SessionModelRoles SessionType)
33−
3432 public:
3533
3634 enum SessionModelRoles {
@@ -40,11 +38,13 @@ class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
4038 IdRole = KeyRole, /** Deprecated */
4139 TypeRole
4240 };
41+ Q_ENUM(SessionModelRoles)
4342
4443 enum SessionType {
4544 LocalSessions,
4645 RemoteSessions
4746 };
47+ Q_ENUM(SessionType)
4848
4949 explicit SessionsModel(QObject* parent=nullptr); /** Deprecated. Loads local sessions*/
5050 explicit SessionsModel(SessionsModel::SessionType, QObject* parent=nullptr);
tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModel.cpp−2
@@ -34,8 +34,6 @@ UsersModel::UsersModel(QObject *parent) :
3434 QAbstractListModel(parent),
3535 d_ptr(new UsersModelPrivate(this))
3636{
37− Q_D(UsersModel);
38−
3937 // Extend roleNames (we want to keep the "display" role)
4038 QHash<int, QByteArray> roles = roleNames();
4139 roles[NameRole] = "name";
tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModel.h+1−2
@@ -31,8 +31,6 @@ class Q_DECL_EXPORT UsersModel : public QAbstractListModel
3131{
3232 Q_OBJECT
3333
34− Q_ENUMS(UserModelRoles)
35−
3634 //Mock-only API for testing purposes
3735 Q_PROPERTY(QString mockMode READ mockMode WRITE setMockMode NOTIFY mockModeChanged)
3836
@@ -53,6 +51,7 @@ public:
5351 BackgroundPathRole,
5452 UidRole
5553 };
54+ Q_ENUM(UserModelRoles)
5655
5756 int rowCount(const QModelIndex &parent) const override;
5857 QVariant data(const QModelIndex &index, int role) const override;
tests/mocks/Lights/Lights.h+1−1
@@ -23,7 +23,6 @@
2323class Lights: public QObject
2424{
2525 Q_OBJECT
26− Q_ENUMS(State)
2726 Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged)
2827 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
2928 Q_PROPERTY(int onMillisec READ onMillisec WRITE setOnMillisec NOTIFY onMillisecChanged)
@@ -34,6 +33,7 @@ public:
3433 Off,
3534 On,
3635 };
36+ Q_ENUM(State)
3737
3838 explicit Lights(QObject *parent = 0);
3939 ~Lights();
tests/mocks/Powerd/Powerd.h+2−2
@@ -24,8 +24,6 @@
2424class Powerd: public QObject
2525{
2626 Q_OBJECT
27− Q_ENUMS(Status)
28− Q_ENUMS(DisplayStateChangeReason)
2927 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
3028
3129public:
@@ -35,11 +33,13 @@ public:
3533 PowerKey = 2, // Display changed state due to user pressing power key
3634 Proximity = 3, // Display changed state due to proximity events
3735 };
36+ Q_ENUM(DisplayStateChangeReason)
3837
3938 enum Status {
4039 Off,
4140 On,
4241 };
42+ Q_ENUM(Status)
4343
4444 explicit Powerd(QObject *parent = 0);
4545
tests/mocks/QMenuModel/dbus-enums.h+2−3
@@ -28,9 +28,6 @@ class DBusEnums : public QObject
2828{
2929 Q_OBJECT
3030
31− Q_ENUMS(BusType)
32− Q_ENUMS(ConnectionStatus)
33−
3431public:
3532 enum BusType {
3633 None = 0,
@@ -38,12 +35,14 @@ public:
3835 SystemBus,
3936 LastBusType
4037 };
38+ Q_ENUM(BusType)
4139
4240 enum ConnectionStatus {
4341 Disconnected = 0,
4442 Connecting,
4543 Connected
4644 };
45+ Q_ENUM(ConnectionStatus)
4746
4847private:
4948 DBusEnums() {}
tests/mocks/QMenuModel/unitymenumodel.cpp+3−3
@@ -249,9 +249,9 @@ QVariant UnityMenuModel::get(int row, const QByteArray &role)
249249{
250250 static QHash<QByteArray, int> roles;
251251 if (roles.isEmpty()) {
252− QHash<int, QByteArray> names = roleNames();
253− Q_FOREACH (int role, names.keys())
254− roles.insert(names[role], role);
252+ const QHash<int, QByteArray> names = roleNames();
253+ for(auto it = names.begin(); it != names.end(); ++it)
254+ roles.insert(it.value(), it.key());
255255 }
256256
257257 return data(index(row, 0), roles[role]);
tests/mocks/QtMultimedia/mediaplayer.cpp+2−2
@@ -58,7 +58,7 @@ MediaPlayer::MediaPlayer(QObject* parent)
5858{
5959 qsrand(time(nullptr));
6060 m_timer.setInterval(100);
61− connect(&m_timer, &QTimer::timeout, this, &MediaPlayer::timerEvent);
61+ connect(&m_timer, &QTimer::timeout, this, &MediaPlayer::processTimer);
6262
6363 connect(MediaPlayerDataController::instance(), &MediaPlayerDataController::sourceAboutToBeRemoved,
6464 this, [this](const QUrl& source) {
@@ -188,7 +188,7 @@ void MediaPlayer::seek(int position)
188188 }
189189}
190190
191−void MediaPlayer::timerEvent()
191+void MediaPlayer::processTimer()
192192{
193193 if (m_position + m_timer.interval() < duration()) {
194194 m_position += m_timer.interval();
tests/mocks/QtMultimedia/mediaplayer.h+6−6
@@ -45,17 +45,13 @@ class MediaPlayer: public QObject
4545 Q_PROPERTY(QObject *metaData READ metaData CONSTANT)
4646 Q_PROPERTY(DeclarativePlaylist *playlist READ playlist WRITE setPlaylist NOTIFY playlistChanged)
4747
48− Q_ENUMS(PlaybackState)
49− Q_ENUMS(AudioRole)
50− Q_ENUMS(Availability)
51− Q_ENUMS(Status)
52− Q_ENUMS(Error)
5348public:
5449 enum PlaybackState {
5550 PlayingState,
5651 PausedState,
5752 StoppedState
5853 };
54+ Q_ENUM(PlaybackState)
5955
6056 enum AudioRole {
6157 UnknownRole,
@@ -69,6 +65,7 @@ public:
6965 SonificationRole,
7066 GameRole
7167 };
68+ Q_ENUM(AudioRole)
7269
7370 enum Availability {
7471 Available,
@@ -76,6 +73,7 @@ public:
7673 Unavailable,
7774 ResourceMissing
7875 };
76+ Q_ENUM(Availability)
7977
8078 enum Status {
8179 UnknownStatus,
@@ -88,6 +86,7 @@ public:
8886 EndOfMedia,
8987 InvalidMedia
9088 };
89+ Q_ENUM(Status)
9190
9291 enum Error {
9392 NoError,
@@ -97,6 +96,7 @@ public:
9796 AccessDeniedError,
9897 ServiceMissingError
9998 };
99+ Q_ENUM(Error)
100100
101101 explicit MediaPlayer(QObject *parent = nullptr);
102102
@@ -145,7 +145,7 @@ Q_SIGNALS:
145145 void error(Error error, const QString &errorString);
146146
147147private Q_SLOTS:
148− void timerEvent();
148+ void processTimer();
149149
150150private:
151151 QUrl m_source;
tests/mocks/UInput/mockuinput.h+1−1
@@ -27,7 +27,6 @@
2727class MockUInput : public QObject
2828{
2929 Q_OBJECT
30− Q_ENUMS(Button)
3130
3231public:
3332 enum Button {
@@ -35,6 +34,7 @@ public:
3534 ButtonRight,
3635 ButtonMiddle
3736 };
37+ Q_ENUM(Button)
3838
3939 explicit MockUInput(QObject *parent = nullptr);
4040 ~MockUInput();
tests/mocks/Ubuntu/Connectivity/networking-status.h+2−3
@@ -26,9 +26,6 @@ class Q_DECL_EXPORT NetworkingStatus : public QObject
2626 Q_OBJECT
2727 Q_DISABLE_COPY(NetworkingStatus)
2828
29− Q_ENUMS(Limitations)
30− Q_ENUMS(Status)
31−
3229 Q_PROPERTY(QVector<Limitations> limitations READ limitations NOTIFY limitationsChanged)
3330 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
3431 Q_PROPERTY(bool online READ online NOTIFY onlineChanged)
@@ -41,12 +38,14 @@ public:
4138 enum Limitations {
4239 Bandwith
4340 };
41+ Q_ENUM(Limitations)
4442
4543 enum Status {
4644 Offline,
4745 Connecting,
4846 Online
4947 };
48+ Q_ENUM(Status)
5049
5150 QVector<Limitations> limitations() const;
5251 Status status() const;
tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/MockSecurityPrivacy.h+1−1
@@ -22,7 +22,6 @@
2222class MockSecurityPrivacy : public QObject
2323{
2424 Q_OBJECT
25− Q_ENUMS(SecurityType)
2625 Q_PROPERTY (SecurityType securityType
2726 READ getSecurityType
2827 NOTIFY securityTypeChanged)
@@ -33,6 +32,7 @@ public:
3332 Passcode,
3433 Passphrase,
3534 };
35+ Q_ENUM(SecurityType)
3636
3737 MockSecurityPrivacy(QObject *parent = 0);
3838
tests/mocks/Unity/Application/ApplicationInfo.h+1−1
@@ -112,7 +112,7 @@ public:
112112
113113 //////
114114 // internal mock stuff
115− void close();
115+ void close() override;
116116 void requestFocus();
117117
118118Q_SIGNALS:
tests/mocks/Unity/Application/MirSurfaceItem.cpp+1−1
@@ -216,7 +216,7 @@ void MirSurfaceItem::touchEvent(QTouchEvent * event)
216216 Q_EMIT touchReleaseCountChanged(m_touchReleaseCount);
217217 }
218218
219− Q_FOREACH(QTouchEvent::TouchPoint touchPoint, event->touchPoints()) {
219+ Q_FOREACH(const QTouchEvent::TouchPoint &touchPoint, event->touchPoints()) {
220220 QString id(touchPoint.id());
221221 QVariantList list = m_touchTrail[id].toList();
222222 list.append(QVariant::fromValue(touchPoint.pos()));
tests/mocks/Unity/Indicators/fakeindicatorsmodel.h−1
@@ -25,7 +25,6 @@
2525class FakeIndicatorsModel : public QAbstractListModel
2626{
2727 Q_OBJECT
28− Q_ENUMS(Roles)
2928 Q_PROPERTY(int count READ count NOTIFY countChanged)
3029 Q_PROPERTY(QString profile READ profile WRITE setProfile NOTIFY profileChanged)
3130 Q_PROPERTY(QVariant modelData READ modelData WRITE setModelData NOTIFY modelDataChanged)
tests/mocks/Unity/InputInfo/qinputdeviceinfo_mock.cpp+6−2
@@ -43,10 +43,14 @@ QInputDevice *QInputDeviceManagerPrivate::addMockDevice(const QString &devicePat
4343
4444void QInputDeviceManagerPrivate::removeDevice(const QString &path)
4545{
46− Q_FOREACH (const QString devicePath, deviceMap.keys()) {
46+ auto it = deviceMap.begin();
47+ while (it != deviceMap.end()) {
48+ const QString devicePath = it.key();
4749 if (devicePath.contains(path)) {
48− deviceMap.remove(devicePath);
50+ it = deviceMap.erase(it);
4951 Q_EMIT deviceRemoved(devicePath);
52+ } else {
53+ ++it;
5054 }
5155 }
5256}
tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp+1−1
@@ -53,7 +53,7 @@ MockAppDrawerModel::MockAppDrawerModel(QObject *parent):
5353 qsrand(QDateTime::currentMSecsSinceEpoch() / 1000);
5454}
5555
56−int MockAppDrawerModel::rowCount(const QModelIndex &parent) const
56+int MockAppDrawerModel::rowCount(const QModelIndex & /*parent*/) const
5757{
5858 return m_list.count();
5959}
tests/mocks/Unity/Notifications/MockActionModel.h+1−1
@@ -36,11 +36,11 @@ public:
3636 QVariant data(const QModelIndex &index, int role) const override;
3737 QHash<int, QByteArray> roleNames() const override;
3838
39− Q_ENUMS(ActionsRoles)
4039 enum ActionsRoles {
4140 RoleActionLabel = Qt::UserRole + 1,
4241 RoleActionId = Qt::UserRole + 2
4342 };
43+ Q_ENUM(ActionsRoles)
4444 Q_INVOKABLE QVariant data(int row, int role) const;
4545
4646 Q_INVOKABLE void append(const QString &id, const QString &label);
tests/mocks/Unity/Notifications/MockNotification.h+2−1
@@ -30,7 +30,6 @@ struct MockNotificationPrivate;
3030
3131class MockNotification : public QObject {
3232 Q_OBJECT
33− Q_ENUMS(Type Urgency)
3433 Q_PROPERTY(QString summary READ getSummary WRITE setSummary NOTIFY summaryChanged)
3534 Q_PROPERTY(QString body READ getBody WRITE setBody NOTIFY bodyChanged)
3635 Q_PROPERTY(int nid READ getID WRITE setID NOTIFY idChanged)
@@ -48,7 +47,9 @@ private:
4847
4948public:
5049 enum Urgency { Low, Normal, Critical };
50+ Q_ENUM(Urgency)
5151 enum Type { PlaceHolder, Confirmation, Ephemeral, Interactive, SnapDecision };
52+ Q_ENUM(Type)
5253
5354Q_SIGNALS:
5455 void summaryChanged(const QString &summary);
tests/mocks/Unity/Screens/screens.cpp+1−1
@@ -30,7 +30,7 @@ Screens::Screens(QObject *parent) :
3030 m_screenList.append(new Screen());
3131}
3232
33−Screens::~Screens()
33+Screens::~Screens() noexcept
3434{
3535 qDeleteAll(m_screenList);
3636 m_screenList.clear();
tests/mocks/Unity/Screens/screens.h+1−1
@@ -25,7 +25,6 @@ class Screen;
2525class Screens : public QAbstractListModel
2626{
2727 Q_OBJECT
28− Q_ENUMS(OutputTypes)
2928
3029 Q_PROPERTY(int count READ count NOTIFY countChanged)
3130
@@ -52,6 +51,7 @@ public:
5251 TV,
5352 EDP
5453 };
54+ Q_ENUM(OutputTypes)
5555
5656 explicit Screens(QObject *parent = 0);
5757 virtual ~Screens() noexcept;
tests/mocks/Unity/fake_previewwidgetmodel.h+1−1
@@ -23,7 +23,7 @@
2323#include <QSharedPointer>
2424#include <QVariantMap>
2525
26−class PreviewData;
26+struct PreviewData;
2727
2828class PreviewWidgetModel : public unity::shell::scopes::PreviewWidgetModelInterface
2929{
tests/mocks/Unity/fake_scopes.cpp+1−1
@@ -272,7 +272,7 @@ void Scopes::addScope(Scope* scope)
272272 beginInsertRows(QModelIndex(), index, index);
273273 m_scopes.append(scope);
274274 endInsertRows();
275− connect(scope, &Scope::favoriteChanged, [this, scope]{
275+ connect(scope, &Scope::favoriteChanged, this, [this, scope]{
276276 setFavorite(scope->id(), scope->favorite());
277277 });
278278 }
tests/mocks/Unity/fake_scopesoverview.h+2
@@ -34,6 +34,8 @@ public:
3434 void setSearchQuery(const QString& search_query) override;
3535 Q_INVOKABLE void activate(QVariant const& result, QString const& categoryId) override;
3636
37+ using Scope::setFavorite;
38+
3739 // This is implementation detail
3840 void setFavorite(Scope *scope, bool favorite);
3941 void moveFavoriteTo(Scope *scope, int index);
tests/mocks/Utils/windowstatestorage.h+1−3
@@ -25,7 +25,6 @@ class WindowStateStorage: public QObject
2525{
2626 Q_OBJECT
2727 Q_PROPERTY(QVariantMap geometry READ geometry WRITE setGeometry NOTIFY geometryChanged)
28− Q_ENUMS(WindowState)
2928public:
3029 enum WindowState {
3130 WindowStateNormal = 1 << 0,
@@ -42,10 +41,9 @@ public:
4241 WindowStateMaximizedBottomRight = 1 << 11,
4342 WindowStateRestored = 1 << 12
4443 };
44+ Q_ENUM(WindowState)
4545 Q_DECLARE_FLAGS(WindowStates, WindowState)
46−#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
4746 Q_FLAG(WindowStates)
48−#endif
4947
5048 WindowStateStorage(QObject *parent = 0);
5149
tests/mocks/libusermetrics/CMakeLists.txt+1
@@ -10,6 +10,7 @@ qt5_use_modules(MockUserMetrics Gui)
1010
1111include_directories(
1212 ${CMAKE_SOURCE_DIR}/plugins/Utils
13+ ${CMAKE_CURRENT_BINARY_DIR}
1314)
1415
1516set_target_properties(MockUserMetrics PROPERTIES
tests/mocks/libusermetrics/ColorTheme.cpp+4
@@ -30,6 +30,8 @@ namespace UserMetricsOutput
3030
3131class ColorThemePrivate: QObject
3232{
33+ Q_OBJECT
34+
3335public:
3436 explicit ColorThemePrivate(ColorTheme *parent = 0);
3537
@@ -126,3 +128,5 @@ QColor ColorTheme::end() const
126128{
127129 return d_ptr->m_end;
128130}
131+
132+#include "ColorTheme.moc"
tests/mocks/libusermetrics/UserMetrics.cpp+5
@@ -36,6 +36,7 @@ class UserMetricsPrivate;
3636
3737class Q_DECL_EXPORT UserMetricsData: public QObject
3838{
39+ Q_OBJECT
3940public:
4041 explicit UserMetricsData(QObject *parent);
4142
@@ -64,6 +65,7 @@ private:
6465
6566class UserMetricsPrivate: QObject
6667{
68+ Q_OBJECT
6769public:
6870 explicit UserMetricsPrivate(UserMetrics *parent);
6971
@@ -106,6 +108,7 @@ private:
106108
107109class UserMetricsDataPrivate: QObject
108110{
111+ Q_OBJECT
109112public:
110113 explicit UserMetricsDataPrivate(UserMetricsData *parent);
111114
@@ -492,3 +495,5 @@ UserMetrics * UserMetrics::getInstance()
492495{
493496 return new UserMetrics();
494497}
498+
499+#include "UserMetrics.moc"
tests/plugins/Dash/horizontaljournaltest.cpp+2−1
@@ -30,6 +30,7 @@
3030#include <paths.h>
3131
3232class WidthModel : public QAbstractListModel {
33+ Q_OBJECT
3334public:
3435 QHash<int, QByteArray> roleNames() const override
3536 {
@@ -87,7 +88,7 @@ private:
8788 {
8889 QTRY_COMPARE(item->x(), x);
8990 QTRY_COMPARE(item->y(), y);
90− QTRY_COMPARE(item->width(), model->stringList()[modelIndex].toDouble());
91+ QTRY_COMPARE(item->width(), model->stringList().at(modelIndex).toDouble());
9192 QTRY_COMPARE(QQuickItemPrivate::get(item)->culled, !visible);
9293 }
9394
tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp+1
@@ -30,6 +30,7 @@
3030
3131class StringListModel : public QAbstractListModel
3232{
33+ Q_OBJECT
3334public:
3435 StringListModel()
3536 {
tests/plugins/Dash/organicgridtest.cpp+1
@@ -30,6 +30,7 @@
3030#include <paths.h>
3131
3232class DummyModel : public QAbstractListModel {
33+ Q_OBJECT
3334public:
3435 DummyModel() : m_count(0) {}
3536
tests/plugins/Dash/verticaljournaltest.cpp+2−1
@@ -30,6 +30,7 @@
3030#include <paths.h>
3131
3232class HeightModel : public QAbstractListModel {
33+ Q_OBJECT
3334public:
3435 QHash<int, QByteArray> roleNames() const override
3536 {
@@ -102,7 +103,7 @@ private:
102103 QTRY_COMPARE(item.m_modelIndex, modelIndex);
103104 QTRY_COMPARE(item.x(), x);
104105 QTRY_COMPARE(item.y(), y);
105− QTRY_COMPARE(item.height(), model->stringList()[modelIndex].toDouble());
106+ QTRY_COMPARE(item.height(), model->stringList().at(modelIndex).toDouble());
106107 QTRY_COMPARE(QQuickItemPrivate::get(item.m_item)->culled, !visible);
107108 }
108109
tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp−1
@@ -35,7 +35,6 @@ class LauncherModelASTest : public QObject
3535 Q_OBJECT
3636
3737private:
38− LauncherModel *launcherModel;
3938 QStringList users;
4039 QHash<QString, QList<QVariantMap>> mockProperties;
4140
tests/plugins/Unity/Launcher/launchermodeltest.cpp+5−5
@@ -102,7 +102,7 @@ public:
102102 }
103103 return nullptr;
104104 }
105− unityapi::ApplicationInfoInterface *findApplicationWithSurface(unityapi::MirSurfaceInterface* surface) const override {
105+ unityapi::ApplicationInfoInterface *findApplicationWithSurface(unityapi::MirSurfaceInterface* /*surface*/) const override {
106106 return nullptr;
107107 }
108108 unity::shell::application::ApplicationInfoInterface *startApplication(const QString &, const QStringList &) override { return nullptr; }
@@ -518,14 +518,14 @@ private Q_SLOTS:
518518 QCOMPARE(spy.count(), 2);
519519
520520 QVariantList countEmissionArgs = spy.takeFirst();
521− QCOMPARE(countEmissionArgs.at(0).value<QModelIndex>().row(), index);
522− QCOMPARE(countEmissionArgs.at(1).value<QModelIndex>().row(), index);
521+ QCOMPARE(countEmissionArgs.at(0).toModelIndex().row(), index);
522+ QCOMPARE(countEmissionArgs.at(1).toModelIndex().row(), index);
523523 QVector<int> roles = countEmissionArgs.at(2).value<QVector<int> >();
524524 QCOMPARE(roles.first(), (int)LauncherModel::RoleCount);
525525
526526 QVariantList countVisibleEmissionArgs = spy.takeFirst();
527− QCOMPARE(countVisibleEmissionArgs.at(0).value<QModelIndex>().row(), index);
528− QCOMPARE(countVisibleEmissionArgs.at(1).value<QModelIndex>().row(), index);
527+ QCOMPARE(countVisibleEmissionArgs.at(0).toModelIndex().row(), index);
528+ QCOMPARE(countVisibleEmissionArgs.at(1).toModelIndex().row(), index);
529529 roles = countVisibleEmissionArgs.at(2).value<QVector<int> >();
530530 QVERIFY(roles.contains(LauncherModel::RoleCountVisible));
531531 QVERIFY(roles.contains(LauncherModel::RoleAlerting));
tests/uqmlscene/main.cpp+3−3
@@ -245,7 +245,7 @@ static int displayOptionsDialog(Options *options)
245245
246246static bool checkVersion(const QUrl &url)
247247{
248− if (!qgetenv("QMLSCENE_IMPORT_NAME").isEmpty())
248+ if (!qEnvironmentVariableIsEmpty("QMLSCENE_IMPORT_NAME"))
249249 qWarning("QMLSCENE_IMPORT_NAME is no longer supported.");
250250
251251 QString fileName = url.toLocalFile();
@@ -389,9 +389,9 @@ int main(int argc, char ** argv)
389389 Options options;
390390
391391 QStringList imports;
392− QList<QPair<QString, QString> > bundles;
392+ QVector<QPair<QString, QString> > bundles;
393393 for (int i = 1; i < argc; ++i) {
394− if (*argv[i] != '-' && QFileInfo(QFile::decodeName(argv[i])).exists()) {
394+ if (*argv[i] != '-' && QFileInfo::exists(QFile::decodeName(argv[i]))) {
395395 options.file = QUrl::fromLocalFile(argv[i]);
396396 } else {
397397 const QString lowerArgument = QString::fromLatin1(argv[i]).toLower();
tests/utils/modules/Unity/Test/testutil.cpp+1−1
@@ -103,7 +103,7 @@ TouchEventSequenceWrapper *TestUtil::touchEvent(QQuickItem *item)
103103void TestUtil::ensureTargetWindow()
104104{
105105 if (!m_targetWindow && !QGuiApplication::topLevelWindows().isEmpty())
106− m_targetWindow = QGuiApplication::topLevelWindows()[0];
106+ m_targetWindow = QGuiApplication::topLevelWindows().at(0);
107107}
108108
109109void TestUtil::ensureTouchDevice()