Skip to content

Commit 504f291

Browse files
Version 5.2.3 (#2857)
1 parent 09dd9a1 commit 504f291

File tree

81 files changed

+1403
-1075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1403
-1075
lines changed

Nextcloud.xcodeproj/project.pbxproj

Lines changed: 43 additions & 44 deletions
Large diffs are not rendered by default.

iOSClient/Account Request/NCAccountRequest.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,19 @@ class NCAccountRequest: UIViewController {
7777
NotificationCenter.default.addObserver(self, selector: #selector(applicationDidEnterBackground), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterApplicationDidEnterBackground), object: nil)
7878
}
7979

80-
override func viewWillAppear(_ animated: Bool) {
81-
super.viewWillAppear(animated)
82-
}
83-
8480
override func viewDidAppear(_ animated: Bool) {
8581
super.viewDidAppear(animated)
8682

8783
let visibleCells = tableView.visibleCells
8884
var numAccounts = accounts.count
8985
if enableAddAccount { numAccounts += 1 }
90-
9186
if visibleCells.count == numAccounts {
9287
tableView.isScrollEnabled = false
9388
}
9489
}
9590

96-
override func viewWillDisappear(_ animated: Bool) {
97-
super.viewWillDisappear(animated)
91+
override func viewDidDisappear(_ animated: Bool) {
92+
super.viewDidDisappear(animated)
9893

9994
timer?.invalidate()
10095
}
@@ -141,7 +136,6 @@ extension NCAccountRequest: UITableViewDelegate {
141136
progressView.progress = 0
142137
}
143138

144-
145139
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
146140
return heightCell
147141
}

iOSClient/Account Request/NCShareAccounts.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,10 @@ class NCShareAccounts: UIViewController {
5858
tableView.backgroundColor = .secondarySystemBackground
5959
}
6060

61-
override func viewWillAppear(_ animated: Bool) {
62-
super.viewWillAppear(animated)
63-
}
64-
6561
override func viewDidAppear(_ animated: Bool) {
6662
super.viewDidAppear(animated)
6763

6864
let visibleCells = tableView.visibleCells
69-
7065
if visibleCells.count == accounts.count {
7166
tableView.isScrollEnabled = false
7267
}

iOSClient/Activity/NCActivity.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,13 @@ class NCActivity: UIViewController, NCSharePagingContent {
9898
override func viewWillAppear(_ animated: Bool) {
9999
super.viewWillAppear(animated)
100100

101-
appDelegate.activeViewController = self
102-
103101
navigationController?.setNavigationBarAppearance()
104-
105102
fetchAll(isInitial: true)
106103
}
107104

108-
override func viewWillDisappear(_ animated: Bool) {
109-
super.viewWillDisappear(animated)
105+
override func viewDidAppear(_ animated: Bool) {
106+
super.viewDidAppear(animated)
107+
appDelegate.activeViewController = self
110108
}
111109

112110
override func viewWillLayoutSubviews() {

iOSClient/Activity/NCActivityTableViewCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ extension NCActivityTableViewCell: UICollectionViewDelegate {
111111
if let viewController = UIStoryboard(name: "NCTrash", bundle: nil).instantiateInitialViewController() as? NCTrash {
112112
if let result = NCManageDatabase.shared.getTrashItem(fileId: String(activityPreview.fileId), account: activityPreview.account) {
113113
viewController.blinkFileId = result.fileId
114-
viewController.trashPath = result.filePath
114+
viewController.filePath = result.filePath
115115
(responder as? UIViewController)!.navigationController?.pushViewController(viewController, animated: true)
116116
} else {
117117
let error = NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: "_trash_file_not_found_")

iOSClient/AppDelegate.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
106106
}
107107

108108
if let account = NCManageDatabase.shared.getActiveAccount() {
109-
NextcloudKit.shared.nkCommonInstance.writeLog("Account active \(account.account)")
109+
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Account active \(account.account)")
110110
if NCKeychain().getPassword(account: account.account).isEmpty {
111111
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] PASSWORD NOT FOUND for \(account.account)")
112112
}
@@ -250,14 +250,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
250250
let activeAccount = NCManageDatabase.shared.getActiveAccount()
251251

252252
if let autoUpload = activeAccount?.autoUpload, autoUpload {
253-
NextcloudKit.shared.nkCommonInstance.writeLog("- Auto upload: true")
253+
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Auto upload: true")
254254
if UIApplication.shared.backgroundRefreshStatus == .available {
255-
NextcloudKit.shared.nkCommonInstance.writeLog("- Auto upload in background: true")
255+
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Auto upload in background: true")
256256
} else {
257-
NextcloudKit.shared.nkCommonInstance.writeLog("- Auto upload in background: false")
257+
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Auto upload in background: false")
258258
}
259259
} else {
260-
NextcloudKit.shared.nkCommonInstance.writeLog("- Auto upload: false")
260+
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Auto upload: false")
261261
}
262262

263263
if let error = updateShareAccounts() {
@@ -287,7 +287,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
287287
notificationCenter.add(req)
288288
}
289289

290-
NextcloudKit.shared.nkCommonInstance.writeLog("bye bye")
290+
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] bye bye")
291291
}
292292

293293
// MARK: - Background Task
@@ -302,7 +302,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
302302
request.earliestBeginDate = Date(timeIntervalSinceNow: 60) // Refresh after 60 seconds.
303303
do {
304304
try BGTaskScheduler.shared.submit(request)
305-
NextcloudKit.shared.nkCommonInstance.writeLog("- Refresh task: ok")
305+
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Refresh task: ok")
306306
} catch {
307307
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Refresh task failed to submit request: \(error)")
308308
}
@@ -320,7 +320,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
320320
request.requiresExternalPower = false
321321
do {
322322
try BGTaskScheduler.shared.submit(request)
323-
NextcloudKit.shared.nkCommonInstance.writeLog("- Processing task: ok")
323+
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Processing task: ok")
324324
} catch {
325325
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Background Processing task failed to submit request: \(error)")
326326
}

iOSClient/AudioRecorder/NCAudioRecorderViewController.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,6 @@ class NCAudioRecorderViewController: UIViewController, NCAudioRecorderDelegate {
6666
}
6767
}
6868

69-
override func viewWillAppear(_ animated: Bool) {
70-
super.viewWillAppear(animated)
71-
}
72-
73-
override func viewDidAppear(_ animated: Bool) {
74-
super.viewDidAppear(animated)
75-
}
76-
77-
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
78-
super.traitCollectionDidChange(previousTraitCollection)
79-
}
80-
8169
// MARK: - Action
8270

8371
@IBAction func touchViewController() {

iOSClient/Data/NCManageDatabase+Account.swift

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ extension NCManageDatabase {
115115
realm.add(addObject, update: .all)
116116
}
117117
} catch let error {
118-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
118+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
119119
}
120120
}
121121

@@ -127,7 +127,7 @@ extension NCManageDatabase {
127127
realm.add(account, update: .all)
128128
}
129129
} catch let error {
130-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
130+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
131131
}
132132
}
133133

@@ -140,7 +140,7 @@ extension NCManageDatabase {
140140
realm.delete(result)
141141
}
142142
} catch let error {
143-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
143+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
144144
}
145145
}
146146

@@ -152,7 +152,7 @@ extension NCManageDatabase {
152152
guard let result = realm.objects(tableAccount.self).filter("active == true").first else { return nil }
153153
return tableAccount.init(value: result)
154154
} catch let error as NSError {
155-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
155+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
156156
}
157157

158158
return nil
@@ -168,7 +168,7 @@ extension NCManageDatabase {
168168
return Array(results.map { $0.account })
169169
}
170170
} catch let error as NSError {
171-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
171+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
172172
}
173173

174174
return nil
@@ -182,7 +182,7 @@ extension NCManageDatabase {
182182
guard let result = realm.objects(tableAccount.self).filter(predicate).first else { return nil }
183183
return tableAccount.init(value: result)
184184
} catch let error as NSError {
185-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
185+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
186186
}
187187

188188
return nil
@@ -197,7 +197,7 @@ extension NCManageDatabase {
197197
let results = realm.objects(tableAccount.self).sorted(by: sorted)
198198
return Array(results.map { tableAccount.init(value: $0) })
199199
} catch let error as NSError {
200-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
200+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
201201
}
202202

203203
return []
@@ -212,7 +212,7 @@ extension NCManageDatabase {
212212
let results = realm.objects(tableAccount.self).sorted(by: sorted)
213213
return Array(results.map { tableAccount.init(value: $0) })
214214
} catch let error as NSError {
215-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
215+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
216216
}
217217

218218
return []
@@ -230,7 +230,7 @@ extension NCManageDatabase {
230230
return result.autoUploadFileName
231231
}
232232
} catch let error as NSError {
233-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
233+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
234234
}
235235

236236
return ""
@@ -253,7 +253,7 @@ extension NCManageDatabase {
253253
}
254254
}
255255
} catch let error as NSError {
256-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
256+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
257257
}
258258

259259
return ""
@@ -276,7 +276,7 @@ extension NCManageDatabase {
276276
guard let result = realm.objects(tableAccount.self).filter("active == true").first else { return NCGlobal.shared.subfolderGranularityMonthly }
277277
return result.autoUploadSubfolderGranularity
278278
} catch let error as NSError {
279-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
279+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
280280
}
281281

282282
return NCGlobal.shared.subfolderGranularityMonthly
@@ -300,7 +300,7 @@ extension NCManageDatabase {
300300
}
301301
}
302302
} catch let error {
303-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
303+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
304304
return nil
305305
}
306306

@@ -317,7 +317,7 @@ extension NCManageDatabase {
317317
}
318318
}
319319
} catch let error {
320-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
320+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
321321
}
322322
}
323323

@@ -333,7 +333,7 @@ extension NCManageDatabase {
333333
}
334334
}
335335
} catch let error {
336-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
336+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
337337
}
338338
}
339339

@@ -347,7 +347,7 @@ extension NCManageDatabase {
347347
}
348348
}
349349
} catch let error {
350-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
350+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
351351
}
352352
}
353353

@@ -365,7 +365,7 @@ extension NCManageDatabase {
365365
}
366366
}
367367
} catch let error {
368-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
368+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
369369
}
370370
}
371371

@@ -383,7 +383,7 @@ extension NCManageDatabase {
383383
}
384384
}
385385
} catch let error {
386-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
386+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
387387
}
388388
}
389389

@@ -419,7 +419,7 @@ extension NCManageDatabase {
419419
}
420420
}
421421
} catch let error {
422-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
422+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
423423
}
424424
}
425425

@@ -433,7 +433,7 @@ extension NCManageDatabase {
433433
}
434434
}
435435
} catch let error {
436-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
436+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
437437
}
438438
}
439439

@@ -453,7 +453,7 @@ extension NCManageDatabase {
453453
}
454454
}
455455
} catch let error {
456-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
456+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
457457
}
458458
}
459459

@@ -473,7 +473,7 @@ extension NCManageDatabase {
473473
}
474474
}
475475
} catch let error {
476-
NextcloudKit.shared.nkCommonInstance.writeLog("Could not write to database: \(error)")
476+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
477477
}
478478
}
479479
}

0 commit comments

Comments
 (0)