Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–220 unchanged (220 lines)
221 task: task,
222 error: error)
223 return
224 #endif
225
226 if error == .success {
227 await NCMetadataStore.shared.setDownloadCompleted(fileName: fileName, serverUrl: serverUrl, taskIdentifier: task.taskIdentifier, etag: etag)
228 } else {
229 await NCMetadataStore.shared.removeItem(fileName: fileName, serverUrl: serverUrl, taskIdentifier: task.taskIdentifier)
230
231 guard let metadata = await NCManageDatabase.shared.getMetadataAsync(predicate: NSPredicate(format: "serverUrl == %@ AND fileName == %@", serverUrl, fileName)) else {
232 return
233 }
…lines 234–326 unchanged (93 lines)

After

…lines 1–220 unchanged (220 lines)
221 task: task,
222 error: error)
223 return
224 #endif
225
226 if error == .success {
227 nkLog(success: "Downloaded file: " + fileName)
228 await NCMetadataStore.shared.setDownloadCompleted(fileName: fileName, serverUrl: serverUrl, taskIdentifier: task.taskIdentifier, etag: etag)
229 } else {
230 await NCMetadataStore.shared.removeItem(fileName: fileName, serverUrl: serverUrl, taskIdentifier: task.taskIdentifier)
231
232 guard let metadata = await NCManageDatabase.shared.getMetadataAsync(predicate: NSPredicate(format: "serverUrl == %@ AND fileName == %@", serverUrl, fileName)) else {
233 return
…lines 234–327 unchanged (94 lines)

Before

source_file
comment "// SPDX-FileCopyrightText: Nextcloud GmbH"
comment "// SPDX-FileCopyrightText: 2024 Marino Faggiana"
comment "// SPDX-License-Identifier: GPL-3.0-or-later"
import_declaration
import "import"
identifier
simple_identifier "UIKit"
import_declaration
import "import"
identifier
simple_identifier "NextcloudKit"
import_declaration
import "import"
identifier
simple_identifier "Alamofire"
import_declaration
import "import"
identifier
simple_identifier "Queuer"
import_declaration
import "import"
identifier
simple_identifier "RealmSwift"
class_declaration
extension "extension"
user_type
type_identifier "NCNetworking"
class_body
{ "{"
comment "// MARK: - Download file in foreground"
function_declaration (+1110 nodes collapsed)
comment "// MARK: - Download file in background"
function_declaration (+516 nodes collapsed)
comment "// MARK: -"
function_declaration (+555 nodes collapsed)
comment "// MARK: - Download NextcloudKitDelegate"
function_declaration
func "func"
simple_identifier "downloadComplete"
( "("
parameter
simple_identifier "fileName"
: ":"
user_type
type_identifier "String"
, ","
parameter
simple_identifier "serverUrl"
: ":"
user_type
type_identifier "String"
, ","
parameter
simple_identifier "etag"
: ":"
optional_type
user_type
type_identifier "String"
?
? "?"
, ","
parameter
simple_identifier "date"
: ":"
optional_type
user_type
type_identifier "Date"
?
? "?"
, ","
parameter
simple_identifier "dateLastModified"
: ":"
optional_type
user_type
type_identifier "Date"
?
? "?"
, ","
parameter
simple_identifier "length"
: ":"
user_type
type_identifier "Int64"
, ","
parameter
simple_identifier "task"
: ":"
user_type
type_identifier "URLSessionTask"
, ","
parameter
simple_identifier "error"
: ":"
user_type
type_identifier "NKError"
) ")"
function_body
{ "{"
statements
call_expression
simple_identifier "Task"
call_suffix
lambda_literal
{ "{"
statements
await_expression (+26 nodes collapsed)
directive
#if "#if"
simple_identifier "EXTENSION_FILE_PROVIDER_EXTENSION"
await_expression (+63 nodes collapsed)
control_transfer_statement
return "return"
directive
#endif "#endif"
if_statement
if "if"
equality_expression
simple_identifier "error"
== "=="
prefix_expression
. "."
simple_identifier "success"
{ "{"
statements
await_expression (+43 nodes collapsed)
} "}"
else "else"
{ "{"
statements (+606 nodes collapsed)
} "}"
} "}"
} "}"
function_declaration (+369 nodes collapsed)
function_declaration (+267 nodes collapsed)
} "}"

After

source_file
comment "// SPDX-FileCopyrightText: Nextcloud GmbH"
comment "// SPDX-FileCopyrightText: 2024 Marino Faggiana"
comment "// SPDX-License-Identifier: GPL-3.0-or-later"
import_declaration
import "import"
identifier
simple_identifier "UIKit"
import_declaration
import "import"
identifier
simple_identifier "NextcloudKit"
import_declaration
import "import"
identifier
simple_identifier "Alamofire"
import_declaration
import "import"
identifier
simple_identifier "Queuer"
import_declaration
import "import"
identifier
simple_identifier "RealmSwift"
class_declaration
extension "extension"
user_type
type_identifier "NCNetworking"
class_body
{ "{"
comment "// MARK: - Download file in foreground"
function_declaration (+1110 nodes collapsed)
comment "// MARK: - Download file in background"
function_declaration (+516 nodes collapsed)
comment "// MARK: -"
function_declaration (+555 nodes collapsed)
comment "// MARK: - Download NextcloudKitDelegate"
function_declaration
func "func"
simple_identifier "downloadComplete"
( "("
parameter
simple_identifier "fileName"
: ":"
user_type
type_identifier "String"
, ","
parameter
simple_identifier "serverUrl"
: ":"
user_type
type_identifier "String"
, ","
parameter
simple_identifier "etag"
: ":"
optional_type
user_type
type_identifier "String"
?
? "?"
, ","
parameter
simple_identifier "date"
: ":"
optional_type
user_type
type_identifier "Date"
?
? "?"
, ","
parameter
simple_identifier "dateLastModified"
: ":"
optional_type
user_type
type_identifier "Date"
?
? "?"
, ","
parameter
simple_identifier "length"
: ":"
user_type
type_identifier "Int64"
, ","
parameter
simple_identifier "task"
: ":"
user_type
type_identifier "URLSessionTask"
, ","
parameter
simple_identifier "error"
: ":"
user_type
type_identifier "NKError"
) ")"
function_body
{ "{"
statements
call_expression
simple_identifier "Task"
call_suffix
lambda_literal
{ "{"
statements
await_expression (+26 nodes collapsed)
directive
#if "#if"
simple_identifier "EXTENSION_FILE_PROVIDER_EXTENSION"
await_expression (+63 nodes collapsed)
control_transfer_statement
return "return"
directive
#endif "#endif"
if_statement
if "if"
equality_expression
simple_identifier "error"
== "=="
prefix_expression
. "."
simple_identifier "success"
{ "{"
statements
call_expression
simple_identifier "nkLog"
call_suffix
value_arguments
( "("
value_argument
value_argument_label
simple_identifier "success"
: ":"
additive_expression
line_string_literal
" "\""
line_str_text "Downloaded file: "
" "\""
+ "+"
simple_identifier "fileName"
) ")"
await_expression (+43 nodes collapsed)
} "}"
else "else"
{ "{"
statements (+606 nodes collapsed)
} "}"
} "}"
} "}"
function_declaration (+369 nodes collapsed)
function_declaration (+267 nodes collapsed)
} "}"