File: 0001-Fix-connections-syntax.patch

package info (click to toggle)
lomiri-filemanager-app 1.1.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,060 kB
  • sloc: cpp: 20,090; javascript: 222; python: 14; makefile: 13; sh: 7
file content (102 lines) | stat: -rw-r--r-- 3,746 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
From fe9a791cebb099d58524bbeda4e8f7f650b364bc Mon Sep 17 00:00:00 2001
From: Roker2 <dimaminko2000@gmail.com>
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(<arguments>) { ... }
```

Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 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