on xenial help sign in
Fix a bunch of review nits
commit1c4480159a3747ab1cd6afcc1146c1625678631e authorMichael Terry <michael.terry@canonical.com> dateThu 22 Aug 2013, 10:54 (13 years ago) parente6e431b
10 files changed+30−35
Components/DemoOverlay.qml+3−6 Shell.qml+3−2 plugins/AccountsService/AccountsService.cpp+4−4 plugins/AccountsService/AccountsService.h+6−7 plugins/AccountsService/plugin.cpp+1−1 plugins/AccountsService/plugin.h+2−2 tests/plugins/AccountsService/AccountsServer.h+4−5 tests/plugins/AccountsService/PropertiesServer.h+4−5 tests/plugins/AccountsService/client.cpp+2−2 tests/plugins/AccountsService/server.cpp+1−1
Components/DemoOverlay.qml+3−6
@@ -82,7 +82,6 @@ Showable {
8282 }
8383
8484 Rectangle {
85− id: backgroundShade
8685 anchors.fill: parent
8786 color: "black"
8887 opacity: 0.8
@@ -155,7 +154,7 @@ Showable {
155154 }
156155 GradientStop {
157156 position: 1.0
158− color: "#00000000"
157+ color: "transparent"
159158 }
160159 }
161160 anchors.fill: parent
@@ -250,11 +249,9 @@ Showable {
250249
251250 onDisplayPowerStateChange: {
252251 if (status == Powerd.Off && wholeAnimation.running) {
253− wholeAnimation.paused = true;
254− //hintAnimation.paused = true;
252+ wholeAnimation.pause();
255253 } else if (status == Powerd.On) {
256− wholeAnimation.paused = false;
257− //hintAnimation.paused = false;
254+ wholeAnimation.pause();
258255 }
259256 }
260257 }
Shell.qml+3−2
@@ -61,15 +61,16 @@ FocusScope {
6161 }
6262
6363 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")
6565
6666 function hideEdgeDemo() {
6767 var user = LightDM.Users.data(greeter.currentIndex, LightDM.UserRoles.NameRole);
6868 AccountsService.setUserProperty(user, "demo-edges", false);
6969 shell.showEdgeDemo = false;
7070 }
71+
7172 function hideEdgeDemoInGreeter() {
72− //AccountsService.setUserProperty("lightdm", "demo-edges", false);
73+ // TODO: AccountsService.setUserProperty("lightdm", "demo-edges", false);
7374 shell.showEdgeDemoInGreeter = false;
7475 }
7576
plugins/AccountsService/AccountsService.cpp+4−4
@@ -17,10 +17,10 @@
1717 */
1818
1919#include "AccountsService.h"
20−#include <QtDBus/QDBusConnection>
21−#include <QtDBus/QDBusConnectionInterface>
22−#include <QtDBus/QDBusMessage>
23−#include <QtDBus/QDBusVariant>
20+#include <QDBusConnection>
21+#include <QDBusConnectionInterface>
22+#include <QDBusMessage>
23+#include <QDBusVariant>
2424
2525AccountsService::AccountsService(QObject* parent)
2626 : QObject(parent),
plugins/AccountsService/AccountsService.h+6−7
@@ -19,10 +19,10 @@
1919#ifndef UNITY_ACCOUNTSSERVICE_H
2020#define UNITY_ACCOUNTSSERVICE_H
2121
22−#include <QtDBus/QDBusInterface>
23−#include <QtCore/QMap>
24−#include <QtCore/QObject>
25−#include <QtCore/QString>
22+#include <QDBusInterface>
23+#include <QMap>
24+#include <QObject>
25+#include <QString>
2626
2727class AccountsService: public QObject
2828{
@@ -31,14 +31,13 @@ class AccountsService: public QObject
3131public:
3232 explicit AccountsService(QObject *parent = 0);
3333
34−public Q_SLOTS:
34+public Q_INVOKABLE:
3535 QVariant getUserProperty(const QString &user, const QString &property);
3636 void setUserProperty(const QString &user, const QString &property, const QVariant &value);
3737
38−private Q_SLOTS:
38+private:
3939 QDBusInterface *getUserInterface(const QString &user);
4040
41−private:
4241 QDBusInterface *accounts_manager;
4342 QMap<QString, QDBusInterface *> users;
4443};
plugins/AccountsService/plugin.cpp+1−1
@@ -19,7 +19,7 @@
1919#include "plugin.h"
2020#include "AccountsService.h"
2121
22−#include <QtQml/QtQml>
22+#include <QtQml>
2323
2424static QObject *service_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
2525{
plugins/AccountsService/plugin.h+2−2
@@ -19,8 +19,8 @@
1919#ifndef ACCOUNTSSERVICE_PLUGIN_H
2020#define ACCOUNTSSERVICE_PLUGIN_H
2121
22−#include <QtQml/QQmlEngine>
23−#include <QtQml/QQmlExtensionPlugin>
22+#include <QQmlEngine>
23+#include <QQmlExtensionPlugin>
2424
2525class AccountsServicePlugin : public QQmlExtensionPlugin
2626{
tests/plugins/AccountsService/AccountsServer.h+4−5
@@ -20,10 +20,10 @@
2020#ifndef UNITY_ACCOUNTSSERVER_H
2121#define UNITY_ACCOUNTSSERVER_H
2222
23−#include <QtCore/QObject>
24−#include <QtCore/QString>
25−#include <QtDBus/QDBusContext>
26−#include <QtDBus/QDBusObjectPath>
23+#include <QDBusContext>
24+#include <QDBusObjectPath>
25+#include <QObject>
26+#include <QString>
2727
2828class AccountsServer: public QObject, protected QDBusContext
2929{
@@ -32,7 +32,6 @@ class AccountsServer: public QObject, protected QDBusContext
3232public:
3333 explicit AccountsServer(QObject *parent = 0);
3434
35−public Q_SLOTS:
3635 QDBusObjectPath FindUserByName(const QString &user);
3736};
3837
tests/plugins/AccountsService/PropertiesServer.h+4−5
@@ -21,10 +21,10 @@
2121#define UNITY_PROPERTIESSERVER_H
2222
2323#include "PropertiesServer.h"
24−#include <QtCore/QObject>
25−#include <QtCore/QString>
26−#include <QtDBus/QDBusContext>
27−#include <QtDBus/QDBusVariant>
24+#include <QDBusContext>
25+#include <QDBusVariant>
26+#include <QObject>
27+#include <QString>
2828
2929class PropertiesServer: public QObject, protected QDBusContext
3030{
@@ -33,7 +33,6 @@ class PropertiesServer: public QObject, protected QDBusContext
3333public:
3434 explicit PropertiesServer(QObject *parent = 0);
3535
36−public Q_SLOTS:
3736 QDBusVariant Get(const QString &interface, const QString &property);
3837 void Set(const QString &interface, const QString &property, const QDBusVariant &variant);
3938
tests/plugins/AccountsService/client.cpp+2−2
@@ -18,8 +18,8 @@
1818 */
1919
2020#include "AccountsService.h"
21−#include <QtTest/QSignalSpy>
22−#include <QtTest/QTest>
21+#include <QSignalSpy>
22+#include <QTest>
2323
2424class AccountsServiceTest : public QObject
2525{
tests/plugins/AccountsService/server.cpp+1−1
@@ -21,7 +21,7 @@
2121#include "AccountsServer.h"
2222#include "PropertiesAdaptor.h"
2323#include "PropertiesServer.h"
24−#include <QtCore/QCoreApplication>
24+#include <QCoreApplication>
2525
2626int main(int argc, char *argv[])
2727{