Make service binary leaner

This commit is contained in:
Matti Viljanen 2022-03-19 22:49:05 +02:00
parent e1250980f9
commit a417c6f5f6
No known key found for this signature in database
GPG key ID: CF32A1495158F888
6 changed files with 8 additions and 8 deletions

View file

@ -76,7 +76,7 @@ Battery::Battery(Settings* newSettings, Logger* newLogger, QObject* parent) : QO
disableChargingValue = 1;
}
if(!chargingEnabledFile && !QHostInfo::localHostName().contains("SailfishEmul")) {
if(!chargingEnabledFile && !QSysInfo::machineHostName().contains("SailfishEmul")) {
logE("Charger control file not found!");
logE("Please contact the developer with your device model!");
}

View file

@ -22,7 +22,7 @@
#include <QString>
#include <QFile>
#include <QStandardPaths>
#include <QHostInfo>
#include <QSysInfo>
#include "settings.h"
#include "process.h"
#include "logger.h"

View file

@ -47,7 +47,7 @@ int main(int argc, char *argv[])
bool verbose = false;
bool debug = false;
if(QHostInfo::localHostName().contains("SailfishEmul")) {
if(QSysInfo::machineHostName().contains("SailfishEmul")) {
verbose = true;
debug = true;
}

View file

@ -4,7 +4,7 @@ LEGACY_BUILD = 0
TARGET = harbour-batterybuddy-daemon
CONFIG += sailfishapp console
CONFIG += console
contains(LEGACY_BUILD, 0) { QT = core dbus }
contains(LEGACY_BUILD, 1) { QT = core dbus multimedia }
@ -22,7 +22,7 @@ DEFINES += LEGACY_BUILD=$${LEGACY_BUILD}
# See main() and logger.h for details.
DEFINES += QT_NO_DEBUG_OUTPUT
LIBS += -lkeepalive
LIBS += -lkeepalive -lnemonotifications-qt5
HEADERS += \
src/battery.h \

View file

@ -102,7 +102,7 @@ Battery::Battery(Logger* newLogger, bool loglevelSet, QCoreApplication *app, QOb
chargingEnabledFile = Q_NULLPTR;
}
}
else if(!QHostInfo::localHostName().contains("SailfishEmul")) {
else if(!QSysInfo::machineHostName().contains("SailfishEmul")) {
logE("Charger control file not found!");
logE("Please contact the developer with your device model!");
}
@ -403,7 +403,7 @@ void Battery::shutdown() {
logD("Health notification stopped");
}
// ENABLE/DISABLE CHARGING
if(!setChargingEnabled(true) && !QHostInfo::localHostName().contains("SailfishEmul")) {
if(!setChargingEnabled(true) && !QSysInfo::machineHostName().contains("SailfishEmul")) {
logE("ERROR! Could not restore charger status! Your device "
"may not charge until reboot! If that doesn't help, "
"uninstall Battery Buddy and reboot your device.");

View file

@ -23,7 +23,7 @@
#include <QString>
#include <QFile>
#include <QStandardPaths>
#include <QHostInfo>
#include <QSysInfo>
#include <QLocale>
#include <QCoreApplication>
#include <keepalive/backgroundactivity.h>