Skip to content

Commit a4d6eb9

Browse files
author
Marino Faggiana
authored
Version 6.2.4 (#3290)
1 parent fe920b4 commit a4d6eb9

File tree

168 files changed

+1267
-938
lines changed

Some content is hidden

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

168 files changed

+1267
-938
lines changed

Brand/Database.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ import Foundation
2626
// Database Realm
2727
//
2828
let databaseName = "nextcloud.realm"
29-
let databaseSchemaVersion: UInt64 = 370
29+
let databaseSchemaVersion: UInt64 = 371

Brand/NCBrand.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ let userAgent: String = {
4242
var pushNotificationServerProxy: String = "https://push-notifications.nextcloud.com"
4343
var linkLoginHost: String = "https://nextcloud.com/install"
4444
var linkloginPreferredProviders: String = "https://nextcloud.com/signup-ios"
45-
var webLoginAutenticationProtocol: String = "nc://" // example "abc://"
45+
var webLoginAutenticationProtocol: String = "nc://" // example "abc://"
4646
var privacy: String = "https://nextcloud.com/privacy"
4747
var sourceCode: String = "https://github.com/nextcloud/ios"
4848
var mobileconfig: String = "/remote.php/dav/provisioning/apple-provisioning.mobileconfig"
@@ -65,7 +65,7 @@ let userAgent: String = {
6565
var disable_request_login_url: Bool = false
6666
var disable_multiaccount: Bool = false
6767
var disable_more_external_site: Bool = false
68-
var disable_openin_file: Bool = false // Don't touch me !!
68+
var disable_openin_file: Bool = false // Don't touch me !!
6969
var disable_crash_service: Bool = false
7070
var disable_log: Bool = false
7171
var disable_mobileconfig: Bool = false
@@ -79,11 +79,12 @@ let userAgent: String = {
7979
var enforce_servers: [(name: String, url: String)] = []
8080

8181
// Internal option behaviour
82-
var cleanUpDay: Int = 0 // Set default "Delete all cached files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365
82+
var cleanUpDay: Int = 0 // Set default "Delete all cached files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365
8383

84-
// Max download/upload concurrent
85-
let maxConcurrentOperationDownload: Int = 5
86-
let maxConcurrentOperationUpload: Int = 5
84+
// Max request/download/upload concurrent
85+
let httpMaximumConnectionsPerHost: Int = 6
86+
let httpMaximumConnectionsPerHostInDownload: Int = 6
87+
let httpMaximumConnectionsPerHostInUpload: Int = 6
8788

8889
// Number of failed attempts after reset app
8990
let resetAppPasscodeAttempts: Int = 10

File Provider Extension/FileProviderData.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ class fileProviderData: NSObject {
111111
password: NCKeychain().getPassword(account: tblAccount.account),
112112
userAgent: userAgent,
113113
nextcloudVersion: NCCapabilities.shared.getCapabilities(account: tblAccount.account).capabilityServerVersionMajor,
114+
httpMaximumConnectionsPerHost: NCBrandOptions.shared.httpMaximumConnectionsPerHost,
115+
httpMaximumConnectionsPerHostInDownload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInDownload,
116+
httpMaximumConnectionsPerHostInUpload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInUpload,
114117
groupIdentifier: NCBrandOptions.shared.capabilitiesGroup)
115118
NCNetworking.shared.delegate = providerExtension as? NCNetworkingDelegate
116119

Nextcloud.xcodeproj/project.pbxproj

Lines changed: 38 additions & 5 deletions
Large diffs are not rendered by default.

Share/NCShareExtension+Files.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ extension NCShareExtension {
3030
@objc func reloadDatasource(withLoadFolder: Bool) {
3131
let layoutForView = NCManageDatabase.shared.getLayoutForView(account: session.account, key: keyLayout, serverUrl: serverUrl) ?? NCDBLayoutForView()
3232
let predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND directory == true", session.account, serverUrl)
33-
let metadatas = self.database.getResultsMetadatasPredicate(predicate, layoutForView: layoutForView)
33+
let directoryOnTop = NCKeychain().getDirectoryOnTop(account: session.account)
34+
let metadatas = self.database.getResultsMetadatasPredicate(predicate, layoutForView: layoutForView, directoryOnTop: directoryOnTop)
3435

35-
self.dataSource = NCCollectionViewDataSource(metadatas: metadatas)
36+
self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, directoryOnTop: directoryOnTop)
3637

3738
if withLoadFolder {
3839
loadFolder()

Share/NCShareExtension+NCAccountRequestDelegate.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ extension NCShareExtension: NCAccountRequestDelegate {
8181
password: NCKeychain().getPassword(account: tableAccount.account),
8282
userAgent: userAgent,
8383
nextcloudVersion: capabilities.capabilityServerVersionMajor,
84+
httpMaximumConnectionsPerHost: NCBrandOptions.shared.httpMaximumConnectionsPerHost,
85+
httpMaximumConnectionsPerHostInDownload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInDownload,
86+
httpMaximumConnectionsPerHostInUpload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInUpload,
8487
groupIdentifier: NCBrandOptions.shared.capabilitiesGroup)
8588

8689
// SESSION

Widget/Dashboard/DashboardData.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, dis
139139
password: password,
140140
userAgent: userAgent,
141141
nextcloudVersion: capabilities.capabilityServerVersionMajor,
142+
httpMaximumConnectionsPerHost: NCBrandOptions.shared.httpMaximumConnectionsPerHost,
143+
httpMaximumConnectionsPerHostInDownload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInDownload,
144+
httpMaximumConnectionsPerHostInUpload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInUpload,
142145
groupIdentifier: NCBrandOptions.shared.capabilitiesGroup)
143146

144147
// LOG

Widget/Files/FilesData.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
118118
password: password,
119119
userAgent: userAgent,
120120
nextcloudVersion: NCCapabilities.shared.getCapabilities(account: activeTableAccount.account).capabilityServerVersionMajor,
121+
httpMaximumConnectionsPerHost: NCBrandOptions.shared.httpMaximumConnectionsPerHost,
122+
httpMaximumConnectionsPerHostInDownload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInDownload,
123+
httpMaximumConnectionsPerHostInUpload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInUpload,
121124
groupIdentifier: NCBrandOptions.shared.capabilitiesGroup)
122125

123126
let requestBodyRecent =

Widget/Intent/el.lproj/Intent.strings

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"13zjVT" = "Account";
2+
3+
"CAIVXf" = "Applications";
4+
5+
"DN8Bxl" = "Account";
6+
7+
"LIw8E9" = "Widget";
8+
9+
"NO1rJU" = "Dashboard";
10+
11+
"V3exc2" = "Account";
12+
13+
"VfbA9C" = "Account";
14+
15+
"ZgvlYN" = "Dashboard Widget";
16+
17+
"tAlZ1R" = "Accounts";
18+

Widget/Lockscreen/LockscreenData.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ func getLockscreenDataEntry(configuration: AccountIntent?, isPreview: Bool, fami
7272
password: password,
7373
userAgent: userAgent,
7474
nextcloudVersion: capabilities.capabilityServerVersionMajor,
75+
httpMaximumConnectionsPerHost: NCBrandOptions.shared.httpMaximumConnectionsPerHost,
76+
httpMaximumConnectionsPerHostInDownload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInDownload,
77+
httpMaximumConnectionsPerHostInUpload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInUpload,
7578
groupIdentifier: NCBrandOptions.shared.capabilitiesGroup)
7679

7780
let options = NKRequestOptions(timeout: 90, queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)

iOSClient/Data/NCManageDatabase+Capabilities.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ extension NCManageDatabase {
389389
capabilities.capabilityForbiddenFileNameCharacters = data.capabilities.files?.forbiddenFileNameCharacters ?? []
390390
capabilities.capabilityForbiddenFileNameExtensions = data.capabilities.files?.forbiddenFileNameExtensions ?? []
391391

392-
// TODO: not yet available (IN TEST)
393-
// capabilities.capabilityRecommendations = data.capabilities.recommendations?.enabled ?? false
392+
capabilities.capabilityRecommendations = data.capabilities.recommendations?.enabled ?? false
394393

395394
NCCapabilities.shared.appendCapabilities(account: account, capabilities: capabilities)
396395

iOSClient/Data/NCManageDatabase+LayoutForView.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class NCDBLayoutForView: Object {
3434
@Persisted var sort: String = "fileName"
3535
@Persisted var ascending: Bool = true
3636
@Persisted var groupBy: String = "none"
37-
@Persisted var directoryOnTop: Bool = true
3837
@Persisted var titleButtonHeader: String = "_sorted_by_name_a_z_"
3938
@Persisted var columnGrid: Int = 3
4039
@Persisted var columnPhoto: Int = 3
@@ -49,7 +48,6 @@ extension NCManageDatabase {
4948
sort: String? = nil,
5049
ascending: Bool? = nil,
5150
groupBy: String? = nil,
52-
directoryOnTop: Bool? = nil,
5351
titleButtonHeader: String? = nil,
5452
columnGrid: Int? = nil,
5553
columnPhoto: Int? = nil) -> NCDBLayoutForView? {
@@ -83,9 +81,6 @@ extension NCManageDatabase {
8381
if let groupBy {
8482
addObject.groupBy = groupBy
8583
}
86-
if let directoryOnTop {
87-
addObject.directoryOnTop = directoryOnTop
88-
}
8984
if let titleButtonHeader {
9085
addObject.titleButtonHeader = titleButtonHeader
9186
}

iOSClient/Data/NCManageDatabase+Metadata.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ extension NCManageDatabase {
10521052

10531053
// MARK: - GetResult(s)Metadata
10541054

1055-
func getResultsMetadatasPredicate(_ predicate: NSPredicate, layoutForView: NCDBLayoutForView?) -> [tableMetadata] {
1055+
func getResultsMetadatasPredicate(_ predicate: NSPredicate, layoutForView: NCDBLayoutForView?, directoryOnTop: Bool) -> [tableMetadata] {
10561056
do {
10571057
let realm = try Realm()
10581058
var results = realm.objects(tableMetadata.self).filter(predicate).freeze()
@@ -1064,7 +1064,7 @@ extension NCManageDatabase {
10641064
// 1. favorite order
10651065
if $0.favorite == $1.favorite {
10661066
// 2. directory order TOP
1067-
if layout.directoryOnTop {
1067+
if directoryOnTop {
10681068
if $0.directory == $1.directory {
10691069
// 3. natural fileName
10701070
return $0.fileNameView.localizedStandardCompare($1.fileNameView) == ordered
@@ -1080,7 +1080,7 @@ extension NCManageDatabase {
10801080
}
10811081
return sortedResults
10821082
} else {
1083-
if layout.directoryOnTop {
1083+
if directoryOnTop {
10841084
results = results.sorted(byKeyPath: layout.sort, ascending: layout.ascending).sorted(byKeyPath: "favorite", ascending: false).sorted(byKeyPath: "directory", ascending: false)
10851085
} else {
10861086
results = results.sorted(byKeyPath: layout.sort, ascending: layout.ascending).sorted(byKeyPath: "favorite", ascending: false)

iOSClient/Data/NCManageDatabase+RecommendedFiles.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extension NCManageDatabase {
5959
func getRecommendedFiles(account: String) -> [tableRecommendedFiles] {
6060
do {
6161
let realm = try Realm()
62-
let results = realm.objects(tableRecommendedFiles.self).filter("account == %@", account)
62+
let results = realm.objects(tableRecommendedFiles.self).filter("account == %@", account).sorted(byKeyPath: "timestamp", ascending: false)
6363

6464
return Array(results.map { tableRecommendedFiles.init(value: $0) })
6565
} catch let error {
@@ -68,4 +68,16 @@ extension NCManageDatabase {
6868

6969
return []
7070
}
71+
72+
func deleteAllRecommendedFiles(account: String) {
73+
do {
74+
let realm = try Realm()
75+
76+
try realm.write {
77+
realm.delete(realm.objects(tableRecommendedFiles.self).filter("account == %@", account))
78+
}
79+
} catch let error {
80+
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
81+
}
82+
}
7183
}

iOSClient/Favorites/NCFavorite.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ class NCFavorite: NCCollectionViewCommon {
5757

5858
override func reloadDataSource() {
5959
var predicate = self.defaultPredicate
60+
let directoryOnTop = NCKeychain().getDirectoryOnTop(account: session.account)
6061

6162
if self.serverUrl.isEmpty {
6263
predicate = NSPredicate(format: "account == %@ AND favorite == true AND NOT (status IN %@)", session.account, global.metadataStatusHideInView)
6364
}
6465

65-
let metadatas = self.database.getResultsMetadatasPredicate(predicate, layoutForView: layoutForView)
66+
let metadatas = self.database.getResultsMetadatasPredicate(predicate, layoutForView: layoutForView, directoryOnTop: directoryOnTop)
6667

67-
self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: layoutForView)
68+
self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: layoutForView, directoryOnTop: directoryOnTop)
6869

6970
super.reloadDataSource()
7071
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// SPDX-FileCopyrightText: Nextcloud GmbH
2+
// SPDX-FileCopyrightText: 2025 Marino Faggiana
3+
// SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
import UIKit
6+
7+
class NCFavoriteNavigationController: NCMainNavigationController {
8+
override func setNavigationRightItems() {
9+
guard let collectionViewCommon else {
10+
return
11+
}
12+
13+
func createMenu() -> UIMenu? {
14+
guard let items = self.createMenuActions()
15+
else {
16+
return nil
17+
}
18+
19+
if collectionViewCommon.layoutKey == global.layoutViewFavorite {
20+
return UIMenu(children: [items.select, items.viewStyleSubmenu, items.sortSubmenu])
21+
} else {
22+
let additionalSubmenu = UIMenu(title: "", options: .displayInline, children: [items.foldersOnTop, items.personalFilesOnlyAction, items.showDescription])
23+
return UIMenu(children: [items.select, items.viewStyleSubmenu, items.sortSubmenu, additionalSubmenu])
24+
}
25+
}
26+
27+
if collectionViewCommon.isEditMode {
28+
collectionViewCommon.tabBarSelect?.update(fileSelect: collectionViewCommon.fileSelect, metadatas: collectionViewCommon.getSelectedMetadatas(), userId: session.userId)
29+
collectionViewCommon.tabBarSelect?.show()
30+
31+
let select = UIBarButtonItem(title: NSLocalizedString("_cancel_", comment: ""), style: .done) {
32+
collectionViewCommon.setEditMode(false)
33+
collectionViewCommon.collectionView.reloadData()
34+
}
35+
36+
self.collectionViewCommon?.navigationItem.rightBarButtonItems = [select]
37+
38+
} else if self.collectionViewCommon?.navigationItem.rightBarButtonItems == nil || (!collectionViewCommon.isEditMode && !(collectionViewCommon.tabBarSelect?.isHidden() ?? true)) {
39+
collectionViewCommon.tabBarSelect?.hide()
40+
41+
let menuButton = UIBarButtonItem(image: utility.loadImage(named: "ellipsis.circle"), menu: createMenu())
42+
menuButton.tag = menuButtonTag
43+
menuButton.tintColor = NCBrandColor.shared.iconImageColor
44+
45+
self.collectionViewCommon?.navigationItem.rightBarButtonItems = [menuButton]
46+
47+
} else {
48+
49+
if let rightBarButtonItems = self.collectionViewCommon?.navigationItem.rightBarButtonItems,
50+
let menuBarButtonItem = rightBarButtonItems.first(where: { $0.tag == menuButtonTag }) {
51+
menuBarButtonItem.menu = createMenu()
52+
}
53+
}
54+
55+
// fix, if the tabbar was hidden before the update, set it in hidden
56+
if self.tabBarController?.tabBar.isHidden ?? true,
57+
collectionViewCommon.tabBarSelect?.isHidden() ?? true {
58+
self.tabBarController?.tabBar.isHidden = true
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)