Use KirigamiApp
This commit is contained in:
committed by
Tobias Fella
parent
0f03290c57
commit
eab45e761a
@@ -78,7 +78,7 @@ set_package_properties(KF6Kirigami PROPERTIES
|
|||||||
TYPE REQUIRED
|
TYPE REQUIRED
|
||||||
PURPOSE "Kirigami application UI framework"
|
PURPOSE "Kirigami application UI framework"
|
||||||
)
|
)
|
||||||
find_package(KF6KirigamiAddons 1.6.0 REQUIRED)
|
find_package(KF6KirigamiAddons 1.10.0 REQUIRED)
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT NEOCHAT_FLATPAK AND NOT NEOCHAT_APPIMAGE)
|
if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT NEOCHAT_FLATPAK AND NOT NEOCHAT_APPIMAGE)
|
||||||
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Purpose)
|
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Purpose)
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ target_link_libraries(neochat PUBLIC
|
|||||||
KF6::IconThemes
|
KF6::IconThemes
|
||||||
KF6::ItemModels
|
KF6::ItemModels
|
||||||
KF6::I18nQml
|
KF6::I18nQml
|
||||||
|
KirigamiApp
|
||||||
QuotientQt6
|
QuotientQt6
|
||||||
Login
|
Login
|
||||||
Rooms
|
Rooms
|
||||||
|
|||||||
@@ -33,13 +33,10 @@
|
|||||||
#include <KWindowSystem>
|
#include <KWindowSystem>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __has_include("KCrash")
|
|
||||||
#include <KCrash>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <KIconTheme>
|
#include <KIconTheme>
|
||||||
#include <KLocalizedQmlContext>
|
#include <KLocalizedQmlContext>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
#include <KirigamiApp>
|
||||||
|
|
||||||
#include "neochat-version.h"
|
#include "neochat-version.h"
|
||||||
|
|
||||||
@@ -104,7 +101,6 @@ Q_DECL_EXPORT
|
|||||||
#endif
|
#endif
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
KIconTheme::initTheme();
|
|
||||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||||
|
|
||||||
#ifdef HAVE_WEBVIEW
|
#ifdef HAVE_WEBVIEW
|
||||||
@@ -113,24 +109,10 @@ int main(int argc, char *argv[])
|
|||||||
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
|
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
KirigamiApp::App app(argc, argv);
|
||||||
QGuiApplication app(argc, argv);
|
KirigamiApp kirigamiApp;
|
||||||
QQuickStyle::setStyle(u"org.kde.breeze"_s);
|
|
||||||
#else
|
|
||||||
QIcon::setFallbackThemeName("breeze"_L1);
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Q_OS_WINDOWS
|
#ifdef Q_OS_WINDOWS
|
||||||
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
|
|
||||||
freopen("CONOUT$", "w", stdout);
|
|
||||||
freopen("CONOUT$", "w", stderr);
|
|
||||||
}
|
|
||||||
|
|
||||||
QApplication::setStyle(u"breeze"_s);
|
QApplication::setStyle(u"breeze"_s);
|
||||||
QFont font(u"Segoe UI Emoji"_s);
|
QFont font(u"Segoe UI Emoji"_s);
|
||||||
font.setPointSize(10);
|
font.setPointSize(10);
|
||||||
@@ -177,10 +159,6 @@ int main(int argc, char *argv[])
|
|||||||
KAboutData::setApplicationData(about);
|
KAboutData::setApplicationData(about);
|
||||||
QGuiApplication::setWindowIcon(QIcon::fromTheme(u"org.kde.neochat"_s));
|
QGuiApplication::setWindowIcon(QIcon::fromTheme(u"org.kde.neochat"_s));
|
||||||
|
|
||||||
#if __has_include("KCrash")
|
|
||||||
KCrash::initialize();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Connection::setEncryptionDefault(true);
|
Connection::setEncryptionDefault(true);
|
||||||
Connection::setDirectChatEncryptionDefault(true);
|
Connection::setDirectChatEncryptionDefault(true);
|
||||||
|
|
||||||
@@ -300,7 +278,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
engine.addImageProvider(u"blurhash"_s, new BlurhashImageProvider);
|
engine.addImageProvider(u"blurhash"_s, new BlurhashImageProvider);
|
||||||
|
|
||||||
engine.loadFromModule("org.kde.neochat", "Main");
|
if (!kirigamiApp.start("org.kde.neochat", "Main", &engine)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!parser.positionalArguments().isEmpty() && !parser.isSet("share"_L1)) {
|
if (!parser.positionalArguments().isEmpty() && !parser.isSet("share"_L1)) {
|
||||||
RoomManager::instance().setUrlArgument(parser.positionalArguments()[0]);
|
RoomManager::instance().setUrlArgument(parser.positionalArguments()[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user