Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 8 additions & 49 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@
F33918C42C7CD8F2002D9AA1 /* FileNameValidator+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F33918C32C7CD8F2002D9AA1 /* FileNameValidator+Extensions.swift */; };
F33918C72C7CD8F2002D9AA1 /* FileNameValidator+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F33918C32C7CD8F2002D9AA1 /* FileNameValidator+Extensions.swift */; };
F3391B082B4C52C5001C0C4B /* FirebaseDatabase in Frameworks */ = {isa = PBXBuildFile; productRef = F3391B072B4C52C5001C0C4B /* FirebaseDatabase */; };
F3391B0C2B4C52D5001C0C4B /* SVGKit in Frameworks */ = {isa = PBXBuildFile; productRef = F3391B0B2B4C52D5001C0C4B /* SVGKit */; };
F3391B102B4C52E6001C0C4B /* SVGKit in Frameworks */ = {isa = PBXBuildFile; productRef = F3391B0F2B4C52E6001C0C4B /* SVGKit */; };
F3391B162B4C52F6001C0C4B /* FirebaseDatabase in Frameworks */ = {isa = PBXBuildFile; productRef = F3391B152B4C52F6001C0C4B /* FirebaseDatabase */; };
F33D303E2D8B129600531D64 /* AutoUploadUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F33D303D2D8B129600531D64 /* AutoUploadUITests.swift */; };
F33EE6E12BF4BDA500CA1A51 /* NIOSSL in Frameworks */ = {isa = PBXBuildFile; productRef = F33EE6E02BF4BDA500CA1A51 /* NIOSSL */; };
Expand Down Expand Up @@ -233,7 +231,6 @@
F711A4E52AF9310500095DD8 /* NCUtility+Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF93474B27E34120002537EE /* NCUtility+Image.swift */; };
F711A4E92AF9327600095DD8 /* UIImage+animatedGIF.m in Sources */ = {isa = PBXBuildFile; fileRef = F713FEFF2472764100214AF6 /* UIImage+animatedGIF.m */; };
F711A4EB2AF9327D00095DD8 /* UIImage+animatedGIF.m in Sources */ = {isa = PBXBuildFile; fileRef = F713FEFF2472764100214AF6 /* UIImage+animatedGIF.m */; };
F711A4EF2AF932B900095DD8 /* SVGKitSwift in Frameworks */ = {isa = PBXBuildFile; productRef = F711A4EE2AF932B900095DD8 /* SVGKitSwift */; };
F711D63128F44801003F43C8 /* IntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7C9739428F17131002C43E2 /* IntentHandler.swift */; };
F7132C722D085AD200B42D6A /* NCTermOfServiceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7132C6B2D085AD200B42D6A /* NCTermOfServiceModel.swift */; };
F7132C732D085AD200B42D6A /* NCTermOfServiceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7132C6C2D085AD200B42D6A /* NCTermOfServiceView.swift */; };
Expand Down Expand Up @@ -265,6 +262,9 @@
F71F6D0B2B6A6A5E00F1EB15 /* ThreadSafeArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71F6D062B6A6A5E00F1EB15 /* ThreadSafeArray.swift */; };
F71F6D0C2B6A6A5E00F1EB15 /* ThreadSafeArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71F6D062B6A6A5E00F1EB15 /* ThreadSafeArray.swift */; };
F71F6D0D2B6A6A5E00F1EB15 /* ThreadSafeArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71F6D062B6A6A5E00F1EB15 /* ThreadSafeArray.swift */; };
F71FA7902F337F3300E86192 /* NCSVGRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71FA78F2F337F3000E86192 /* NCSVGRenderer.swift */; };
F71FA7922F33A2E300E86192 /* NCSVGRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71FA78F2F337F3000E86192 /* NCSVGRenderer.swift */; };
F71FA7942F348F8100E86192 /* NCSVGRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71FA78F2F337F3000E86192 /* NCSVGRenderer.swift */; };
F722133B2D40EF9D002F7438 /* NCFilesNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F722133A2D40EF8C002F7438 /* NCFilesNavigationController.swift */; };
F7226EDC1EE4089300EBECB1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7226EDB1EE4089300EBECB1 /* Main.storyboard */; };
F722F0112CFF569500065FB5 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F722F0102CFF569500065FB5 /* MainInterface.storyboard */; };
Expand Down Expand Up @@ -600,8 +600,6 @@
F7864ACF2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7864ACB2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift */; };
F7864AD22A78FE73004870E0 /* NCManageDatabase+LocalFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7864ACB2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift */; };
F787704F22E7019900F287A9 /* NCShareLinkCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F787704E22E7019900F287A9 /* NCShareLinkCell.xib */; };
F787AC09298BCB4A0001BB00 /* SVGKitSwift in Frameworks */ = {isa = PBXBuildFile; productRef = F787AC08298BCB4A0001BB00 /* SVGKitSwift */; };
F787AC0B298BCB540001BB00 /* SVGKitSwift in Frameworks */ = {isa = PBXBuildFile; productRef = F787AC0A298BCB540001BB00 /* SVGKitSwift */; };
F788ECC7263AAAFA00ADC67F /* MarkdownKit in Frameworks */ = {isa = PBXBuildFile; productRef = F788ECC6263AAAFA00ADC67F /* MarkdownKit */; };
F78A10BF29322E8A008499B8 /* NCManageDatabase+Directory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F78A10BE29322E8A008499B8 /* NCManageDatabase+Directory.swift */; };
F78A10C029322E8A008499B8 /* NCManageDatabase+Directory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F78A10BE29322E8A008499B8 /* NCManageDatabase+Directory.swift */; };
Expand Down Expand Up @@ -1335,6 +1333,7 @@
F71CFA662F2A07C6007A3AE9 /* NCMedia+Netwoking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCMedia+Netwoking.swift"; sourceTree = "<group>"; };
F71D2FB62E09BBD700B751CC /* NCAutoUploadModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUploadModel.swift; sourceTree = "<group>"; };
F71F6D062B6A6A5E00F1EB15 /* ThreadSafeArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadSafeArray.swift; sourceTree = "<group>"; };
F71FA78F2F337F3000E86192 /* NCSVGRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSVGRenderer.swift; sourceTree = "<group>"; };
F722133A2D40EF8C002F7438 /* NCFilesNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCFilesNavigationController.swift; sourceTree = "<group>"; };
F7226EDB1EE4089300EBECB1 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
F722F0102CFF569500065FB5 /* MainInterface.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = MainInterface.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1847,7 +1846,6 @@
F37208B62BAB63EF006B5430 /* EasyTipView in Frameworks */,
F37208BA2BAB63EF006B5430 /* TLPhotoPicker in Frameworks */,
F37208AA2BAB63EE006B5430 /* MarkdownKit in Frameworks */,
F3391B102B4C52E6001C0C4B /* SVGKit in Frameworks */,
F37208AE2BAB63EE006B5430 /* MarqueeLabel in Frameworks */,
F37208C02BAB63F0006B5430 /* Mantis in Frameworks */,
F37208C62BAB63F0006B5430 /* LRUCache in Frameworks */,
Expand All @@ -1867,7 +1865,6 @@
files = (
F3F0419D2B9F7E6E00D5155F /* RealmSwift in Frameworks */,
F3391B082B4C52C5001C0C4B /* FirebaseDatabase in Frameworks */,
F3391B0C2B4C52D5001C0C4B /* SVGKit in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -1885,7 +1882,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F711A4EF2AF932B900095DD8 /* SVGKitSwift in Frameworks */,
F710FC80277B7D2700AA9FBF /* RealmSwift in Frameworks */,
F74C863D2AEFBFD9009A1D4A /* LRUCache in Frameworks */,
F70557B92ED44E4700135623 /* LucidBanner in Frameworks */,
Expand All @@ -1906,7 +1902,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F787AC0B298BCB540001BB00 /* SVGKitSwift in Frameworks */,
F783034428B5142B00B84583 /* NextcloudKit in Frameworks */,
F33EE6E32BF4C00700CA1A51 /* NIOSSL in Frameworks */,
F7160A7D2BE931DE0034DCB3 /* RealmSwift in Frameworks */,
Expand Down Expand Up @@ -1941,7 +1936,6 @@
F7BB7E4727A18C56009B9F29 /* Parchment in Frameworks */,
F33EE6E12BF4BDA500CA1A51 /* NIOSSL in Frameworks */,
F734B06628E75C0100E180D5 /* TLPhotoPicker in Frameworks */,
F787AC09298BCB4A0001BB00 /* SVGKitSwift in Frameworks */,
F760DE032AE66EA80027D78A /* KeychainAccess in Frameworks */,
F3374AF62D78B01B002A38F9 /* HashTreeCollections in Frameworks */,
F33EE6F02BF4C0FF00CA1A51 /* NIO in Frameworks */,
Expand Down Expand Up @@ -2939,6 +2933,7 @@
F7A560412AE1593700BE8FD6 /* NCOperationSaveLivePhoto.swift */,
F702F30725EE5D47008F8E80 /* NCPopupViewController.swift */,
F707C26421A2DC5200F6181E /* NCStoreReview.swift */,
F71FA78F2F337F3000E86192 /* NCSVGRenderer.swift */,
F70BFC7320E0FA7C00C67599 /* NCUtility.swift */,
F711A4DB2AF92CAD00095DD8 /* NCUtility+Date.swift */,
F359D8662A7D03420023F405 /* NCUtility+Exif.swift */,
Expand Down Expand Up @@ -3426,7 +3421,6 @@
);
name = NextcloudUITests;
packageProductDependencies = (
F3391B0F2B4C52E6001C0C4B /* SVGKit */,
F3391B152B4C52F6001C0C4B /* FirebaseDatabase */,
F3F0419E2B9F7E7900D5155F /* RealmSwift */,
F37208A32BAB63EE006B5430 /* QRCodeReader */,
Expand Down Expand Up @@ -3469,7 +3463,6 @@
name = NextcloudIntegrationTests;
packageProductDependencies = (
F3391B072B4C52C5001C0C4B /* FirebaseDatabase */,
F3391B0B2B4C52D5001C0C4B /* SVGKit */,
F3F0419C2B9F7E6E00D5155F /* RealmSwift */,
);
productName = NextcloudIntegrationTests;
Expand Down Expand Up @@ -3524,7 +3517,6 @@
F7A560472AE15D5000BE8FD6 /* Queuer */,
F760DE082AE66ED00027D78A /* KeychainAccess */,
F74C863C2AEFBFD9009A1D4A /* LRUCache */,
F711A4EE2AF932B900095DD8 /* SVGKitSwift */,
F33EE6E62BF4C02600CA1A51 /* NIOSSL */,
F7B8F6172EAB7516006A70D6 /* JDStatusBarNotification */,
F70557B82ED44E4700135623 /* LucidBanner */,
Expand All @@ -3550,7 +3542,6 @@
packageProductDependencies = (
F783030C28B4C59A00B84583 /* SwiftEntryKit */,
F783034328B5142B00B84583 /* NextcloudKit */,
F787AC0A298BCB540001BB00 /* SVGKitSwift */,
F7A560452AE15D3D00BE8FD6 /* Queuer */,
F760DE042AE66EBE0027D78A /* KeychainAccess */,
F7160A7C2BE931DE0034DCB3 /* RealmSwift */,
Expand Down Expand Up @@ -3622,7 +3613,6 @@
F77333872927A72100466E35 /* OpenSSL */,
F77BC3EA293E5268005F2B08 /* Swifter */,
F7D56B192972405500FA46C4 /* Mantis */,
F787AC08298BCB4A0001BB00 /* SVGKitSwift */,
F7A1050D29E587AF00FFD92B /* TagListView */,
F7F623B42A5EF4D30022D3D4 /* Gzip */,
F76B649D2ADFFDEC00014640 /* LRUCache */,
Expand Down Expand Up @@ -3794,7 +3784,6 @@
);
mainGroup = F7F67B9F1A24D27800EE80DA;
packageReferences = (
F75E57A725BF0D61002B72C2 /* XCRemoteSwiftPackageReference "SVGKit" */,
F7ED547A25EEA65400956C55 /* XCRemoteSwiftPackageReference "QRCodeReader" */,
F72DA9B225F53E4E00B87DB1 /* XCRemoteSwiftPackageReference "SwiftRichString" */,
F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */,
Expand Down Expand Up @@ -4255,6 +4244,7 @@
F799DF832C4B7DCC003410B5 /* NCSectionFooter.swift in Sources */,
AF22B218277D196700DAB0CC /* NCShareExtension+Files.swift in Sources */,
F799DF862C4B7E56003410B5 /* NCSectionHeader.swift in Sources */,
F71FA7942F348F8100E86192 /* NCSVGRenderer.swift in Sources */,
F702F2D025EE5B5C008F8E80 /* NCGlobal.swift in Sources */,
F72437802C10B92400C7C68D /* NCSharePermissions.swift in Sources */,
F7EDE4DB262D7BA200414FE6 /* NCCellProtocol.swift in Sources */,
Expand Down Expand Up @@ -4345,6 +4335,7 @@
F724377C2C10B92200C7C68D /* NCSharePermissions.swift in Sources */,
F77ED59328C9CEA000E24ED0 /* ToolbarWidgetProvider.swift in Sources */,
F72A17D828B221E300F3F159 /* DashboardWidgetView.swift in Sources */,
F71FA7922F33A2E300E86192 /* NCSVGRenderer.swift in Sources */,
F77ED59528C9CEA400E24ED0 /* ToolbarWidgetView.swift in Sources */,
F78302FB28B4C3EE00B84583 /* NCManageDatabase+Video.swift in Sources */,
F7C687EA2D22BDE5004757BC /* NCManageDatabase+RecommendedFiles.swift in Sources */,
Expand Down Expand Up @@ -4491,6 +4482,7 @@
AFA2AC8527849604008E1EA7 /* NCActivityCommentView.swift in Sources */,
AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */,
F75A9EE623796C6F0044CFCE /* NCNetworking.swift in Sources */,
F71FA7902F337F3300E86192 /* NCSVGRenderer.swift in Sources */,
AA8D31552D41052300FE2775 /* NCManageDatabase+DownloadLimit.swift in Sources */,
F758B460212C56A400515F55 /* NCScan.swift in Sources */,
F76882262C0DD1E7001CF441 /* NCSettingsView.swift in Sources */,
Expand Down Expand Up @@ -6054,14 +6046,6 @@
kind = branch;
};
};
F75E57A725BF0D61002B72C2 /* XCRemoteSwiftPackageReference "SVGKit" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/SVGKit/SVGKit.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 3.0.0;
};
};
F75EAED626D2552E00F4320E /* XCRemoteSwiftPackageReference "MarqueeLabel" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/cbpowell/MarqueeLabel";
Expand Down Expand Up @@ -6223,16 +6207,6 @@
package = F70B86732642CE3B00ED5349 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseDatabase;
};
F3391B0B2B4C52D5001C0C4B /* SVGKit */ = {
isa = XCSwiftPackageProductDependency;
package = F75E57A725BF0D61002B72C2 /* XCRemoteSwiftPackageReference "SVGKit" */;
productName = SVGKit;
};
F3391B0F2B4C52E6001C0C4B /* SVGKit */ = {
isa = XCSwiftPackageProductDependency;
package = F75E57A725BF0D61002B72C2 /* XCRemoteSwiftPackageReference "SVGKit" */;
productName = SVGKit;
};
F3391B152B4C52F6001C0C4B /* FirebaseDatabase */ = {
isa = XCSwiftPackageProductDependency;
package = F70B86732642CE3B00ED5349 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
Expand Down Expand Up @@ -6413,11 +6387,6 @@
package = F710FC78277B7CFF00AA9FBF /* XCRemoteSwiftPackageReference "realm-swift" */;
productName = RealmSwift;
};
F711A4EE2AF932B900095DD8 /* SVGKitSwift */ = {
isa = XCSwiftPackageProductDependency;
package = F75E57A725BF0D61002B72C2 /* XCRemoteSwiftPackageReference "SVGKit" */;
productName = SVGKitSwift;
};
F7160A7C2BE931DE0034DCB3 /* RealmSwift */ = {
isa = XCSwiftPackageProductDependency;
package = F710FC78277B7CFF00AA9FBF /* XCRemoteSwiftPackageReference "realm-swift" */;
Expand Down Expand Up @@ -6573,16 +6542,6 @@
package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */;
productName = NextcloudKit;
};
F787AC08298BCB4A0001BB00 /* SVGKitSwift */ = {
isa = XCSwiftPackageProductDependency;
package = F75E57A725BF0D61002B72C2 /* XCRemoteSwiftPackageReference "SVGKit" */;
productName = SVGKitSwift;
};
F787AC0A298BCB540001BB00 /* SVGKitSwift */ = {
isa = XCSwiftPackageProductDependency;
package = F75E57A725BF0D61002B72C2 /* XCRemoteSwiftPackageReference "SVGKit" */;
productName = SVGKitSwift;
};
F788ECC6263AAAFA00ADC67F /* MarkdownKit */ = {
isa = XCSwiftPackageProductDependency;
package = F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */;
Expand Down
16 changes: 9 additions & 7 deletions Widget/Dashboard/DashboardData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import WidgetKit
import Intents
import NextcloudKit
import RealmSwift
import SVGKit

struct DashboardDataEntry: TimelineEntry {
let date: Date
Expand Down Expand Up @@ -76,7 +75,7 @@ func getDashboardItems(displaySize: CGSize, withButton: Bool) -> Int {
}
}

func convertDataToImage(data: Data?, size: CGSize, fileNameToWrite: String?) -> UIImage? {
func convertDataToImage(data: Data?, size: CGSize, fileNameToWrite: String?, user: String) async -> UIImage? {
guard let data = data else {
return nil
}
Expand All @@ -85,12 +84,15 @@ func convertDataToImage(data: Data?, size: CGSize, fileNameToWrite: String?) ->

if let image = UIImage(data: data), let image = image.resizeImage(size: size) {
imageData = image
} else if let image = SVGKImage(data: data) {
image.size = size
imageData = image.uiImage
} else {
print("error")
do {
imageData = try await NCSVGRenderer().renderSVGToUIImage(svgData: data,
fileName: fileNameToWrite)
} catch {
print("Unsupported image format: \(error.localizedDescription)")
}
}

if let fileName = fileNameToWrite, let image = imageData {
do {
let fileNamePath: String = utilityFileSystem.createServerUrl(serverUrl: utilityFileSystem.directoryUserData, fileName: fileName + ".png")
Expand Down Expand Up @@ -229,7 +231,7 @@ func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, dis
let (_, _, error) = await NextcloudKit.shared.downloadPreviewAsync(url: url, account: activeTableAccount.account)
if error == .success,
let data = responseData?.data,
let image = convertDataToImage(data: data, size: NCGlobal.shared.size256, fileNameToWrite: fileName) {
let image = await convertDataToImage(data: data, size: NCGlobal.shared.size256, fileNameToWrite: fileName, user: activeTableAccount.userId) {
icon = image
}
}
Expand Down
Loading