From fe9a791cebb099d58524bbeda4e8f7f650b364bc Mon Sep 17 00:00:00 2001 From: Roker2 Date: Thu, 28 Nov 2024 17:53:33 +0100 Subject: [PATCH] Fix connections syntax ``` QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo() { ... } ``` Signed-off-by: Mike Gabriel --- src/app/qml/components/PathHistoryRow.qml | 4 +++- .../qml/dialogs/FileOperationProgressDialog.qml | 4 ++-- src/app/qml/filemanager.qml | 14 ++++++++++---- src/app/qml/ui/FolderListPage.qml | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/qml/components/PathHistoryRow.qml b/src/app/qml/components/PathHistoryRow.qml index 89e0623d..b05dc610 100644 --- a/src/app/qml/components/PathHistoryRow.qml +++ b/src/app/qml/components/PathHistoryRow.qml @@ -165,7 +165,9 @@ ListView { Component.onCompleted: internal.updateModel() Connections { target: folderModel - onPathChanged: internal.updateModel() + function onPathChanged(newPath) { + internal.updateModel() + } } /* diff --git a/src/app/qml/dialogs/FileOperationProgressDialog.qml b/src/app/qml/dialogs/FileOperationProgressDialog.qml index 9f5ce48a..94f2190c 100644 --- a/src/app/qml/dialogs/FileOperationProgressDialog.qml +++ b/src/app/qml/dialogs/FileOperationProgressDialog.qml @@ -51,7 +51,7 @@ Dialog { Connections { target: model - onProgress: { + function onProgress(curItem, totalItems, percent) { // curItem == 0 && percent == 0 means the Action has just been created, check getProgressCounter() before if (curItem == 0 && percent == 0) { console.log("Creating dialog:", model.getProgressCounter()) @@ -79,7 +79,7 @@ Dialog { // Errors from model Connections { target: model - onError: { + function onError(errorTitle, errorMessage) { PopupUtils.close(root) } } diff --git a/src/app/qml/filemanager.qml b/src/app/qml/filemanager.qml index ba2b0efd..919fe677 100644 --- a/src/app/qml/filemanager.qml +++ b/src/app/qml/filemanager.qml @@ -162,9 +162,15 @@ MainView { Connections { target: ContentHub - onExportRequested: startTransfer(transfer, false) - onImportRequested: startTransfer(transfer, true) - onShareRequested: startTransfer(transfer, true) + function onExportRequested(transfer) { + startTransfer(transfer, false) + } + function onImportRequested(transfer) { + startTransfer(transfer, true) + } + function onShareRequested(transfer) { + startTransfer(transfer, true) + } } PageStack { @@ -239,7 +245,7 @@ MainView { Connections { target: UriHandler - onOpened: { + function onOpened(uris) { console.log('Open from UriHandler') const url = getUrl(uris) if (url) { diff --git a/src/app/qml/ui/FolderListPage.qml b/src/app/qml/ui/FolderListPage.qml index b21e762d..6bfb779a 100644 --- a/src/app/qml/ui/FolderListPage.qml +++ b/src/app/qml/ui/FolderListPage.qml @@ -318,7 +318,7 @@ SidebarPageLayout { // Errors from model Connections { target: pageModel.model - onError: { + function onError(errorTitle, errorMessage) { console.log("FolderListModel Error Title/Description", errorTitle, errorMessage) error(i18n.tr("File operation error"), errorTitle + ": " + errorMessage) } -- 2.39.5