2026-02-06 13:01:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
// SPDX-FileCopyrightText: 2026 A-La-Karte Contributors
|
|
|
|
|
|
2026-02-09 13:03:01 +00:00
|
|
|
#include <QCommandLineOption>
|
|
|
|
|
#include <QCommandLineParser>
|
2026-02-06 13:01:35 +00:00
|
|
|
#include <QCoreApplication>
|
|
|
|
|
|
2026-02-12 13:34:56 +00:00
|
|
|
#include <KDBusService>
|
|
|
|
|
#include <KSignalHandler>
|
|
|
|
|
|
2026-02-06 13:01:35 +00:00
|
|
|
#include "gamecenterdaemon.h"
|
|
|
|
|
|
2026-02-12 13:34:56 +00:00
|
|
|
#include <signal.h>
|
|
|
|
|
|
2026-02-06 13:01:35 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
QCoreApplication app(argc, argv);
|
2026-02-12 13:34:56 +00:00
|
|
|
app.setOrganizationDomain(QStringLiteral("kde.org"));
|
|
|
|
|
app.setApplicationName(QStringLiteral("alakarte_gamecenter"));
|
|
|
|
|
|
|
|
|
|
KDBusService service(KDBusService::Unique);
|
2026-02-06 13:01:35 +00:00
|
|
|
|
2026-02-09 13:03:01 +00:00
|
|
|
QCommandLineParser parser;
|
|
|
|
|
parser.setApplicationDescription(QStringLiteral("A-La-Karte Game Center"));
|
|
|
|
|
parser.addHelpOption();
|
|
|
|
|
parser.process(app);
|
|
|
|
|
|
2026-02-06 13:01:35 +00:00
|
|
|
GameCenterDaemon daemon;
|
|
|
|
|
if (!daemon.init()) {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-12 13:34:56 +00:00
|
|
|
KSignalHandler::self()->watchSignal(SIGTERM);
|
|
|
|
|
KSignalHandler::self()->watchSignal(SIGINT);
|
|
|
|
|
QObject::connect(KSignalHandler::self(), &KSignalHandler::signalReceived, &app, [&app](int signal) {
|
|
|
|
|
Q_UNUSED(signal);
|
|
|
|
|
app.quit();
|
|
|
|
|
});
|
|
|
|
|
|
2026-02-06 13:01:35 +00:00
|
|
|
return app.exec();
|
|
|
|
|
}
|