Files
galeon 1817157e4d
tests / package-smoke-linux (push) Skipped
tests / package-smoke-windows (push) Skipped
tests / package-smoke-macos (push) Skipped
tests / windows (pull_request) Skipped
tests / macos (pull_request) Skipped
tests / package-smoke-linux (pull_request) Skipped
tests / package-smoke-windows (pull_request) Skipped
tests / package-smoke-macos (pull_request) Skipped
tests / macos (push) Successful in 1m19s
tests / linux (push) Successful in 5m48s
tests / linux (pull_request) Successful in 5m20s
tests / windows (push) Canceled after 30m5s
release pipeline fixes
Signed-off-by: galeon <dertiellis@gmail.com>
2026-10-24 21:45:45 +03:00

60 lines
1.9 KiB
C++

#include "launcherpaths.h"
#include "launcherversion.h"
#include "localization.h"
#include <QDebug>
#include <QDir>
#include <QGuiApplication>
#include <QIcon>
#include <QQmlApplicationEngine>
#include <QQuickStyle>
#ifdef LAUNCHER_HAS_WEBENGINE
#include <QtWebEngineQuick>
#endif
int main(int argc, char *argv[])
{
#ifdef LAUNCHER_HAS_WEBENGINE
QtWebEngineQuick::initialize();
#endif
QGuiApplication app(argc, argv);
QCoreApplication::setApplicationName(QStringLiteral("BiLauncher"));
QCoreApplication::setApplicationVersion(QStringLiteral(LAUNCHER_VERSION));
QCoreApplication::setOrganizationName(QStringLiteral("GaleonDev"));
QCoreApplication::setOrganizationDomain(QStringLiteral("galeonworx.com"));
#ifndef Q_OS_MACOS
QIcon appIcon;
for (int size : {16, 24, 32, 48, 64, 128, 256, 512})
appIcon.addFile(QStringLiteral(":/icons/icon_%1x%1.png").arg(size));
for (int size : {16, 32, 128, 256, 512})
appIcon.addFile(QStringLiteral(":/icons/icon_%1x%1@2x.png").arg(size));
QGuiApplication::setWindowIcon(appIcon);
#endif
QGuiApplication::setDesktopFileName(QStringLiteral("bilauncher"));
// Случайно оставленная BILAUNCHER_HOME увела бы данные в чужую папку — пусть это будет видно в логе.
if (!LauncherPaths::homeOverride().isEmpty())
qWarning().noquote() << "BILAUNCHER_HOME: данные лаунчера в" << QDir::toNativeSeparators(LauncherPaths::rootDir());
if (!Localization::instance().load())
return -1;
QQuickStyle::setStyle("Basic");
QQmlApplicationEngine engine;
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("BiLauncher", "Main");
return app.exec();
}