diff --git a/src/controller.cpp b/src/controller.cpp index 793d06043..2b8f1562a 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -541,17 +541,6 @@ void Controller::markAllMessagesAsRead(Connection *conn) } } -void Controller::setAboutData(const KAboutData &aboutData) -{ - m_aboutData = aboutData; - Q_EMIT aboutDataChanged(); -} - -KAboutData Controller::aboutData() const -{ - return m_aboutData; -} - bool Controller::supportSystemTray() const { #ifdef Q_OS_ANDROID diff --git a/src/controller.h b/src/controller.h index 067999e52..a1722944b 100644 --- a/src/controller.h +++ b/src/controller.h @@ -6,7 +6,6 @@ #include #include -#include #include #include @@ -36,7 +35,6 @@ class Controller : public QObject Q_PROPERTY(bool quitOnLastWindowClosed READ quitOnLastWindowClosed WRITE setQuitOnLastWindowClosed NOTIFY quitOnLastWindowClosedChanged) Q_PROPERTY(Quotient::Connection *activeConnection READ activeConnection WRITE setActiveConnection NOTIFY activeConnectionChanged) Q_PROPERTY(bool busy READ busy WRITE setBusy NOTIFY busyChanged) - Q_PROPERTY(KAboutData aboutData READ aboutData WRITE setAboutData NOTIFY aboutDataChanged) Q_PROPERTY(bool supportSystemTray READ supportSystemTray CONSTANT) Q_PROPERTY(bool hasWindowSystem READ hasWindowSystem CONSTANT) Q_PROPERTY(bool isOnline READ isOnline NOTIFY isOnlineChanged) @@ -67,9 +65,6 @@ public: [[nodiscard]] bool busy() const; void setBusy(bool busy); - void setAboutData(const KAboutData &aboutData); - [[nodiscard]] KAboutData aboutData() const; - [[nodiscard]] bool supportSystemTray() const; bool saveAccessTokenToFile(const Quotient::AccountSettings &account, const QByteArray &accessToken); @@ -122,7 +117,6 @@ private: bool m_isOnline = true; QMap m_notificationCounts; - KAboutData m_aboutData; bool hasWindowSystem() const; #ifdef QUOTIENT_07 void handleNotifications(); @@ -148,7 +142,6 @@ Q_SIGNALS: void quitOnLastWindowClosedChanged(); void unreadCountChanged(); void activeConnectionChanged(); - void aboutDataChanged(); void passwordStatus(Controller::PasswordStatus _t1); void userConsentRequired(QUrl url); void testConnectionResult(const QString &connection, bool usable); diff --git a/src/main.cpp b/src/main.cpp index da2cccc74..0f6358652 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -256,6 +256,9 @@ int main(int argc, char *argv[]) qRegisterMetaType>("QVector"); #endif #endif + qmlRegisterSingletonType("org.kde.neochat", 1, 0, "About", [](QQmlEngine *engine, QJSEngine *) -> QJSValue { + return engine->toScriptValue(KAboutData::applicationData()); + }); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) qRegisterMetaTypeStreamOperators(); @@ -274,8 +277,6 @@ int main(int argc, char *argv[]) parser.process(app); about.processCommandLine(&parser); - Controller::instance().setAboutData(about); - engine.addImageProvider(QLatin1String("mxc"), new MatrixImageProvider); engine.addImageProvider(QLatin1String("blurhash"), new BlurhashImageProvider); diff --git a/src/qml/Settings/About.qml b/src/qml/Settings/About.qml index 28e1145e2..7cf387d23 100644 --- a/src/qml/Settings/About.qml +++ b/src/qml/Settings/About.qml @@ -9,5 +9,5 @@ import org.kde.neochat 1.0 MobileForm.AboutPage { title: i18nc("@title:window", "About NeoChat") - aboutData: Controller.aboutData + aboutData: About }