Skip to content

Commit 654487c

Browse files
author
Marino Faggiana
authored
Version 5.2.5 (#2869)
1 parent cc5e176 commit 654487c

26 files changed

+238
-129
lines changed

File Provider Extension UI/DocumentActionViewController.swift

+15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@
55
// Created by Marino Faggiana on 30/01/23.
66
// Copyright © 2023 Marino Faggiana. All rights reserved.
77
//
8+
// Author Marino Faggiana <[email protected]>
9+
//
10+
// This program is free software: you can redistribute it and/or modify
11+
// it under the terms of the GNU General Public License as published by
12+
// the Free Software Foundation, either version 3 of the License, or
13+
// (at your option) any later version.
14+
//
15+
// This program is distributed in the hope that it will be useful,
16+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
// GNU General Public License for more details.
19+
//
20+
// You should have received a copy of the GNU General Public License
21+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
22+
//
823

924
import UIKit
1025
import FileProviderUI

Nextcloud.xcodeproj/project.pbxproj

+10-2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
F30A962F2A27ADF900D7BCFE /* EnvVars.stencil in Resources */ = {isa = PBXBuildFile; fileRef = F30A962E2A27ADF900D7BCFE /* EnvVars.stencil */; };
7373
F30A96312A27AEBF00D7BCFE /* EnvVars.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = F30A96302A27AEBF00D7BCFE /* EnvVars.generated.swift */; };
7474
F30A96322A27AEDD00D7BCFE /* EnvVars.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = F30A96302A27AEBF00D7BCFE /* EnvVars.generated.swift */; };
75+
F310B1EF2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */; };
7576
F3131EDD2B038E4A0018DB28 /* XLForm in Frameworks */ = {isa = PBXBuildFile; productRef = F3131EDC2B038E4A0018DB28 /* XLForm */; };
7677
F3131EDF2B038F2A0018DB28 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = F3131EDE2B038F2A0018DB28 /* SnapshotTesting */; };
7778
F3131EE12B038F560018DB28 /* SnapshotTestingHEIC in Frameworks */ = {isa = PBXBuildFile; productRef = F3131EE02B038F560018DB28 /* SnapshotTestingHEIC */; };
@@ -639,6 +640,7 @@
639640
F793E59E28B763C2005E4B02 /* NCAskAuthorization.swift in Sources */ = {isa = PBXBuildFile; fileRef = F733598025C1C188002ABA72 /* NCAskAuthorization.swift */; };
640641
F793E59F28B764F6005E4B02 /* NCContentPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F765608E23BF813500765969 /* NCContentPresenter.swift */; };
641642
F793E5A128B76541005E4B02 /* NotificationCenter+MainThread.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70460512499061800BB98A7 /* NotificationCenter+MainThread.swift */; };
643+
F794E13D2BBBFF2E003693D7 /* NCMainTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F794E13C2BBBFF2E003693D7 /* NCMainTabBarController.swift */; };
642644
F798F0E225880608000DAFFD /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70CEF5523E9C7E50007035B /* UIColor+Extension.swift */; };
643645
F798F0E725880609000DAFFD /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70CEF5523E9C7E50007035B /* UIColor+Extension.swift */; };
644646
F798F0EC2588060A000DAFFD /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70CEF5523E9C7E50007035B /* UIColor+Extension.swift */; };
@@ -977,6 +979,7 @@
977979
F30A96042A27299D00D7BCFE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
978980
F30A962E2A27ADF900D7BCFE /* EnvVars.stencil */ = {isa = PBXFileReference; lastKnownFileType = text; path = EnvVars.stencil; sourceTree = "<group>"; };
979981
F30A96302A27AEBF00D7BCFE /* EnvVars.generated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = EnvVars.generated.swift; path = Sourcery/EnvVars.generated.swift; sourceTree = "<group>"; };
982+
F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCViewerMedia+VisionKit.swift"; sourceTree = "<group>"; };
980983
F3131ED82B038DB20018DB28 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/iOSSupport/System/Library/Frameworks/SwiftUI.framework; sourceTree = DEVELOPER_DIR; };
981984
F3131EDA2B038DB90018DB28 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/iOSSupport/System/Library/Frameworks/WidgetKit.framework; sourceTree = DEVELOPER_DIR; };
982985
F31F69422A2F6D4500162F76 /* NextcloudSnapshotTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudSnapshotTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -1316,6 +1319,7 @@
13161319
F79018A424092EF4007C9B6D /* ATGMediaBrowser.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ATGMediaBrowser.framework; path = Carthage/Build/iOS/ATGMediaBrowser.framework; sourceTree = "<group>"; };
13171320
F79131C628AFB86E00577277 /* eu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = eu; path = eu.lproj/Localizable.strings; sourceTree = "<group>"; };
13181321
F79131C728AFB86E00577277 /* eu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = eu; path = eu.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1322+
F794E13C2BBBFF2E003693D7 /* NCMainTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMainTabBarController.swift; sourceTree = "<group>"; };
13191323
F79918A021997F9000C2E308 /* UICKeyChainStore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UICKeyChainStore.framework; path = Carthage/Build/iOS/UICKeyChainStore.framework; sourceTree = "<group>"; };
13201324
F79918A72199840500C2E308 /* Sheeeeeeeeet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sheeeeeeeeet.framework; path = Carthage/Build/iOS/Sheeeeeeeeet.framework; sourceTree = "<group>"; };
13211325
F79A65C22191D90F00FF6DCC /* NCSelect.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCSelect.storyboard; sourceTree = "<group>"; };
@@ -1826,6 +1830,7 @@
18261830
F7603298252F0E550015A421 /* Collection Common */,
18271831
F7226EDB1EE4089300EBECB1 /* Main.storyboard */,
18281832
F7682FDF23C36B0500983A04 /* NCMainTabBar.swift */,
1833+
F794E13C2BBBFF2E003693D7 /* NCMainTabBarController.swift */,
18291834
F75B0ABC244C4DBB00E58DCA /* NCActionCenter.swift */,
18301835
F77444F7222816D5000D5EB0 /* NCPickerViewController.swift */,
18311836
F737DA9C2B7B893C0063BAFC /* NCPasscode.swift */,
@@ -2234,6 +2239,7 @@
22342239
F70753F62542A9C000972D44 /* NCViewerMediaPage.storyboard */,
22352240
F70753EA2542A99800972D44 /* NCViewerMediaPage.swift */,
22362241
F70753F02542A9A200972D44 /* NCViewerMedia.swift */,
2242+
F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */,
22372243
F79EDA9E26B004980007D134 /* NCPlayer */,
22382244
);
22392245
path = NCViewerMedia;
@@ -3999,6 +4005,7 @@
39994005
F785EE9D246196DF00B3F945 /* NCNetworkingE2EE.swift in Sources */,
40004006
F76673ED22C901F6007ED366 /* FileProviderDomain.swift in Sources */,
40014007
F7A321AD1E9E6AD50069AD1B /* CCAdvanced.m in Sources */,
4008+
F794E13D2BBBFF2E003693D7 /* NCMainTabBarController.swift in Sources */,
40024009
F77B0E4F1D118A16002130FE /* CCManageAutoUpload.m in Sources */,
40034010
F7CBC1252BAC8B0000EC1D55 /* NCSectionHeaderEmptyData.swift in Sources */,
40044011
F75C0C4823D1FAE300163CC8 /* NCRichWorkspaceCommon.swift in Sources */,
@@ -4032,6 +4039,7 @@
40324039
F761856C29E98543006EB3B0 /* NCIntroCollectionViewCell.swift in Sources */,
40334040
F75DD765290ABB25002EB562 /* Intent.intentdefinition in Sources */,
40344041
F74B6D952A7E239A00F03C5F /* NCManageDatabase+Chunk.swift in Sources */,
4042+
F310B1EF2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift in Sources */,
40354043
F702F2F725EE5CED008F8E80 /* NCLogin.swift in Sources */,
40364044
F7E98C1627E0D0FC001F9F19 /* NCManageDatabase+Video.swift in Sources */,
40374045
F7F4F11227ECDC52008676F9 /* UIFont+Extension.swift in Sources */,
@@ -5065,7 +5073,7 @@
50655073
"@executable_path/Frameworks",
50665074
"@executable_path/../../Frameworks",
50675075
);
5068-
MARKETING_VERSION = 5.2.4;
5076+
MARKETING_VERSION = 5.2.5;
50695077
ONLY_ACTIVE_ARCH = YES;
50705078
OTHER_LDFLAGS = "";
50715079
SDKROOT = iphoneos;
@@ -5127,7 +5135,7 @@
51275135
"@executable_path/Frameworks",
51285136
"@executable_path/../../Frameworks",
51295137
);
5130-
MARKETING_VERSION = 5.2.4;
5138+
MARKETING_VERSION = 5.2.5;
51315139
ONLY_ACTIVE_ARCH = YES;
51325140
OTHER_LDFLAGS = "";
51335141
SDKROOT = iphoneos;

iOSClient/AppDelegate.swift

+6-2
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
362362
let items = await NCAutoUpload.shared.initAutoUpload()
363363
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] \(taskText) auto upload with \(items) uploads")
364364
let results = await NCNetworkingProcess.shared.start()
365-
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] \(taskText) networking process with download: \(results.counterDownload) upload: \(results.counterUpload)")
365+
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] \(taskText) networking process with download: \(results.counterDownloading) upload: \(results.counterUploading)")
366366

367367
if taskText == "ProcessingTask",
368-
items == 0, results.counterDownload == 0, results.counterUpload == 0,
368+
items == 0, results.counterDownloading == 0, results.counterUploading == 0,
369369
let directories = NCManageDatabase.shared.getTablesDirectory(predicate: NSPredicate(format: "account == %@ AND offline == true", self.account), sorted: "offlineDate", ascending: true) {
370370
for directory: tableDirectory in directories {
371371
// only 3 time for day
@@ -377,6 +377,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
377377
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] \(taskText) end synchronization for \(directory.serverUrl), errorCode: \(results.errorCode), item: \(results.items)")
378378
}
379379
}
380+
381+
let counter = NCManageDatabase.shared.getResultsMetadatas(predicate: NSPredicate(format: "account == %@ AND (session == %@ || session == %@) AND status != %d", self.account, NCNetworking.shared.sessionDownloadBackground, NCNetworking.shared.sessionUploadBackground, NCGlobal.shared.metadataStatusNormal))?.count ?? 0
382+
UIApplication.shared.applicationIconBadgeNumber = counter
383+
380384
NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] \(taskText) completion handle")
381385
completion()
382386
}

iOSClient/Data/NCManageDatabase+Metadata.swift

+3-30
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,6 @@ extension NCManageDatabase {
488488

489489
@discardableResult
490490
func addMetadata(_ metadata: tableMetadata) -> tableMetadata? {
491-
492491
let result = tableMetadata.init(value: metadata)
493492

494493
do {
@@ -522,7 +521,6 @@ extension NCManageDatabase {
522521
}
523522

524523
func addMetadatas(_ metadatas: [tableMetadata]) {
525-
526524
do {
527525
let realm = try Realm()
528526
try realm.write {
@@ -534,7 +532,6 @@ extension NCManageDatabase {
534532
}
535533

536534
func deleteMetadata(predicate: NSPredicate) {
537-
538535
do {
539536
let realm = try Realm()
540537
try realm.write {
@@ -547,7 +544,6 @@ extension NCManageDatabase {
547544
}
548545

549546
func deleteMetadata(results: Results<tableMetadata>) {
550-
551547
do {
552548
let realm = try Realm()
553549
try realm.write {
@@ -559,7 +555,6 @@ extension NCManageDatabase {
559555
}
560556

561557
func moveMetadata(ocId: String, serverUrlTo: String) {
562-
563558
do {
564559
let realm = try Realm()
565560
try realm.write {
@@ -573,7 +568,6 @@ extension NCManageDatabase {
573568
}
574569

575570
func renameMetadata(fileNameTo: String, ocId: String) {
576-
577571
do {
578572
let realm = try Realm()
579573
try realm.write {
@@ -592,7 +586,6 @@ extension NCManageDatabase {
592586
}
593587

594588
func setMetadataEtagResource(ocId: String, etagResource: String?) {
595-
596589
guard let etagResource = etagResource else { return }
597590

598591
do {
@@ -607,7 +600,6 @@ extension NCManageDatabase {
607600
}
608601

609602
func setMetadataFavorite(ocId: String, favorite: Bool) {
610-
611603
do {
612604
let realm = try Realm()
613605
try realm.write {
@@ -620,7 +612,6 @@ extension NCManageDatabase {
620612
}
621613

622614
func setMetadataLivePhotoByServer(account: String, ocId: String, livePhotoFile: String) {
623-
624615
do {
625616
let realm = try Realm()
626617
try realm.write {
@@ -635,7 +626,6 @@ extension NCManageDatabase {
635626
}
636627

637628
func updateMetadatasFavorite(account: String, metadatas: [tableMetadata]) {
638-
639629
do {
640630
let realm = try Realm()
641631
try realm.write {
@@ -653,7 +643,6 @@ extension NCManageDatabase {
653643
}
654644

655645
func setMetadataEncrypted(ocId: String, encrypted: Bool) {
656-
657646
do {
658647
let realm = try Realm()
659648
try realm.write {
@@ -666,7 +655,6 @@ extension NCManageDatabase {
666655
}
667656

668657
func setMetadataFileNameView(serverUrl: String, fileName: String, newFileNameView: String, account: String) {
669-
670658
do {
671659
let realm = try Realm()
672660
try realm.write {
@@ -679,7 +667,6 @@ extension NCManageDatabase {
679667
}
680668

681669
func getMetadata(predicate: NSPredicate) -> tableMetadata? {
682-
683670
do {
684671
let realm = try Realm()
685672
realm.refresh()
@@ -693,7 +680,6 @@ extension NCManageDatabase {
693680
}
694681

695682
func getMetadata(predicate: NSPredicate, sorted: String, ascending: Bool) -> tableMetadata? {
696-
697683
do {
698684
let realm = try Realm()
699685
realm.refresh()
@@ -925,7 +911,6 @@ extension NCManageDatabase {
925911
}
926912

927913
func getTableMetadatasDirectoryFavoriteIdentifierRank(account: String) -> [String: NSNumber] {
928-
929914
var listIdentifierRank: [String: NSNumber] = [:]
930915
var counter = 10 as Int64
931916

@@ -945,7 +930,6 @@ extension NCManageDatabase {
945930
}
946931

947932
@objc func clearMetadatasUpload(account: String) {
948-
949933
do {
950934
let realm = try Realm()
951935
try realm.write {
@@ -958,7 +942,6 @@ extension NCManageDatabase {
958942
}
959943

960944
func readMarkerMetadata(account: String, fileId: String) {
961-
962945
do {
963946
let realm = try Realm()
964947
try realm.write {
@@ -972,8 +955,7 @@ extension NCManageDatabase {
972955
}
973956
}
974957

975-
func getAssetLocalIdentifiersUploaded(account: String) -> [String] {
976-
958+
func getAssetLocalIdentifiersUploaded(account: String) -> [String]? {
977959
var assetLocalIdentifiers: [String] = []
978960

979961
do {
@@ -982,15 +964,15 @@ extension NCManageDatabase {
982964
for result in results {
983965
assetLocalIdentifiers.append(result.assetLocalIdentifier)
984966
}
967+
return assetLocalIdentifiers
985968
} catch let error as NSError {
986969
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
987970
}
988971

989-
return assetLocalIdentifiers
972+
return nil
990973
}
991974

992975
func clearAssetLocalIdentifiers(_ assetLocalIdentifiers: [String], account: String) {
993-
994976
do {
995977
let realm = try Realm()
996978
try realm.write {
@@ -1005,7 +987,6 @@ extension NCManageDatabase {
1005987
}
1006988

1007989
func getMetadataLivePhoto(metadata: tableMetadata) -> tableMetadata? {
1008-
1009990
guard metadata.isLivePhoto else { return nil }
1010991

1011992
do {
@@ -1020,7 +1001,6 @@ extension NCManageDatabase {
10201001
}
10211002

10221003
func isMetadataShareOrMounted(metadata: tableMetadata, metadataFolder: tableMetadata?) -> Bool {
1023-
10241004
var isShare = false
10251005
var isMounted = false
10261006

@@ -1043,7 +1023,6 @@ extension NCManageDatabase {
10431023
}
10441024

10451025
func getMetadataConflict(account: String, serverUrl: String, fileNameView: String) -> tableMetadata? {
1046-
10471026
// verify exists conflict
10481027
let fileNameExtension = (fileNameView as NSString).pathExtension.lowercased()
10491028
let fileNameNoExtension = (fileNameView as NSString).deletingPathExtension
@@ -1069,7 +1048,6 @@ extension NCManageDatabase {
10691048
}
10701049

10711050
func getMetadataFromDirectory(account: String, serverUrl: String) -> tableMetadata? {
1072-
10731051
do {
10741052
let realm = try Realm()
10751053
realm.refresh()
@@ -1084,7 +1062,6 @@ extension NCManageDatabase {
10841062
}
10851063

10861064
func getMetadatasFromGroupfolders(account: String, urlBase: String, userId: String) -> [tableMetadata] {
1087-
10881065
var metadatas: [tableMetadata] = []
10891066
let homeServerUrl = utilityFileSystem.getHomeServer(urlBase: urlBase, userId: userId)
10901067

@@ -1108,7 +1085,6 @@ extension NCManageDatabase {
11081085
}
11091086

11101087
func getMetadatasInError(account: String) -> Results<tableMetadata>? {
1111-
11121088
do {
11131089
let realm = try Realm()
11141090
let results = realm.objects(tableMetadata.self).filter("account == %@ AND errorCodeCounter > 1", account)
@@ -1122,7 +1098,6 @@ extension NCManageDatabase {
11221098

11231099
@discardableResult
11241100
func updateMetadatas(_ metadatas: [tableMetadata], predicate: NSPredicate) -> (metadatasDifferentCount: Int, metadatasModified: Int) {
1125-
11261101
var metadatasDifferentCount: Int = 0
11271102
var metadatasModified: Int = 0
11281103

@@ -1153,7 +1128,6 @@ extension NCManageDatabase {
11531128
}
11541129

11551130
func replaceMetadata(_ metadatas: [tableMetadata], predicate: NSPredicate) {
1156-
11571131
do {
11581132
let realm = try Realm()
11591133
try realm.write {
@@ -1173,7 +1147,6 @@ extension NCManageDatabase {
11731147
}
11741148

11751149
func getMediaMetadatas(predicate: NSPredicate) -> ThreadSafeArray<tableMetadata>? {
1176-
11771150
do {
11781151
let realm = try Realm()
11791152
let results = realm.objects(tableMetadata.self).filter(predicate).sorted(byKeyPath: "date", ascending: false)

iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
9191
override func viewDidLoad() {
9292
super.viewDidLoad()
9393

94-
tabBarSelect = NCCollectionViewCommonSelectTabBar(tabBarController: tabBarController, delegate: self)
94+
tabBarSelect = NCCollectionViewCommonSelectTabBar(tabBarController: tabBarController as? NCMainTabBarController, delegate: self)
9595
self.navigationController?.presentationController?.delegate = self
9696

9797
// CollectionView & layout

iOSClient/Main/Collection Common/NCCollectionViewCommonSelectTabBar.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protocol NCCollectionViewCommonSelectTabBarDelegate: AnyObject {
3434
}
3535

3636
class NCCollectionViewCommonSelectTabBar: ObservableObject {
37-
var tabBarController: UITabBarController?
37+
var tabBarController: NCMainTabBarController?
3838
var hostingController: UIViewController?
3939
open weak var delegate: NCCollectionViewCommonSelectTabBarDelegate?
4040

@@ -47,7 +47,7 @@ class NCCollectionViewCommonSelectTabBar: ObservableObject {
4747
@Published var enableLock = false
4848
@Published var isSelectedEmpty = true
4949

50-
init(tabBarController: UITabBarController? = nil, delegate: NCCollectionViewCommonSelectTabBarDelegate? = nil) {
50+
init(tabBarController: NCMainTabBarController? = nil, delegate: NCCollectionViewCommonSelectTabBarDelegate? = nil) {
5151
let rootView = NCCollectionViewCommonSelectTabBarView(tabBarSelect: self)
5252
hostingController = UIHostingController(rootView: rootView)
5353

0 commit comments

Comments
 (0)