on xenial help sign in
Review comments
9a63ce2Florian Leeber
plugins/Lights/HfdLights.cpp+3−4
@@ -18,14 +18,13 @@
18
18
19#include "HfdLights.h"
19#include "HfdLights.h"
20#include <QtCore/QDebug>
20#include <QtCore/QDebug>
21−#include <QProcess>
22#include <QDBusArgument>
21#include <QDBusArgument>
23#include <QDBusConnection>
22#include <QDBusConnection>
24#include <iostream>
23#include <iostream>
25
24
26−extern "C" {
25+#define HFD_SERVICE_NAME "com.lomiri.hfd"
27−#include <string.h>
26+#define HFD_SERVICE_PATH "/com/lomiri/hfd"
28−}
27+#define HFD_SERVICE_INTERFACE "com.lomiri.hfd.Leds"
29
28
30HfdLights::HfdLights(QObject* parent)
29HfdLights::HfdLights(QObject* parent)
31 : Lights(parent)
30 : Lights(parent)
plugins/Lights/HfdLights.h−5
@@ -21,13 +21,8 @@
21
21
22#include <QtCore/QObject>
22#include <QtCore/QObject>
23#include <QDBusInterface>
23#include <QDBusInterface>
24−#include <QtGui/QColor>
25#include "Lights.h"
24#include "Lights.h"
26
25
27−#define HFD_SERVICE_NAME "com.lomiri.hfd"
28−#define HFD_SERVICE_PATH "/com/lomiri/hfd"
29−#define HFD_SERVICE_INTERFACE "com.lomiri.hfd.Leds"
30−
31class HfdLights: public Lights
26class HfdLights: public Lights
32{
27{
33 Q_OBJECT
28 Q_OBJECT
plugins/Lights/LegacyLights.cpp+1
@@ -1,5 +1,6 @@
1/*
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
2 * Copyright (C) 2014 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation.
3 *
4 *
4 * This program is free software; you can redistribute it and/or modify
5 * 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 * it under the terms of the GNU General Public License as published by
plugins/Lights/LegacyLights.h+1−2
@@ -1,5 +1,6 @@
1/*
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
2 * Copyright (C) 2014 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation.
3 *
4 *
4 * This program is free software; you can redistribute it and/or modify
5 * 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 * it under the terms of the GNU General Public License as published by
@@ -20,8 +21,6 @@
20#define UNITY_LEGACYLIGHTS_H
21#define UNITY_LEGACYLIGHTS_H
21
22
22#include <QtCore/QObject>
23#include <QtCore/QObject>
23−#include <QDBusInterface>
24−#include <QtGui/QColor>
25#include "Lights.h"
24#include "Lights.h"
26
25
27struct light_device_t;
26struct light_device_t;
plugins/Lights/Lights.h−1
@@ -20,7 +20,6 @@
20#define UNITY_LIGHTS_H
20#define UNITY_LIGHTS_H
21
21
22#include <QtCore/QObject>
22#include <QtCore/QObject>
23−#include <QDBusInterface>
24#include <QtGui/QColor>
23#include <QtGui/QColor>
25
24
26class Lights: public QObject
25class Lights: public QObject
plugins/Lights/plugin.cpp+1−1
@@ -32,7 +32,7 @@ static QObject *lights_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
32 Q_UNUSED(scriptEngine)
32 Q_UNUSED(scriptEngine)
33
33
34 bool use_hfd = false;
34 bool use_hfd = false;
35− char buffer[20];
35+ char buffer[PROP_VALUE_MAX];
36 auto result = property_get("ro.build.version.sdk", buffer, "0");
36 auto result = property_get("ro.build.version.sdk", buffer, "0");
37 if (result) {
37 if (result) {
38 auto sdkVersion = QString(buffer).toInt();
38 auto sdkVersion = QString(buffer).toInt();