diff --git a/src/controller.cpp b/src/controller.cpp index a757ee78e..b6f78708c 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -338,11 +338,6 @@ void Controller::setActiveConnection(NeoChatConnection *connection) Q_EMIT activeConnectionChanged(); } -void Controller::saveWindowGeometry() -{ - WindowController::instance().saveGeometry(); -} - void Controller::forceRefreshTextDocument(QQuickTextDocument *textDocument, QQuickItem *item) { // HACK: Workaround bug QTBUG 93281 diff --git a/src/controller.h b/src/controller.h index 1082b5abe..dc3500fa8 100644 --- a/src/controller.h +++ b/src/controller.h @@ -136,7 +136,4 @@ Q_SIGNALS: void activeConnectionChanged(); void userConsentRequired(QUrl url); void accountsLoadingChanged(); - -public Q_SLOTS: - void saveWindowGeometry(); }; diff --git a/src/qml/main.qml b/src/qml/main.qml index d820a4274..577e69089 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -86,7 +86,7 @@ Kirigami.ApplicationWindow { Timer { id: saveWindowGeometryTimer interval: 1000 - onTriggered: Controller.saveWindowGeometry() + onTriggered: WindowController.saveGeometry() } Connections { @@ -94,7 +94,7 @@ Kirigami.ApplicationWindow { enabled: false // Disable on startup to avoid writing wrong values if the window is hidden target: root - function onClosing() { Controller.saveWindowGeometry(); } + function onClosing() { WindowController.saveGeometry(); } function onWidthChanged() { saveWindowGeometryTimer.restart(); } function onHeightChanged() { saveWindowGeometryTimer.restart(); } function onXChanged() { saveWindowGeometryTimer.restart(); } diff --git a/src/windowcontroller.h b/src/windowcontroller.h index 564af930b..237104aa2 100644 --- a/src/windowcontroller.h +++ b/src/windowcontroller.h @@ -52,7 +52,7 @@ public: /** * @brief Save the current window geometry. */ - void saveGeometry(); + Q_INVOKABLE void saveGeometry(); /** * @brief Show the window and raise to the top.