52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
#include <QtGlobal>
|
|
#include <QCoreApplication>
|
|
#include <QByteArray>
|
|
|
|
#include <QProcess>
|
|
#include <QCommandLineParser>
|
|
#include <QStandardPaths>
|
|
#include <QSettings>
|
|
#include <QDir>
|
|
#include <QDebug>
|
|
|
|
#include "commandline_parser.h"
|
|
#include "message_handler.h"
|
|
|
|
int main(int argc, char **argv) {
|
|
QByteArray const value = qgetenv("LC_ALL");
|
|
if (value.isEmpty() || value != "C") {
|
|
qputenv("LC_ALL", "C");
|
|
}
|
|
|
|
|
|
// qputenv("XDG_RUNTIME_DIR", "/var/run/user/0");
|
|
|
|
openlog("ATB-UPDATE_CHECK", LOG_PERROR | LOG_PID | LOG_CONS, LOG_USER);
|
|
|
|
QCoreApplication a(argc, argv);
|
|
QCoreApplication::setApplicationName("ATBUpdateCheck");
|
|
QCoreApplication::setApplicationVersion(APP_VERSION);
|
|
|
|
if (!messageHandlerInstalled()) { // change internal qt-QDebug-handling
|
|
atbInstallMessageHandler(nullptr);
|
|
//atbInstallMessageHandler(atbDebugOutput);
|
|
setDebugLevel(LOG_NOTICE);
|
|
}
|
|
|
|
QCommandLineParser parser;
|
|
QCommandLineOption ismasConnectOption("ismas-connected");
|
|
QCommandLineOption updateRequestedOption("update-requested");
|
|
parser.addOption(ismasConnectOption);
|
|
parser.addOption(updateRequestedOption);
|
|
parser.process(a);
|
|
|
|
if (parser.isSet(ismasConnectOption)) {
|
|
qCritical() << parser.isSet(ismasConnectOption);
|
|
} else
|
|
if (parser.isSet(updateRequestedOption)) {
|
|
qCritical() << parser.isSet(updateRequestedOption);
|
|
}
|
|
|
|
return 0;
|
|
}
|