Browse Source

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 years ago
parent
commit
603075aa1f

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

@@ -1469,9 +1469,9 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             cell.fileUser = metadata.ownerId
             if isSearching {
                 if metadata.name == NCGlobal.shared.appName {
-                    cell.labelTitle.text = NCUtilityFileSystem.shared.getPath(metadata: metadata)
+                    cell.labelTitle.text = metadata.fileName
                     cell.labelTitle.lineBreakMode = .byTruncatingHead
-                    cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
+                    cell.labelInfo.text = NSLocalizedString("_in_", comment: "") + " " + NCUtilityFileSystem.shared.getPath(metadata: metadata, withFileName: false)
                 } else {
                     cell.labelTitle.text = metadata.fileName
                     cell.labelTitle.lineBreakMode = .byTruncatingTail

+ 1 - 1
iOSClient/Main/NCFunctionCenter.swift

@@ -624,7 +624,7 @@ import SVGKit
 
         let copyPath = UIAction(title: NSLocalizedString("_copy_path_", comment: ""), image: UIImage(systemName: "doc.on.clipboard")) { _ in
             let board = UIPasteboard.general
-            board.string = NCUtilityFileSystem.shared.getPath(metadata: metadata)
+            board.string = NCUtilityFileSystem.shared.getPath(metadata: metadata, withFileName: true)
             NCContentPresenter.shared.messageNotification("", description: "_copied_path_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.info, errorCode: NCGlobal.shared.errorNoError)
         }
 

+ 1 - 1
iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.xib

@@ -114,7 +114,7 @@
                         <constraint firstAttribute="height" constant="50" id="vvG-dH-6c1"/>
                     </constraints>
                 </view>
-                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LZu-Te-clJ">
+                <view alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LZu-Te-clJ">
                     <rect key="frame" x="0.0" y="99" width="551" height="1"/>
                     <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>

+ 1 - 1
iOSClient/Share/NCSharePaging.swift

@@ -325,7 +325,7 @@ class NCSharePagingView: PagingView {
                 headerView.imageView.image = UIImage(named: "file")
             }
         }
-        headerView.path.text = NCUtilityFileSystem.shared.getPath(metadata: metadata)
+        headerView.path.text = NCUtilityFileSystem.shared.getPath(metadata: metadata, withFileName: true)
         headerView.path.textColor = NCBrandColor.shared.label
         headerView.path.trailingBuffer = headerView.path.frame.width
         if metadata.favorite {

+ 4 - 2
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -165,9 +165,11 @@ class NCUtilityFileSystem: NSObject {
         return home
     }
 
-    @objc func getPath(metadata: tableMetadata) -> String {
+    @objc func getPath(metadata: tableMetadata, withFileName: Bool) -> String {
 
-        return metadata.path.replacingOccurrences(of: "/remote.php/dav/files/"+metadata.user, with: "") + metadata.fileName
+        var path = metadata.path.replacingOccurrences(of: "/remote.php/dav/files/"+metadata.user, with: "")
+        if withFileName { path += metadata.fileName }
+        return path
     }
 
     @objc func deletingLastPathComponent(account: String, serverUrl: String) -> String {