Skip to content

Commit d02f395

Browse files
committed
Update for 4D 21 LTS: enable Direct typing, add missing class property declarations. This showed 2 - so far undetected - bugs, for FTP Active Mode, setting the port could fail (bad property name), terminating the worker failed (wrong function name). Proves the advantages of direct typing...
1 parent 4c16cd8 commit d02f395

9 files changed

Lines changed: 59 additions & 6 deletions

File tree

Project/Sources/Classes/FileTransfer_Dropbox.4dm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
property onData : Object
22
property _return; _Path : Text
33
property _timeout : Integer
4+
property _Callback : 4D:C1709.Function
5+
property _CallbackID : Text
6+
property _worker : 4D:C1709.SystemWorker
7+
property _enableStopButton : Object // shared
8+
property _async : Boolean
9+
property _noProgress : Boolean
410

511
Class constructor()
612
This:C1470.onData:=New object:C1471("text"; "")
@@ -235,7 +241,7 @@ Function _runWorker($para : Text)->$result : Object
235241
End if
236242
// dbxcli seems not to terminate directly,progress bar could be open too long
237243
If (This:C1470._Callback#Null:C1517)
238-
This:C1470._worker.onTerminate(New object:C1471; New object:C1471)
244+
This:C1470._worker.terminate()
239245
End if
240246
Else
241247
$result:=New object:C1471("success"; False:C215; "responseError"; "dbxcli execution error")

Project/Sources/Classes/FileTransfer_GDrive.4dm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
property onData : Object
2-
property _Path; _workerpath : Text
2+
property _Path; _return; _workerpath : Text
33
property _timeout : Integer
4+
property _Callback : 4D:C1709.Function
5+
property _worker : 4D:C1709.SystemWorker
6+
property _CallbackID : Text
7+
property _enableStopButton : Object
8+
property _async : Boolean
9+
property _noProgress : Boolean
410

511
Class constructor()
612
var $path : Text
@@ -457,7 +463,7 @@ Function _runWorker($para : Text)->$result : Object
457463
$result:=New object:C1471("success"; False:C215; "responseError"; "gdrive execution error")
458464
End if
459465
If (This:C1470._Callback#Null:C1517)
460-
This:C1470._worker.onTerminate(New object:C1471; New object:C1471)
466+
This:C1470._worker.terminate()
461467
End if
462468
This:C1470._worker:=Null:C1517
463469
ON ERR CALL:C155($old)

Project/Sources/Classes/FileTransfer_curl.4dm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
property _host; _user; _password; _protocol; _return; _range; _prefix; _curlPath : Text
22
property onData : Object
3+
property _ActiveModeIP : Text
34
property _noProgress; _AutoCreateRemoteDir; _AutoCreateLocalDir; _async : Boolean
45
property _timeout; _connectTimeout; _maxTime : Integer
56
property _Callback : 4D:C1709.Function
67
property _enableStopButton : Object
8+
property _CallbackID : Text
9+
property _ActiveMode : Boolean
10+
property _worker : 4D:C1709.SystemWorker
711

812
Class constructor($hostname : Text; $username : Text; $password : Text; $protocol : Text)
913
var $col : Collection
@@ -377,7 +381,7 @@ Function _runWorker($para : Text)->$result : Object
377381
$path+=" --range "+This:C1470._range
378382
End if
379383
If ((This:C1470._ActiveMode#Null:C1517) && (This:C1470._ActiveMode)) // default passive
380-
$path+=" --ftp-port "+This:C1470.ActiveModeIP
384+
$path+=" --ftp-port "+This:C1470._ActiveModeIP
381385
End if
382386
If (This:C1470._prefix#Null:C1517)
383387
$path+=(" "+This:C1470._prefix)

Project/Sources/Classes/FileTransfer_rclone.4dm

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
property onData : Object
2+
property config : Text
3+
4+
property _return : Text
5+
property _Path : Text
6+
property _timeout : Integer
7+
property _Callback : 4D:C1709.Function
8+
property _maxTime : Real
9+
property _async : Boolean
10+
property _prefix : Text
11+
property _enableStopButton : Object
12+
property _noProgress : Boolean
13+
property _worker : 4D:C1709.SystemWorker
14+
property _CallbackID : Text
15+
116
Class constructor($configname : Text)
217
This:C1470.onData:=New object:C1471("text"; "")
318
If (Is macOS:C1572)

Project/Sources/Classes/SystemWorkerProperties.4dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ property type; encoding; dataType; callbackID; _return : Text
22
property hideWindow : Boolean
33
property callback : 4D:C1709.Function
44
property data; stopbutton; SharedForProgressBar : Object
5+
property currentDirectory : 4D:C1709.Folder
56

67
Class constructor($type : Text; $data : Object; $callback : 4D:C1709.Function; $callbackID : Text; $stopButton : Object)
78
This:C1470.type:=$type

Project/Sources/Classes/_Build.4dm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
property _SettingsUsed : Text
2+
property _Source : Text
3+
14
Class constructor
25
This:C1470._SettingsUsed:=""
36
This:C1470._Source:=""

Project/Sources/dependencies.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": 2100,
3+
"dependencies": {
4+
"4D Progress": {
5+
"github": "4d/4D-Progress",
6+
"version": "4d"
7+
}
8+
}
9+
}

Project/Sources/settings.4DSettings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<?xml version="1.0" encoding="UTF-8"?><preferences stamp="5">
1+
<?xml version="1.0" encoding="UTF-8"?><preferences stamp="6">
22
<com.4d>
33
<compiler>
4-
<options compilation_path="3" syntax_file="true" target="all"/>
4+
<options compilation_path="4" syntax_file="true" target="all"/>
55
</compiler>
66
<general component_classStore_name="FileTransfer"/>
77
<server>

Resources/en.lproj/syntaxEN.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@
146146
],
147147
"Summary": ""
148148
},
149+
"currentDirectory": {
150+
"Syntax": "currentDirectory : 4D.Folder"
151+
},
149152
"data": {
150153
"Syntax": "data : Object"
151154
},
@@ -1571,6 +1574,12 @@
15711574
]
15721575
],
15731576
"Summary": ""
1577+
},
1578+
"onData": {
1579+
"Syntax": "onData : Object"
1580+
},
1581+
"config": {
1582+
"Syntax": "config : Text"
15741583
}
15751584
},
15761585
"_Build": {

0 commit comments

Comments
 (0)