on xenial help sign in
Fix a bunch of review nits
1c44801Michael Terry
Components/DemoOverlay.qml+3−6
@@ -82,7 +82,6 @@ Showable {
82 }
82 }
83
83
84 Rectangle {
84 Rectangle {
85− id: backgroundShade
86 anchors.fill: parent
85 anchors.fill: parent
87 color: "black"
86 color: "black"
88 opacity: 0.8
87 opacity: 0.8
@@ -155,7 +154,7 @@ Showable {
155 }
154 }
156 GradientStop {
155 GradientStop {
157 position: 1.0
156 position: 1.0
158− color: "#00000000"
157+ color: "transparent"
159 }
158 }
160 }
159 }
161 anchors.fill: parent
160 anchors.fill: parent
@@ -250,11 +249,9 @@ Showable {
250
249
251 onDisplayPowerStateChange: {
250 onDisplayPowerStateChange: {
252 if (status == Powerd.Off && wholeAnimation.running) {
251 if (status == Powerd.Off && wholeAnimation.running) {
253− wholeAnimation.paused = true;
252+ wholeAnimation.pause();
254− //hintAnimation.paused = true;
255 } else if (status == Powerd.On) {
253 } else if (status == Powerd.On) {
256− wholeAnimation.paused = false;
254+ wholeAnimation.pause();
257− //hintAnimation.paused = false;
258 }
255 }
259 }
256 }
260 }
257 }
Shell.qml+3−2
@@ -61,15 +61,16 @@ FocusScope {
61 }
61 }
62
62
63 property bool showEdgeDemo: false
63 property bool showEdgeDemo: false
64− property bool showEdgeDemoInGreeter: showEdgeDemo //AccountsService.getUserProperty("lightdm", "demo-edges")
64+ property bool showEdgeDemoInGreeter: showEdgeDemo // TODO: AccountsService.getUserProperty("lightdm", "demo-edges")
65
65
66 function hideEdgeDemo() {
66 function hideEdgeDemo() {
67 var user = LightDM.Users.data(greeter.currentIndex, LightDM.UserRoles.NameRole);
67 var user = LightDM.Users.data(greeter.currentIndex, LightDM.UserRoles.NameRole);
68 AccountsService.setUserProperty(user, "demo-edges", false);
68 AccountsService.setUserProperty(user, "demo-edges", false);
69 shell.showEdgeDemo = false;
69 shell.showEdgeDemo = false;
70 }
70 }
71+
71 function hideEdgeDemoInGreeter() {
72 function hideEdgeDemoInGreeter() {
72− //AccountsService.setUserProperty("lightdm", "demo-edges", false);
73+ // TODO: AccountsService.setUserProperty("lightdm", "demo-edges", false);
73 shell.showEdgeDemoInGreeter = false;
74 shell.showEdgeDemoInGreeter = false;
74 }
75 }
75
76
plugins/AccountsService/AccountsService.cpp+4−4
@@ -17,10 +17,10 @@
17 */
17 */
18
18
19#include "AccountsService.h"
19#include "AccountsService.h"
20−#include <QtDBus/QDBusConnection>
20+#include <QDBusConnection>
21−#include <QtDBus/QDBusConnectionInterface>
21+#include <QDBusConnectionInterface>
22−#include <QtDBus/QDBusMessage>
22+#include <QDBusMessage>
23−#include <QtDBus/QDBusVariant>
23+#include <QDBusVariant>
24
24
25AccountsService::AccountsService(QObject* parent)
25AccountsService::AccountsService(QObject* parent)
26 : QObject(parent),
26 : QObject(parent),
plugins/AccountsService/AccountsService.h+6−7
@@ -19,10 +19,10 @@
19#ifndef UNITY_ACCOUNTSSERVICE_H
19#ifndef UNITY_ACCOUNTSSERVICE_H
20#define UNITY_ACCOUNTSSERVICE_H
20#define UNITY_ACCOUNTSSERVICE_H
21
21
22−#include <QtDBus/QDBusInterface>
22+#include <QDBusInterface>
23−#include <QtCore/QMap>
23+#include <QMap>
24−#include <QtCore/QObject>
24+#include <QObject>
25−#include <QtCore/QString>
25+#include <QString>
26
26
27class AccountsService: public QObject
27class AccountsService: public QObject
28{
28{
@@ -31,14 +31,13 @@ class AccountsService: public QObject
31public:
31public:
32 explicit AccountsService(QObject *parent = 0);
32 explicit AccountsService(QObject *parent = 0);
33
33
34−public Q_SLOTS:
34+public Q_INVOKABLE:
35 QVariant getUserProperty(const QString &user, const QString &property);
35 QVariant getUserProperty(const QString &user, const QString &property);
36 void setUserProperty(const QString &user, const QString &property, const QVariant &value);
36 void setUserProperty(const QString &user, const QString &property, const QVariant &value);
37
37
38−private Q_SLOTS:
38+private:
39 QDBusInterface *getUserInterface(const QString &user);
39 QDBusInterface *getUserInterface(const QString &user);
40
40
41−private:
42 QDBusInterface *accounts_manager;
41 QDBusInterface *accounts_manager;
43 QMap<QString, QDBusInterface *> users;
42 QMap<QString, QDBusInterface *> users;
44};
43};
plugins/AccountsService/plugin.cpp+1−1
@@ -19,7 +19,7 @@
19#include "plugin.h"
19#include "plugin.h"
20#include "AccountsService.h"
20#include "AccountsService.h"
21
21
22−#include <QtQml/QtQml>
22+#include <QtQml>
23
23
24static QObject *service_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
24static QObject *service_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
25{
25{
plugins/AccountsService/plugin.h+2−2
@@ -19,8 +19,8 @@
19#ifndef ACCOUNTSSERVICE_PLUGIN_H
19#ifndef ACCOUNTSSERVICE_PLUGIN_H
20#define ACCOUNTSSERVICE_PLUGIN_H
20#define ACCOUNTSSERVICE_PLUGIN_H
21
21
22−#include <QtQml/QQmlEngine>
22+#include <QQmlEngine>
23−#include <QtQml/QQmlExtensionPlugin>
23+#include <QQmlExtensionPlugin>
24
24
25class AccountsServicePlugin : public QQmlExtensionPlugin
25class AccountsServicePlugin : public QQmlExtensionPlugin
26{
26{
tests/plugins/AccountsService/AccountsServer.h+4−5
@@ -20,10 +20,10 @@
20#ifndef UNITY_ACCOUNTSSERVER_H
20#ifndef UNITY_ACCOUNTSSERVER_H
21#define UNITY_ACCOUNTSSERVER_H
21#define UNITY_ACCOUNTSSERVER_H
22
22
23+#include <QDBusContext>
24+#include <QDBusObjectPath>
23−#include <QtCore/QObject>
25+#include <QObject>
24−#include <QtCore/QString>
26+#include <QString>
25−#include <QtDBus/QDBusContext>
26−#include <QtDBus/QDBusObjectPath>
27
27
28class AccountsServer: public QObject, protected QDBusContext
28class AccountsServer: public QObject, protected QDBusContext
29{
29{
@@ -32,7 +32,6 @@ class AccountsServer: public QObject, protected QDBusContext
32public:
32public:
33 explicit AccountsServer(QObject *parent = 0);
33 explicit AccountsServer(QObject *parent = 0);
34
34
35−public Q_SLOTS:
36 QDBusObjectPath FindUserByName(const QString &user);
35 QDBusObjectPath FindUserByName(const QString &user);
37};
36};
38
37
tests/plugins/AccountsService/PropertiesServer.h+4−5
@@ -21,10 +21,10 @@
21#define UNITY_PROPERTIESSERVER_H
21#define UNITY_PROPERTIESSERVER_H
22
22
23#include "PropertiesServer.h"
23#include "PropertiesServer.h"
24+#include <QDBusContext>
25+#include <QDBusVariant>
24−#include <QtCore/QObject>
26+#include <QObject>
25−#include <QtCore/QString>
27+#include <QString>
26−#include <QtDBus/QDBusContext>
27−#include <QtDBus/QDBusVariant>
28
28
29class PropertiesServer: public QObject, protected QDBusContext
29class PropertiesServer: public QObject, protected QDBusContext
30{
30{
@@ -33,7 +33,6 @@ class PropertiesServer: public QObject, protected QDBusContext
33public:
33public:
34 explicit PropertiesServer(QObject *parent = 0);
34 explicit PropertiesServer(QObject *parent = 0);
35
35
36−public Q_SLOTS:
37 QDBusVariant Get(const QString &interface, const QString &property);
36 QDBusVariant Get(const QString &interface, const QString &property);
38 void Set(const QString &interface, const QString &property, const QDBusVariant &variant);
37 void Set(const QString &interface, const QString &property, const QDBusVariant &variant);
39
38
tests/plugins/AccountsService/client.cpp+2−2
@@ -18,8 +18,8 @@
18 */
18 */
19
19
20#include "AccountsService.h"
20#include "AccountsService.h"
21−#include <QtTest/QSignalSpy>
21+#include <QSignalSpy>
22−#include <QtTest/QTest>
22+#include <QTest>
23
23
24class AccountsServiceTest : public QObject
24class AccountsServiceTest : public QObject
25{
25{
tests/plugins/AccountsService/server.cpp+1−1
@@ -21,7 +21,7 @@
21#include "AccountsServer.h"
21#include "AccountsServer.h"
22#include "PropertiesAdaptor.h"
22#include "PropertiesAdaptor.h"
23#include "PropertiesServer.h"
23#include "PropertiesServer.h"
24−#include <QtCore/QCoreApplication>
24+#include <QCoreApplication>
25
25
26int main(int argc, char *argv[])
26int main(int argc, char *argv[])
27{
27{