From 360c9e2d623be8c8a7479d3e170114fe75dcc4c7 Mon Sep 17 00:00:00 2001 From: Alexander Kavon Date: Thu, 6 Nov 2025 01:30:43 -0500 Subject: kue a kanban todo app for kde plasma --- src/main.cpp | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/main.cpp (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..41f7fef --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,74 @@ +/* + SPDX-License-Identifier: GPL-2.0-or-later + SPDX-FileCopyrightText: 2024 Alexander Kavon +*/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "version-kue.h" +#include +#include +#include + +#include "kueconfig.h" + +using namespace Qt::Literals::StringLiterals; + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + // Default to org.kde.desktop style unless the user forces another style + if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { + QQuickStyle::setStyle(u"org.kde.desktop"_s); + } + + KLocalizedString::setApplicationDomain("kue"); + QCoreApplication::setOrganizationName(u"KDE"_s); + + KAboutData aboutData( + // The program name used internally. + u"kue"_s, + // A displayable program name string. + i18nc("@title", "Kue"), + // The program version string. + QStringLiteral(KUE_VERSION_STRING), + // Short description of what the app does. + i18n("Application Description"), + // The license this code is released under. + KAboutLicense::GPL, + // Copyright Statement. + i18n("(c) 2024")); + aboutData.addAuthor(i18nc("@info:credit", "Alexander Kavon"), + i18nc("@info:credit", "Maintainer"), + u"me+kue@alexkavon.com"_s, + u"https://yourwebsite.com"_s); + aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails")); + KAboutData::setApplicationData(aboutData); + QGuiApplication::setWindowIcon(QIcon::fromTheme(u"org.kde.kue"_s)); + + QQmlApplicationEngine engine; + + auto config = KueConfig::self(); + + qRegisterMetaType("KDescendantsProxyModel*"); + qmlRegisterSingletonInstance("org.kde.kue.private", 1, 0, "Kue", config); + + engine.rootContext()->setContextObject(new KLocalizedContext(&engine)); + engine.loadFromModule("org.kde.kue", u"Main"_s); + + if (engine.rootObjects().isEmpty()) { + return -1; + } + + return app.exec(); +} -- cgit v1.2.3