Changeset View
Changeset View
Standalone View
Standalone View
src/main.cpp
/* | /* | ||||
* This file is part of kazv. | * This file is part of kazv. | ||||
* SPDX-FileCopyrightText: 2021-2023 tusooa <tusooa@kazv.moe> | * SPDX-FileCopyrightText: 2021-2023 tusooa <tusooa@kazv.moe> | ||||
* SPDX-License-Identifier: AGPL-3.0-or-later | * SPDX-License-Identifier: AGPL-3.0-or-later | ||||
*/ | */ | ||||
#include <kazv-defs.hpp> | #include <kazv-defs.hpp> | ||||
#include <immer/config.hpp> // https://github.com/arximboldi/immer/issues/168 | #include <immer/config.hpp> // https://github.com/arximboldi/immer/issues/168 | ||||
#include <QApplication> | #include <QApplication> | ||||
#include <QByteArray> | |||||
#include <QQmlApplicationEngine> | #include <QQmlApplicationEngine> | ||||
#include <QtQml> | #include <QtQml> | ||||
#include <QUrl> | #include <QUrl> | ||||
#include <QIcon> | #include <QIcon> | ||||
#include <QCommandLineParser> | #include <QCommandLineParser> | ||||
#include <QQuickStyle> | #include <QQuickStyle> | ||||
#include <KAboutData> | |||||
#include "meta-types.hpp" | #include "meta-types.hpp" | ||||
#include "kazv-platform.hpp" | #include "kazv-platform.hpp" | ||||
#include "kazv-path-config.hpp" | #include "kazv-path-config.hpp" | ||||
#include "kazv-version.hpp" | |||||
using namespace Qt::Literals::StringLiterals; | using namespace Qt::Literals::StringLiterals; | ||||
Q_DECL_EXPORT int main(int argc, char *argv[]) | Q_DECL_EXPORT int main(int argc, char *argv[]) | ||||
{ | { | ||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); | QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); | ||||
QApplication app(argc, argv); | QApplication app(argc, argv); | ||||
QCoreApplication::setOrganizationName(u"project-kazv"_s); | QCoreApplication::setOrganizationName(u"project-kazv"_s); | ||||
QCoreApplication::setOrganizationDomain(u"mxc.kazv.moe"_s); | QCoreApplication::setOrganizationDomain(u"mxc.kazv.moe"_s); | ||||
QCoreApplication::setApplicationName(u"kazv"_s); | QCoreApplication::setApplicationName(u"kazv"_s); | ||||
QGuiApplication::setDesktopFileName(u"moe.kazv.mxc.kazv.desktop"_s); | QGuiApplication::setDesktopFileName(u"moe.kazv.mxc.kazv.desktop"_s); | ||||
KAboutData aboutData; | |||||
aboutData | |||||
.setComponentName(u"kazv"_s) | |||||
.setVersion(QByteArray::fromStdString(kazvVersionString())) | |||||
.setOrganizationDomain(QByteArray("mxc.kazv.moe")) | |||||
.setDesktopFileName(u"moe.kazv.mxc.kazv"_s) | |||||
.setBugAddress(QByteArray("https://lily-is.land/kazv/kazv/-/issues")) | |||||
.setHomepage(u"https://kazv.chat"_s); | |||||
KAboutData::setApplicationData(aboutData); | |||||
#if KAZV_IS_WINDOWS | #if KAZV_IS_WINDOWS | ||||
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { | if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { | ||||
QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); | QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); | ||||
} | } | ||||
#endif | #endif | ||||
QQmlApplicationEngine engine; | QQmlApplicationEngine engine; | ||||
Show All 34 Lines |