Marino Faggiana пре 1 година
родитељ
комит
acf40839f5

+ 1 - 1
Share/NCShareCell.swift

@@ -59,7 +59,7 @@ class NCShareCell: UITableViewCell {
         fileNameCell?.text = fileName
         fileNameCell?.text = fileName
 
 
         let fileSize = NCUtilityFileSystem.shared.getFileSize(filePath: (NSTemporaryDirectory() + fileName))
         let fileSize = NCUtilityFileSystem.shared.getFileSize(filePath: (NSTemporaryDirectory() + fileName))
-        sizeCell?.text = CCUtility.transformedSize(fileSize)
+        sizeCell?.text = NCUtilityFileSystem.shared.transformedSize(fileSize)
 
 
         moreButton?.setImage(NCUtility.shared.loadImage(named: "more").image(color: .label, size: 15), for: .normal)
         moreButton?.setImage(NCUtility.shared.loadImage(named: "more").image(color: .label, size: 15), for: .normal)
     }
     }

+ 1 - 1
Widget/Files/FilesData.swift

@@ -218,7 +218,7 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
                 guard !isLive(file: file, files: files) else { continue }
                 guard !isLive(file: file, files: files) else { continue }
 
 
                 // SUBTITLE
                 // SUBTITLE
-                let subTitle = CCUtility.dateDiff(file.date as Date) + " · " + CCUtility.transformedSize(file.size)
+                let subTitle = CCUtility.dateDiff(file.date as Date) + " · " + NCUtilityFileSystem.shared.transformedSize(file.size)
 
 
                 // URL: nextcloud://open-file?path=Talk/IMG_0000123.jpg&user=marinofaggiana&link=https://cloud.nextcloud.com/f/123
                 // URL: nextcloud://open-file?path=Talk/IMG_0000123.jpg&user=marinofaggiana&link=https://cloud.nextcloud.com/f/123
                 guard var path = NCUtilityFileSystem.shared.getPath(path: file.path, user: file.user, fileName: file.fileName).urlEncoded else { continue }
                 guard var path = NCUtilityFileSystem.shared.getPath(path: file.path, user: file.user, fileName: file.fileName).urlEncoded else { continue }

+ 2 - 2
Widget/Lockscreen/LockscreenData.swift

@@ -82,7 +82,7 @@ func getLockscreenDataEntry(configuration: AccountIntent?, isPreview: Bool, fami
                     if userProfile.quotaRelative > 0 {
                     if userProfile.quotaRelative > 0 {
                         quotaRelative = Float(userProfile.quotaRelative) / 100
                         quotaRelative = Float(userProfile.quotaRelative) / 100
                     }
                     }
-                    let quotaUsed: String = CCUtility.transformedSize(userProfile.quotaUsed)
+                    let quotaUsed: String = NCUtilityFileSystem.shared.transformedSize(userProfile.quotaUsed)
                     var quotaTotal: String = ""
                     var quotaTotal: String = ""
 
 
                     switch userProfile.quotaTotal {
                     switch userProfile.quotaTotal {
@@ -93,7 +93,7 @@ func getLockscreenDataEntry(configuration: AccountIntent?, isPreview: Bool, fami
                     case -3:
                     case -3:
                         quotaTotal = ""
                         quotaTotal = ""
                     default:
                     default:
-                        quotaTotal = CCUtility.transformedSize(userProfile.quotaTotal)
+                        quotaTotal = NCUtilityFileSystem.shared.transformedSize(userProfile.quotaTotal)
                     }
                     }
                     completion(LockscreenData(date: Date(), isPlaceholder: false, activity: "", link: URL(string: "https://")!, quotaRelative: quotaRelative, quotaUsed: quotaUsed, quotaTotal: quotaTotal, error: false))
                     completion(LockscreenData(date: Date(), isPlaceholder: false, activity: "", link: URL(string: "https://")!, quotaRelative: quotaRelative, quotaUsed: quotaUsed, quotaTotal: quotaTotal, error: false))
                 } else {
                 } else {

+ 9 - 9
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -539,12 +539,12 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                     cell.fileProgressView?.progress = progressNumber.floatValue
                     cell.fileProgressView?.progress = progressNumber.floatValue
                     cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
                     cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
                     if status == NCGlobal.shared.metadataStatusInDownload {
                     if status == NCGlobal.shared.metadataStatusInDownload {
-                        cell.fileInfoLabel?.text = CCUtility.transformedSize(totalBytesExpected) + " - ↓ " + CCUtility.transformedSize(totalBytes)
+                        cell.fileInfoLabel?.text = NCUtilityFileSystem.shared.transformedSize(totalBytesExpected) + " - ↓ " + NCUtilityFileSystem.shared.transformedSize(totalBytes)
                     } else if status == NCGlobal.shared.metadataStatusInUpload {
                     } else if status == NCGlobal.shared.metadataStatusInUpload {
                         if totalBytes > 0 {
                         if totalBytes > 0 {
-                            cell.fileInfoLabel?.text = CCUtility.transformedSize(totalBytesExpected) + " - ↑ " + CCUtility.transformedSize(totalBytes)
+                            cell.fileInfoLabel?.text = NCUtilityFileSystem.shared.transformedSize(totalBytesExpected) + " - ↑ " + NCUtilityFileSystem.shared.transformedSize(totalBytes)
                         } else {
                         } else {
-                            cell.fileInfoLabel?.text = CCUtility.transformedSize(totalBytesExpected) + " - ↑ …"
+                            cell.fileInfoLabel?.text = NCUtilityFileSystem.shared.transformedSize(totalBytesExpected) + " - ↑ …"
                         }
                         }
                     }
                     }
                 }
                 }
@@ -1420,19 +1420,19 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
         // Write status on Label Info
         // Write status on Label Info
         switch metadata.status {
         switch metadata.status {
         case NCGlobal.shared.metadataStatusWaitDownload:
         case NCGlobal.shared.metadataStatusWaitDownload:
-            cell.fileInfoLabel?.text = CCUtility.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_wait_download_", comment: "")
+            cell.fileInfoLabel?.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_wait_download_", comment: "")
         case NCGlobal.shared.metadataStatusInDownload:
         case NCGlobal.shared.metadataStatusInDownload:
-            cell.fileInfoLabel?.text = CCUtility.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_in_download_", comment: "")
+            cell.fileInfoLabel?.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_in_download_", comment: "")
         case NCGlobal.shared.metadataStatusDownloading:
         case NCGlobal.shared.metadataStatusDownloading:
-            cell.fileInfoLabel?.text = CCUtility.transformedSize(metadata.size) + " - ↓ …"
+            cell.fileInfoLabel?.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + " - ↓ …"
         case NCGlobal.shared.metadataStatusWaitUpload:
         case NCGlobal.shared.metadataStatusWaitUpload:
-            cell.fileInfoLabel?.text = CCUtility.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_wait_upload_", comment: "")
+            cell.fileInfoLabel?.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_wait_upload_", comment: "")
             cell.fileLocalImage?.image = nil
             cell.fileLocalImage?.image = nil
         case NCGlobal.shared.metadataStatusInUpload:
         case NCGlobal.shared.metadataStatusInUpload:
-            cell.fileInfoLabel?.text = CCUtility.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_in_upload_", comment: "")
+            cell.fileInfoLabel?.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_in_upload_", comment: "")
             cell.fileLocalImage?.image = nil
             cell.fileLocalImage?.image = nil
         case NCGlobal.shared.metadataStatusUploading:
         case NCGlobal.shared.metadataStatusUploading:
-            cell.fileInfoLabel?.text = CCUtility.transformedSize(metadata.size) + " - ↑ …"
+            cell.fileInfoLabel?.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + " - ↑ …"
             cell.fileLocalImage?.image = nil
             cell.fileLocalImage?.image = nil
         case NCGlobal.shared.metadataStatusUploadError:
         case NCGlobal.shared.metadataStatusUploadError:
             if metadata.sessionError.isEmpty {
             if metadata.sessionError.isEmpty {

+ 1 - 1
iOSClient/Main/Collection Common/NCGridCell.swift

@@ -209,7 +209,7 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
         dateFormatter.timeStyle = .none
         dateFormatter.timeStyle = .none
         dateFormatter.locale = Locale.current
         dateFormatter.locale = Locale.current
 
 
-        labelInfo.text = dateFormatter.string(from: date as Date) + " · " + CCUtility.transformedSize(size)
+        labelInfo.text = dateFormatter.string(from: date as Date) + " · " + NCUtilityFileSystem.shared.transformedSize(size)
     }
     }
 
 
     func setAccessibility(label: String, value: String) {
     func setAccessibility(label: String, value: String) {

+ 1 - 1
iOSClient/Main/Collection Common/NCListCell.swift

@@ -271,7 +271,7 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
     }
     }
 
 
     func writeInfoDateSize(date: NSDate, size: Int64) {
     func writeInfoDateSize(date: NSDate, size: Int64) {
-        labelInfo.text = CCUtility.dateDiff(date as Date) + " · " + CCUtility.transformedSize(size)
+        labelInfo.text = CCUtility.dateDiff(date as Date) + " · " + NCUtilityFileSystem.shared.transformedSize(size)
     }
     }
 
 
     func setAccessibility(label: String, value: String) {
     func setAccessibility(label: String, value: String) {

+ 4 - 4
iOSClient/Main/Create cloud/NCCreateFormUploadConflict.swift

@@ -341,7 +341,7 @@ extension NCCreateFormUploadConflict: UITableViewDataSource {
                     cell.imageAlreadyExistingFile.image = UIImage(named: metadataAlreadyExists.iconName)
                     cell.imageAlreadyExistingFile.image = UIImage(named: metadataAlreadyExists.iconName)
                 }
                 }
             }
             }
-            cell.labelDetailAlreadyExistingFile.text = CCUtility.dateDiff(metadataAlreadyExists.date as Date) + "\n" + CCUtility.transformedSize(metadataAlreadyExists.size)
+            cell.labelDetailAlreadyExistingFile.text = CCUtility.dateDiff(metadataAlreadyExists.date as Date) + "\n" + NCUtilityFileSystem.shared.transformedSize(metadataAlreadyExists.size)
 
 
             if metadatasConflictAlreadyExistingFiles.contains(metadataNewFile.ocId) {
             if metadatasConflictAlreadyExistingFiles.contains(metadataNewFile.ocId) {
                 cell.switchAlreadyExistingFile.isOn = true
                 cell.switchAlreadyExistingFile.isOn = true
@@ -380,7 +380,7 @@ extension NCCreateFormUploadConflict: UITableViewDataSource {
                         let fileDictionary = try FileManager.default.attributesOfItem(atPath: fileNamePath)
                         let fileDictionary = try FileManager.default.attributesOfItem(atPath: fileNamePath)
                         let fileSize = fileDictionary[FileAttributeKey.size] as? Int64 ?? 0
                         let fileSize = fileDictionary[FileAttributeKey.size] as? Int64 ?? 0
 
 
-                        cell.labelDetailNewFile.text = CCUtility.dateDiff(date) + "\n" + CCUtility.transformedSize(fileSize)
+                        cell.labelDetailNewFile.text = CCUtility.dateDiff(date) + "\n" + NCUtilityFileSystem.shared.transformedSize(fileSize)
 
 
                     } catch { print("Error: \(error)") }
                     } catch { print("Error: \(error)") }
 
 
@@ -404,7 +404,7 @@ extension NCCreateFormUploadConflict: UITableViewDataSource {
                                         DispatchQueue.main.async { cell.imageNewFile.image = image }
                                         DispatchQueue.main.async { cell.imageNewFile.image = image }
                                     }
                                     }
                                 }
                                 }
-                                DispatchQueue.main.async { cell.labelDetailNewFile.text = CCUtility.dateDiff(date) + "\n" + CCUtility.transformedSize(fileSize) }
+                                DispatchQueue.main.async { cell.labelDetailNewFile.text = CCUtility.dateDiff(date) + "\n" + NCUtilityFileSystem.shared.transformedSize(fileSize) }
                             } catch { print("Error: \(error)") }
                             } catch { print("Error: \(error)") }
                         }
                         }
                     }
                     }
@@ -423,7 +423,7 @@ extension NCCreateFormUploadConflict: UITableViewDataSource {
                     let fileDictionary = try FileManager.default.attributesOfItem(atPath: filePathNewFile)
                     let fileDictionary = try FileManager.default.attributesOfItem(atPath: filePathNewFile)
                     let fileSize = fileDictionary[FileAttributeKey.size] as? Int64 ?? 0
                     let fileSize = fileDictionary[FileAttributeKey.size] as? Int64 ?? 0
 
 
-                    cell.labelDetailNewFile.text = CCUtility.dateDiff(metadataNewFile.date as Date) + "\n" + CCUtility.transformedSize(fileSize)
+                    cell.labelDetailNewFile.text = CCUtility.dateDiff(metadataNewFile.date as Date) + "\n" + NCUtilityFileSystem.shared.transformedSize(fileSize)
 
 
                 } catch { print("Error: \(error)") }
                 } catch { print("Error: \(error)") }
 
 

+ 2 - 2
iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift

@@ -319,9 +319,9 @@ class NCSectionFooter: UICollectionReusableView, NCSectionFooterDelegate {
         }
         }
 
 
         if files > 1 {
         if files > 1 {
-            filesText = "\(files) " + NSLocalizedString("_files_", comment: "") + " " + CCUtility.transformedSize(size)
+            filesText = "\(files) " + NSLocalizedString("_files_", comment: "") + " " + NCUtilityFileSystem.shared.transformedSize(size)
         } else if files == 1 {
         } else if files == 1 {
-            filesText = "1 " + NSLocalizedString("_file_", comment: "") + " " + CCUtility.transformedSize(size)
+            filesText = "1 " + NSLocalizedString("_file_", comment: "") + " " + NCUtilityFileSystem.shared.transformedSize(size)
         }
         }
 
 
         if foldersText.isEmpty {
         if foldersText.isEmpty {

+ 2 - 2
iOSClient/More/NCMore.swift

@@ -208,10 +208,10 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             case -3:
             case -3:
                 quota = NSLocalizedString("_quota_space_unlimited_", comment: "")
                 quota = NSLocalizedString("_quota_space_unlimited_", comment: "")
             default:
             default:
-                quota = CCUtility.transformedSize(activeAccount.quotaTotal)
+                quota = NCUtilityFileSystem.shared.transformedSize(activeAccount.quotaTotal)
             }
             }
 
 
-            let quotaUsed: String = CCUtility.transformedSize(activeAccount.quotaUsed)
+            let quotaUsed: String = NCUtilityFileSystem.shared.transformedSize(activeAccount.quotaUsed)
 
 
             labelQuota.text = String.localizedStringWithFormat(NSLocalizedString("_quota_using_", comment: ""), quotaUsed, quota)
             labelQuota.text = String.localizedStringWithFormat(NSLocalizedString("_quota_using_", comment: ""), quotaUsed, quota)
         }
         }

+ 1 - 1
iOSClient/Select/NCSelect.swift

@@ -391,7 +391,7 @@ extension NCSelect: UICollectionViewDataSource {
 
 
         } else {
         } else {
 
 
-            cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
+            cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + NCUtilityFileSystem.shared.transformedSize(metadata.size)
 
 
             // image local
             // image local
             if NCManageDatabase.shared.getTableLocalFile(ocId: metadata.ocId) != nil {
             if NCManageDatabase.shared.getTableLocalFile(ocId: metadata.ocId) != nil {

+ 2 - 2
iOSClient/Settings/CCAdvanced.m

@@ -432,8 +432,8 @@
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         NSString *directory =  [[NCUtilityFileSystem shared] directoryProviderStorage];
         NSString *directory =  [[NCUtilityFileSystem shared] directoryProviderStorage];
         int64_t totalSize = [[NCUtilityFileSystem shared] getDirectorySizeWithDirectory:directory];
         int64_t totalSize = [[NCUtilityFileSystem shared] getDirectorySizeWithDirectory:directory];
-        sectionSize.footerTitle = [NSString stringWithFormat:@"%@. (%@ %@)", NSLocalizedString(@"_clear_cache_footer_", nil), NSLocalizedString(@"_used_space_", nil), [CCUtility transformedSize:totalSize]];
-            
+        sectionSize.footerTitle = [NSString stringWithFormat:@"%@. (%@ %@)", NSLocalizedString(@"_clear_cache_footer_", nil), NSLocalizedString(@"_used_space_", nil), [[NCUtilityFileSystem shared] transformedSize:totalSize]];
+
         dispatch_async(dispatch_get_main_queue(), ^{
         dispatch_async(dispatch_get_main_queue(), ^{
             [self.tableView reloadData];
             [self.tableView reloadData];
         });
         });

+ 1 - 1
iOSClient/Share/Advanced/NCShareAdvancePermissionHeader.swift

@@ -46,6 +46,6 @@ class NCShareAdvancePermissionHeader: UIView {
         fileName.text = metadata.fileNameView
         fileName.text = metadata.fileNameView
         fileName.textColor = .label
         fileName.textColor = .label
         info.textColor = .secondaryLabel
         info.textColor = .secondaryLabel
-        info.text = CCUtility.transformedSize(metadata.size) + ", " + CCUtility.dateDiff(metadata.date as Date)
+        info.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + ", " + CCUtility.dateDiff(metadata.date as Date)
     }
     }
 }
 }

+ 1 - 1
iOSClient/Share/NCSharePaging.swift

@@ -297,7 +297,7 @@ class NCSharePagingView: PagingView {
         } else {
         } else {
             headerView.favorite.setImage(NCUtility.shared.loadImage(named: "star.fill", color: .systemGray, size: 20), for: .normal)
             headerView.favorite.setImage(NCUtility.shared.loadImage(named: "star.fill", color: .systemGray, size: 20), for: .normal)
         }
         }
-        headerView.info.text = CCUtility.transformedSize(metadata.size) + ", " + NSLocalizedString("_modified_", comment: "") + " " + dateFormatter.string(from: metadata.date as Date)
+        headerView.info.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + ", " + NSLocalizedString("_modified_", comment: "") + " " + dateFormatter.string(from: metadata.date as Date)
         headerView.info.textColor = .systemGray
         headerView.info.textColor = .systemGray
         headerView.creation.text = NSLocalizedString("_creation_", comment: "") + " " + dateFormatter.string(from: metadata.creationDate as Date)
         headerView.creation.text = NSLocalizedString("_creation_", comment: "") + " " + dateFormatter.string(from: metadata.creationDate as Date)
         headerView.creation.textColor = .systemGray
         headerView.creation.textColor = .systemGray

+ 1 - 1
iOSClient/Transfers/NCTransferCell.swift

@@ -141,7 +141,7 @@ class NCTransferCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellP
     }
     }
 
 
     func writeInfoDateSize(date: NSDate, size: Int64) {
     func writeInfoDateSize(date: NSDate, size: Int64) {
-        labelInfo.text = CCUtility.dateDiff(date as Date) + " · " + CCUtility.transformedSize(size)
+        labelInfo.text = CCUtility.dateDiff(date as Date) + " · " + NCUtilityFileSystem.shared.transformedSize(size)
     }
     }
 }
 }
 
 

+ 6 - 6
iOSClient/Transfers/NCTransfers.swift

@@ -196,7 +196,7 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
         } else {
         } else {
             cell.imageItem.image = UIImage(named: "file")
             cell.imageItem.image = UIImage(named: "file")
         }
         }
-        cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
+        cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + NCUtilityFileSystem.shared.transformedSize(metadata.size)
         if metadata.status == NCGlobal.shared.metadataStatusDownloading || metadata.status == NCGlobal.shared.metadataStatusUploading {
         if metadata.status == NCGlobal.shared.metadataStatusDownloading || metadata.status == NCGlobal.shared.metadataStatusUploading {
             cell.progressView.isHidden = false
             cell.progressView.isHidden = false
         } else {
         } else {
@@ -206,22 +206,22 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
         switch metadata.status {
         switch metadata.status {
         case NCGlobal.shared.metadataStatusWaitDownload:
         case NCGlobal.shared.metadataStatusWaitDownload:
             cell.labelStatus.text = NSLocalizedString("_status_wait_download_", comment: "")
             cell.labelStatus.text = NSLocalizedString("_status_wait_download_", comment: "")
-            cell.labelInfo.text = CCUtility.transformedSize(metadata.size)
+            cell.labelInfo.text = NCUtilityFileSystem.shared.transformedSize(metadata.size)
         case NCGlobal.shared.metadataStatusInDownload:
         case NCGlobal.shared.metadataStatusInDownload:
             cell.labelStatus.text = NSLocalizedString("_status_in_download_", comment: "")
             cell.labelStatus.text = NSLocalizedString("_status_in_download_", comment: "")
-            cell.labelInfo.text = CCUtility.transformedSize(metadata.size)
+            cell.labelInfo.text = NCUtilityFileSystem.shared.transformedSize(metadata.size)
         case NCGlobal.shared.metadataStatusDownloading:
         case NCGlobal.shared.metadataStatusDownloading:
             cell.labelStatus.text = NSLocalizedString("_status_downloading_", comment: "")
             cell.labelStatus.text = NSLocalizedString("_status_downloading_", comment: "")
-            cell.labelInfo.text = CCUtility.transformedSize(metadata.size) + " - ↓ …"
+            cell.labelInfo.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + " - ↓ …"
         case NCGlobal.shared.metadataStatusWaitUpload:
         case NCGlobal.shared.metadataStatusWaitUpload:
             cell.labelStatus.text = NSLocalizedString("_status_wait_upload_", comment: "")
             cell.labelStatus.text = NSLocalizedString("_status_wait_upload_", comment: "")
             cell.labelInfo.text = ""
             cell.labelInfo.text = ""
         case NCGlobal.shared.metadataStatusInUpload:
         case NCGlobal.shared.metadataStatusInUpload:
             cell.labelStatus.text = NSLocalizedString("_status_in_upload_", comment: "")
             cell.labelStatus.text = NSLocalizedString("_status_in_upload_", comment: "")
-            cell.labelInfo.text = CCUtility.transformedSize(metadata.size)
+            cell.labelInfo.text = NCUtilityFileSystem.shared.transformedSize(metadata.size)
         case NCGlobal.shared.metadataStatusUploading:
         case NCGlobal.shared.metadataStatusUploading:
             cell.labelStatus.text = NSLocalizedString("_status_uploading_", comment: "")
             cell.labelStatus.text = NSLocalizedString("_status_uploading_", comment: "")
-            cell.labelInfo.text = CCUtility.transformedSize(metadata.size) + " - ↑ …"
+            cell.labelInfo.text = NCUtilityFileSystem.shared.transformedSize(metadata.size) + " - ↑ …"
         case NCGlobal.shared.metadataStatusUploadError:
         case NCGlobal.shared.metadataStatusUploadError:
             cell.labelStatus.text = NSLocalizedString("_status_upload_error_", comment: "")
             cell.labelStatus.text = NSLocalizedString("_status_upload_error_", comment: "")
             cell.labelInfo.text = metadata.sessionError
             cell.labelInfo.text = metadata.sessionError

+ 1 - 1
iOSClient/Trash/Cell/NCTrashListCell+NCTrashCellProtocol.swift

@@ -162,7 +162,7 @@ extension NCTrashCellProtocol where Self: UICollectionViewCell {
             self.imageItem.image = NCBrandColor.cacheImages.folder
             self.imageItem.image = NCBrandColor.cacheImages.folder
         } else {
         } else {
             self.imageItem.image = image
             self.imageItem.image = image
-            self.labelInfo?.text = (self.labelInfo?.text ?? "") + " · " + CCUtility.transformedSize(tableTrash.size)
+            self.labelInfo?.text = (self.labelInfo?.text ?? "") + " · " + NCUtilityFileSystem.shared.transformedSize(tableTrash.size)
         }
         }
         self.accessibilityLabel = tableTrash.trashbinFileName + ", " + (self.labelInfo?.text ?? "")
         self.accessibilityLabel = tableTrash.trashbinFileName + ", " + (self.labelInfo?.text ?? "")
     }
     }

+ 2 - 2
iOSClient/Trash/NCTrash+CollectionView.swift

@@ -123,9 +123,9 @@ extension NCTrash: UICollectionViewDataSource {
         }
         }
 
 
         if files > 1 {
         if files > 1 {
-            filesText = "\(files) " + NSLocalizedString("_files_", comment: "") + " " + CCUtility.transformedSize(size)
+            filesText = "\(files) " + NSLocalizedString("_files_", comment: "") + " " + NCUtilityFileSystem.shared.transformedSize(size)
         } else if files == 1 {
         } else if files == 1 {
-            filesText = "1 " + NSLocalizedString("_file_", comment: "") + " " + CCUtility.transformedSize(size)
+            filesText = "1 " + NSLocalizedString("_file_", comment: "") + " " + NCUtilityFileSystem.shared.transformedSize(size)
         }
         }
 
 
         if foldersText.isEmpty {
         if foldersText.isEmpty {

+ 0 - 1
iOSClient/Utility/CCUtility.h

@@ -35,7 +35,6 @@
 @interface CCUtility : NSObject
 @interface CCUtility : NSObject
 
 
 + (NSString *)dateDiff:(NSDate *)convertedDate;
 + (NSString *)dateDiff:(NSDate *)convertedDate;
-+ (NSString *)transformedSize:(int64_t)value;
 
 
 + (NSString *)removeForbiddenCharactersServer:(NSString *)fileName;
 + (NSString *)removeForbiddenCharactersServer:(NSString *)fileName;
 
 

+ 0 - 6
iOSClient/Utility/CCUtility.m

@@ -71,12 +71,6 @@
     }
     }
 }
 }
 
 
-+ (NSString *)transformedSize:(int64_t)value
-{
-    NSString *string = [NSByteCountFormatter stringFromByteCount:value countStyle:NSByteCountFormatterCountStyleBinary];
-    return string;
-}
-
 // Remove do not forbidden characters for Nextcloud Server
 // Remove do not forbidden characters for Nextcloud Server
 + (NSString *)removeForbiddenCharactersServer:(NSString *)fileName
 + (NSString *)removeForbiddenCharactersServer:(NSString *)fileName
 {
 {

+ 6 - 0
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -434,6 +434,12 @@ class NCUtilityFileSystem: NSObject {
         return totalSize
         return totalSize
     }
     }
 
 
+    @objc func transformedSize(_ bytes: Int64) -> String {
+        let formatter: ByteCountFormatter = ByteCountFormatter()
+        formatter.countStyle = .binary
+        return formatter.string(fromByteCount: bytes)
+    }
+
     func cleanUp(directory: String, days: TimeInterval) {
     func cleanUp(directory: String, days: TimeInterval) {
 
 
         if days == 0 { return}
         if days == 0 { return}

+ 1 - 1
iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift

@@ -140,7 +140,7 @@ class NCViewerMediaDetailView: UIView {
         }
         }
 
 
         nameLabel.text = (metadata.fileNameView as NSString).deletingPathExtension
         nameLabel.text = (metadata.fileNameView as NSString).deletingPathExtension
-        sizeLabel.text = CCUtility.transformedSize(metadata.size)
+        sizeLabel.text = NCUtilityFileSystem.shared.transformedSize(metadata.size)
 
 
         if let shutterSpeedApex = exif.shutterSpeedApex {
         if let shutterSpeedApex = exif.shutterSpeedApex {
             prepareLensInfoViewsForData()
             prepareLensInfoViewsForData()