Don't try to use charging control when running on SDK
This commit is contained in:
parent
b994721229
commit
5a3af9894d
2 changed files with 7 additions and 1 deletions
|
@ -34,6 +34,11 @@ Battery::Battery(Settings* newSettings, QObject* parent) : QObject(parent)
|
||||||
qInfo() << "Reading charger status from" << chargerConnectedFile->fileName();
|
qInfo() << "Reading charger status from" << chargerConnectedFile->fileName();
|
||||||
|
|
||||||
// ENABLE/DISABLE CHARGING
|
// ENABLE/DISABLE CHARGING
|
||||||
|
if(QHostInfo::localHostName().contains("SailfishEmul")) {
|
||||||
|
qInfo() << "Sailfish SDK detected";
|
||||||
|
qInfo() << "Charger control feature disabled";
|
||||||
|
}
|
||||||
|
else {
|
||||||
chargingEnabledFile = new QFile(this);
|
chargingEnabledFile = new QFile(this);
|
||||||
|
|
||||||
// e.g. for Sony Xperia XA2
|
// e.g. for Sony Xperia XA2
|
||||||
|
@ -74,7 +79,7 @@ Battery::Battery(Settings* newSettings, QObject* parent) : QObject(parent)
|
||||||
qWarning() << "Charger control file" << chargingEnabledFile->fileName() << "is not writable";
|
qWarning() << "Charger control file" << chargingEnabledFile->fileName() << "is not writable";
|
||||||
qWarning() << "Charger control feature disabled";
|
qWarning() << "Charger control feature disabled";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QHostInfo>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue