Review comments
commit9a63ce25687c0a2722cfaad932478a88a45334e2
authorFlorian Leeber <florian@ubports.com>
dateSat 23 Oct 2021, 19:52 (5 years ago)
parente0e4713
plugins/Lights/HfdLights.cpp+3−4
@@ -18,14 +18,13 @@
1818
1919#include "HfdLights.h"
2020#include <QtCore/QDebug>
21−#include <QProcess>
2221#include <QDBusArgument>
2322#include <QDBusConnection>
2423#include <iostream>
2524
26−extern "C" {
27−#include <string.h>
28−}
25+#define HFD_SERVICE_NAME "com.lomiri.hfd"
26+#define HFD_SERVICE_PATH "/com/lomiri/hfd"
27+#define HFD_SERVICE_INTERFACE "com.lomiri.hfd.Leds"
2928
3029HfdLights::HfdLights(QObject* parent)
3130 : Lights(parent)
plugins/Lights/HfdLights.h−5
@@ -21,13 +21,8 @@
2121
2222#include <QtCore/QObject>
2323#include <QDBusInterface>
24−#include <QtGui/QColor>
2524#include "Lights.h"
2625
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−
3126class HfdLights: public Lights
3227{
3328 Q_OBJECT
plugins/Lights/LegacyLights.cpp+1
@@ -1,5 +1,6 @@
11/*
22 * Copyright (C) 2014 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation.
34 *
45 * This program is free software; you can redistribute it and/or modify
56 * it under the terms of the GNU General Public License as published by
plugins/Lights/LegacyLights.h+1−2
@@ -1,5 +1,6 @@
11/*
22 * Copyright (C) 2014 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation.
34 *
45 * This program is free software; you can redistribute it and/or modify
56 * it under the terms of the GNU General Public License as published by
@@ -20,8 +21,6 @@
2021#define UNITY_LEGACYLIGHTS_H
2122
2223#include <QtCore/QObject>
23−#include <QDBusInterface>
24−#include <QtGui/QColor>
2524#include "Lights.h"
2625
2726struct light_device_t;
plugins/Lights/Lights.h−1
@@ -20,7 +20,6 @@
2020#define UNITY_LIGHTS_H
2121
2222#include <QtCore/QObject>
23−#include <QDBusInterface>
2423#include <QtGui/QColor>
2524
2625class Lights: public QObject
plugins/Lights/plugin.cpp+1−1
@@ -32,7 +32,7 @@ static QObject *lights_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
3232 Q_UNUSED(scriptEngine)
3333
3434 bool use_hfd = false;
35− char buffer[20];
35+ char buffer[PROP_VALUE_MAX];
3636 auto result = property_get("ro.build.version.sdk", buffer, "0");
3737 if (result) {
3838 auto sdkVersion = QString(buffer).toInt();