| 1 |
From fe9a791cebb099d58524bbeda4e8f7f650b364bc Mon Sep 17 00:00:00 2001 |
| 2 |
From: Roker2 <[email protected]> |
| 3 |
Date: Thu, 28 Nov 2024 17:53:33 +0100 |
| 4 |
Subject: [PATCH] Fix connections syntax |
| 5 |
|
| 6 |
``` |
| 7 |
QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... } |
| 8 |
``` |
| 9 |
|
| 10 |
Signed-off-by: Mike Gabriel <[email protected]> |
| 11 |
--- |
| 12 |
src/app/qml/components/PathHistoryRow.qml | 4 +++- |
| 13 |
.../qml/dialogs/FileOperationProgressDialog.qml | 4 ++-- |
| 14 |
src/app/qml/filemanager.qml | 14 ++++++++++---- |
| 15 |
src/app/qml/ui/FolderListPage.qml | 2 +- |
| 16 |
4 files changed, 16 insertions(+), 8 deletions(-) |
| 17 |
|
| 18 |
diff --git a/src/app/qml/components/PathHistoryRow.qml b/src/app/qml/components/PathHistoryRow.qml |
| 19 |
index 89e0623d..b05dc610 100644 |
| 20 |
--- a/src/app/qml/components/PathHistoryRow.qml |
| 21 |
+++ b/src/app/qml/components/PathHistoryRow.qml |
| 22 |
@@ -165,7 +165,9 @@ ListView { |
| 23 |
Component.onCompleted: internal.updateModel() |
| 24 |
Connections { |
| 25 |
target: folderModel |
| 26 |
- onPathChanged: internal.updateModel() |
| 27 |
+ function onPathChanged(newPath) { |
| 28 |
+ internal.updateModel() |
| 29 |
+ } |
| 30 |
} |
| 31 |
|
| 32 |
/* |
| 33 |
diff --git a/src/app/qml/dialogs/FileOperationProgressDialog.qml b/src/app/qml/dialogs/FileOperationProgressDialog.qml |
| 34 |
index 9f5ce48a..94f2190c 100644 |
| 35 |
--- a/src/app/qml/dialogs/FileOperationProgressDialog.qml |
| 36 |
+++ b/src/app/qml/dialogs/FileOperationProgressDialog.qml |
| 37 |
@@ -51,7 +51,7 @@ Dialog { |
| 38 |
|
| 39 |
Connections { |
| 40 |
target: model |
| 41 |
- onProgress: { |
| 42 |
+ function onProgress(curItem, totalItems, percent) { |
| 43 |
// curItem == 0 && percent == 0 means the Action has just been created, check getProgressCounter() before |
| 44 |
if (curItem == 0 && percent == 0) { |
| 45 |
console.log("Creating dialog:", model.getProgressCounter()) |
| 46 |
@@ -79,7 +79,7 @@ Dialog { |
| 47 |
// Errors from model |
| 48 |
Connections { |
| 49 |
target: model |
| 50 |
- onError: { |
| 51 |
+ function onError(errorTitle, errorMessage) { |
| 52 |
PopupUtils.close(root) |
| 53 |
} |
| 54 |
} |
| 55 |
diff --git a/src/app/qml/filemanager.qml b/src/app/qml/filemanager.qml |
| 56 |
index ba2b0efd..919fe677 100644 |
| 57 |
--- a/src/app/qml/filemanager.qml |
| 58 |
+++ b/src/app/qml/filemanager.qml |
| 59 |
@@ -162,9 +162,15 @@ MainView { |
| 60 |
|
| 61 |
Connections { |
| 62 |
target: ContentHub |
| 63 |
- onExportRequested: startTransfer(transfer, false) |
| 64 |
- onImportRequested: startTransfer(transfer, true) |
| 65 |
- onShareRequested: startTransfer(transfer, true) |
| 66 |
+ function onExportRequested(transfer) { |
| 67 |
+ startTransfer(transfer, false) |
| 68 |
+ } |
| 69 |
+ function onImportRequested(transfer) { |
| 70 |
+ startTransfer(transfer, true) |
| 71 |
+ } |
| 72 |
+ function onShareRequested(transfer) { |
| 73 |
+ startTransfer(transfer, true) |
| 74 |
+ } |
| 75 |
} |
| 76 |
|
| 77 |
PageStack { |
| 78 |
@@ -239,7 +245,7 @@ MainView { |
| 79 |
|
| 80 |
Connections { |
| 81 |
target: UriHandler |
| 82 |
- onOpened: { |
| 83 |
+ function onOpened(uris) { |
| 84 |
console.log('Open from UriHandler') |
| 85 |
const url = getUrl(uris) |
| 86 |
if (url) { |
| 87 |
diff --git a/src/app/qml/ui/FolderListPage.qml b/src/app/qml/ui/FolderListPage.qml |
| 88 |
index b21e762d..6bfb779a 100644 |
| 89 |
--- a/src/app/qml/ui/FolderListPage.qml |
| 90 |
+++ b/src/app/qml/ui/FolderListPage.qml |
| 91 |
@@ -318,7 +318,7 @@ SidebarPageLayout { |
| 92 |
// Errors from model |
| 93 |
Connections { |
| 94 |
target: pageModel.model |
| 95 |
- onError: { |
| 96 |
+ function onError(errorTitle, errorMessage) { |
| 97 |
console.log("FolderListModel Error Title/Description", errorTitle, errorMessage) |
| 98 |
error(i18n.tr("File operation error"), errorTitle + ": " + errorMessage) |
| 99 |
} |
| 100 |
-- |
| 101 |
2.39.5 |
| 102 |
|