瀏覽代碼

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 年之前
父節點
當前提交
f230967505

+ 3 - 1
.swiftlint.yml

@@ -24,7 +24,9 @@ type_body_length:
 
 identifier_name:
   min_length: 0
-
+  
+disabled_rules:  
+ - unused_setter_value
 
 excluded:
   - Carthage

+ 2 - 35
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -598,6 +598,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 if progressNumber.floatValue == 1 {
                     cell.progress?.isHidden = true
                     cell.progress?.progress = .zero
+                    cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCBrandColor.cacheImages.buttonMore)
                     if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
                         cell.writeInfoDateSize(date: metadata.date, totalBytes: metadata.size)
                     } else {
@@ -606,6 +607,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 } else {
                     cell.progress?.isHidden = false
                     cell.progress?.progress = progressNumber.floatValue
+                    cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
                     if status == NCGlobal.shared.metadataStatusInDownload {
                         cell.info = CCUtility.transformedSize(totalBytesExpected) + " - ↓ " + CCUtility.transformedSize(totalBytes)
                     } else if status == NCGlobal.shared.metadataStatusInUpload {
@@ -613,41 +615,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                     }
                 }
             }
-            /*
-            if cell is NCListCell {
-                let cell = cell as! NCListCell
-                if progressNumber.floatValue == 1 {
-                    cell.progressView?.isHidden = true
-                    cell.progressView?.progress = .zero
-                    cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCBrandColor.cacheImages.buttonMore)
-                    if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
-                        cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
-                    } else {
-                        cell.labelInfo.text = ""
-                    }
-                } else if progressNumber.floatValue > 0 {
-                    cell.progressView?.isHidden = false
-                    cell.progressView?.progress = progressNumber.floatValue
-                    cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
-                    if status == NCGlobal.shared.metadataStatusInDownload {
-                        cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↓ " + CCUtility.transformedSize(totalBytes)
-                    } else if status == NCGlobal.shared.metadataStatusInUpload {
-                        cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↑ " + CCUtility.transformedSize(totalBytes)
-                    }
-                }
-            } else if cell is NCGridCell {
-                let cell = cell as! NCGridCell
-                if progressNumber.floatValue == 1 {
-                    cell.progressView.isHidden = true
-                    cell.progressView.progress = .zero
-                    cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCBrandColor.cacheImages.buttonMore)
-                } else if progressNumber.floatValue > 0 {
-                    cell.progressView.isHidden = false
-                    cell.progressView.progress = progressNumber.floatValue
-                    cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
-                }
-            }
-            */
         }
     }
 

+ 1 - 1
iOSClient/Share/NCShareCommentsCell.swift

@@ -67,7 +67,7 @@ class NCShareCommentsCell: UITableViewCell, NCCellProtocol {
         }
         set { }
     }
-    
+
     override func awakeFromNib() {
         super.awakeFromNib()
 

+ 2 - 2
iOSClient/Share/NCShareUserCell.swift

@@ -65,7 +65,7 @@ class NCShareUserCell: UITableViewCell, NCCellProtocol {
         }
         set { }
     }
-    
+
     func setupCellUI(userId: String) {
         guard let tableShare = tableShare else {
             return
@@ -185,7 +185,7 @@ class NCSearchUserDropDownCell: DropDownCell, NCCellProtocol {
         }
         set { }
     }
-    
+
     func setupCell(sharee: NCCommunicationSharee, baseUrl: NCUserBaseUrl) {
         imageItem.image = NCShareCommon.shared.getImageShareType(shareType: sharee.shareType)
         imageShareeType.image = NCShareCommon.shared.getImageShareType(shareType: sharee.shareType)

+ 0 - 33
iOSClient/Transfers/NCTransfers.swift

@@ -89,39 +89,6 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
         reloadDataSource()
     }
 
-    override func triggerProgressTask(_ notification: NSNotification) {
-
-        guard let userInfo = notification.userInfo as NSDictionary?,
-              let progressNumber = userInfo["progress"] as? NSNumber,
-              let totalBytes = userInfo["totalBytes"] as? Int64,
-              let totalBytesExpected = userInfo["totalBytesExpected"] as? Int64,
-              let ocId = userInfo["ocId"] as? String,
-              let (indexPath, _) = self.dataSource.getIndexPathMetadata(ocId: ocId) as? (IndexPath, NCMetadatasForSection?)
-        else {
-            return
-        }
-        let status = userInfo["status"] as? Int ?? NCGlobal.shared.metadataStatusNormal
-
-        if let cell = collectionView?.cellForItem(at: indexPath) {
-            let cell = cell as! NCTransferCell
-            if progressNumber.floatValue == 1 {
-                cell.progressView?.isHidden = true
-                cell.progressView?.progress = .zero
-                cell.buttonMore.isHidden = true
-                cell.labelInfo.text = ""
-            } else if progressNumber.floatValue > 0 {
-                cell.progressView?.isHidden = false
-                cell.progressView?.progress = progressNumber.floatValue
-                cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
-                if status == NCGlobal.shared.metadataStatusInDownload {
-                    cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↓ " + CCUtility.transformedSize(totalBytes)
-                } else if status == NCGlobal.shared.metadataStatusInUpload {
-                    cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↑ " + CCUtility.transformedSize(totalBytes)
-                }
-            }
-        }
-    }
-
     // MARK: TAP EVENT
 
     override func longPressMoreListItem(with objectId: String, namedButtonMore: String, gestureRecognizer: UILongPressGestureRecognizer) {