marinofaggiana 4 years ago
parent
commit
13e21746e5

+ 21 - 21
iOSClient/Favorites/NCFavorite.swift

@@ -38,10 +38,10 @@ class NCFavorite: UIViewController, UIGestureRecognizerDelegate, NCListCellDeleg
     
     private var sectionDatasource = CCSectionDataSourceMetadata()
     
-    private var typeLayout = ""
-    private var datasourceGroupBy = ""
-    private var datasourceTitleButton = ""
-    private var datasourceItemForLine = 0
+    private var layout = ""
+    private var groupBy = ""
+    private var titleButton = ""
+    private var itemForLine = 0
 
     private var autoUploadFileName = ""
     private var autoUploadDirectory = ""
@@ -103,9 +103,9 @@ class NCFavorite: UIViewController, UIGestureRecognizerDelegate, NCListCellDeleg
         autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
         autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(urlBase: appDelegate.urlBase, account: appDelegate.account)
         
-        (typeLayout, _, _, datasourceGroupBy, _, datasourceTitleButton, datasourceItemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_favorite)
+        (layout, _, _, groupBy, _, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_favorite)
         
-        if typeLayout == k_layout_list {
+        if layout == k_layout_list {
             collectionView.collectionViewLayout = listLayout
         } else {
             collectionView.collectionViewLayout = gridLayout
@@ -191,8 +191,8 @@ class NCFavorite: UIViewController, UIGestureRecognizerDelegate, NCListCellDeleg
                     self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: false)
                 })
             })
-            typeLayout = k_layout_list
-            NCUtility.shared.setLayoutForView(key: k_layout_view_favorite, layout: typeLayout)
+            layout = k_layout_list
+            NCUtility.shared.setLayoutForView(key: k_layout_view_favorite, layout: layout)
         } else {
             // grid layout
             UIView.animate(withDuration: 0.0, animations: {
@@ -202,8 +202,8 @@ class NCFavorite: UIViewController, UIGestureRecognizerDelegate, NCListCellDeleg
                     self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: false)
                 })
             })
-            typeLayout = k_layout_grid
-            NCUtility.shared.setLayoutForView(key: k_layout_view_favorite, layout: typeLayout)
+            layout = k_layout_grid
+            NCUtility.shared.setLayoutForView(key: k_layout_view_favorite, layout: layout)
         }
     }
     
@@ -273,7 +273,7 @@ extension NCFavorite: UIViewControllerPreviewingDelegate {
 
         viewController.metadata = metadata
 
-        if typeLayout == k_layout_grid {
+        if layout == k_layout_grid {
             guard let cell = collectionView?.cellForItem(at: indexPath) as? NCGridCell else { return nil }
             previewingContext.sourceRect = cell.frame
             viewController.imageFile = cell.imageItem.image
@@ -356,9 +356,9 @@ extension NCFavorite: UICollectionViewDataSource {
                 header.backgroundColor = NCBrandColor.sharedInstance.backgroundView
                 header.separator.backgroundColor = NCBrandColor.sharedInstance.separator
                 header.setStatusButton(count: sectionDatasource.allOcId.count)
-                header.setTitleSorted(datasourceTitleButton: self.datasourceTitleButton)
+                header.setTitleSorted(datasourceTitleButton: titleButton)
                 
-                if datasourceGroupBy == "none" {
+                if groupBy == "none" {
                     header.labelSection.isHidden = true
                     header.labelSectionHeightConstraint.constant = 0
                 } else {
@@ -418,7 +418,7 @@ extension NCFavorite: UICollectionViewDataSource {
             return collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
         }
         
-        if typeLayout == k_layout_grid {
+        if layout == k_layout_grid {
             cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell
         } else {
             cell = collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
@@ -437,7 +437,7 @@ extension NCFavorite: UICollectionViewDelegateFlowLayout {
 
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
         if section == 0 {
-            if datasourceGroupBy == "none" {
+            if groupBy == "none" {
                 return CGSize(width: collectionView.frame.width, height: headerMenuHeight)
             } else {
                 return CGSize(width: collectionView.frame.width, height: headerMenuHeight + sectionHeaderHeight)
@@ -463,22 +463,22 @@ extension NCFavorite {
 
     @objc func reloadDataSource() {
         
-        var datasourceSorted: String
-        var datasourceAscending: Bool
-        var datasourceDirectoryOnTop: Bool
+        var sort: String
+        var ascending: Bool
+        var directoryOnTop: Bool
         
         sectionDatasource = CCSectionDataSourceMetadata()
-        (typeLayout, datasourceSorted, datasourceAscending, datasourceGroupBy, datasourceDirectoryOnTop, datasourceTitleButton, datasourceItemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_favorite)
+        (layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_favorite)
         
         if serverUrl == "" {
             
             let metadatas = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND favorite == true", appDelegate.account))
-            sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: datasourceGroupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: true, sorted: datasourceSorted, ascending: datasourceAscending, directoryOnTop:datasourceDirectoryOnTop, account: appDelegate.account)
+            sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: groupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: true, sorted: sort, ascending: ascending, directoryOnTop: directoryOnTop, account: appDelegate.account)
             
         } else {
             
             let metadatas = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl))
-            sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: datasourceGroupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: true, sorted: datasourceSorted, ascending: datasourceAscending, directoryOnTop:datasourceDirectoryOnTop, account: appDelegate.account)
+            sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: groupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: true, sorted: sort, ascending: ascending, directoryOnTop: directoryOnTop, account: appDelegate.account)
         }
         
         collectionView.reloadData()

+ 21 - 21
iOSClient/Offline/NCOffline.swift

@@ -38,10 +38,10 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
     
     private var sectionDatasource = CCSectionDataSourceMetadata()
     
-    private var typeLayout = ""
-    private var datasourceGroupBy = ""
-    private var datasourceTitleButton = ""
-    private var datasourceItemForLine = 0
+    private var layout = ""
+    private var groupBy = ""
+    private var titleButton = ""
+    private var itemForLine = 0
 
     private var autoUploadFileName = ""
     private var autoUploadDirectory = ""
@@ -113,9 +113,9 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
         autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
         autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(urlBase: appDelegate.urlBase, account: appDelegate.account)
         
-        (typeLayout, _, _, datasourceGroupBy, _, datasourceTitleButton, datasourceItemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_offline)
+        (layout, _, _, groupBy, _, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_offline)
 
-        if typeLayout == k_layout_list {
+        if layout == k_layout_list {
             collectionView.collectionViewLayout = listLayout
         } else {
             collectionView.collectionViewLayout = gridLayout
@@ -193,8 +193,8 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
                     self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: false)
                 })
             })
-            typeLayout = k_layout_list
-            NCUtility.shared.setLayoutForView(key: k_layout_view_offline, layout: typeLayout)
+            layout = k_layout_list
+            NCUtility.shared.setLayoutForView(key: k_layout_view_offline, layout: layout)
         } else {
             // grid layout
             UIView.animate(withDuration: 0.0, animations: {
@@ -204,8 +204,8 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
                     self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: false)
                 })
             })
-            typeLayout = k_layout_grid
-            NCUtility.shared.setLayoutForView(key: k_layout_view_offline, layout: typeLayout)
+            layout = k_layout_grid
+            NCUtility.shared.setLayoutForView(key: k_layout_view_offline, layout: layout)
         }
     }
     
@@ -346,7 +346,7 @@ extension NCOffline: UIViewControllerPreviewingDelegate {
 
         viewController.metadata = metadata
 
-        if typeLayout == k_layout_grid {
+        if layout == k_layout_grid {
             guard let cell = collectionView?.cellForItem(at: indexPath) as? NCGridCell else { return nil }
             previewingContext.sourceRect = cell.frame
             viewController.imageFile = cell.imageItem.image
@@ -429,9 +429,9 @@ extension NCOffline: UICollectionViewDataSource {
                 header.backgroundColor = NCBrandColor.sharedInstance.backgroundView
                 header.separator.backgroundColor = NCBrandColor.sharedInstance.separator
                 header.setStatusButton(count: sectionDatasource.allOcId.count)
-                header.setTitleSorted(datasourceTitleButton: self.datasourceTitleButton)
+                header.setTitleSorted(datasourceTitleButton: titleButton)
                 
-                if datasourceGroupBy == "none" {
+                if groupBy == "none" {
                     header.labelSection.isHidden = true
                     header.labelSectionHeightConstraint.constant = 0
                 } else {
@@ -491,7 +491,7 @@ extension NCOffline: UICollectionViewDataSource {
             return collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
         }
         
-        if typeLayout == k_layout_grid {
+        if layout == k_layout_grid {
             cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell
         } else {
             cell = collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
@@ -510,7 +510,7 @@ extension NCOffline: UICollectionViewDelegateFlowLayout {
 
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
         if section == 0 {
-            if datasourceGroupBy == "none" {
+            if groupBy == "none" {
                 return CGSize(width: collectionView.frame.width, height: headerMenuHeight)
             } else {
                 return CGSize(width: collectionView.frame.width, height: headerMenuHeight + sectionHeaderHeight)
@@ -537,12 +537,12 @@ extension NCOffline {
     @objc func reloadDataSource() {
         
         var ocIds: [String] = []
-        var datasourceSorted: String
-        var datasourceAscending: Bool
-        var datasourceDirectoryOnTop: Bool
+        var sort: String
+        var ascending: Bool
+        var directoryOnTop: Bool
         
         sectionDatasource = CCSectionDataSourceMetadata()
-        (typeLayout, datasourceSorted, datasourceAscending, datasourceGroupBy, datasourceDirectoryOnTop, datasourceTitleButton, datasourceItemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_offline)
+        (layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_offline)
 
         if serverUrl == "" {
             
@@ -558,12 +558,12 @@ extension NCOffline {
             }
             
             let metadatas = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND ocId IN %@", appDelegate.account, ocIds))
-            sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: datasourceGroupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: true, sorted: datasourceSorted, ascending: datasourceAscending, directoryOnTop:datasourceDirectoryOnTop, account: appDelegate.account)
+            sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: groupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: true, sorted: sort, ascending: ascending, directoryOnTop: directoryOnTop, account: appDelegate.account)
             
         } else {
             
             let metadatas = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl))
-            sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: datasourceGroupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: true, sorted: datasourceSorted, ascending: datasourceAscending, directoryOnTop:datasourceDirectoryOnTop, account: appDelegate.account)
+            sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: groupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: true, sorted: sort, ascending: ascending, directoryOnTop: directoryOnTop, account: appDelegate.account)
         }
         
         self.refreshControl.endRefreshing()

+ 20 - 20
iOSClient/Select/NCSelect.swift

@@ -75,10 +75,10 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
     private var overwrite = false
     private var sectionDatasource = CCSectionDataSourceMetadata()
     
-    private var typeLayout = ""
-    private var datasourceGroupBy = ""
-    private var datasourceTitleButton = ""
-    private var datasourceItemForLine = 0
+    private var layout = ""
+    private var groupBy = ""
+    private var titleButton = ""
+    private var itemForLine = 0
 
     private var autoUploadFileName = ""
     private var autoUploadDirectory = ""
@@ -178,9 +178,9 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
         autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
         autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(urlBase: appDelegate.urlBase, account: appDelegate.account)
         
-        (typeLayout, _, _, datasourceGroupBy, _, datasourceTitleButton, datasourceItemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout)
+        (layout, _, _, groupBy, _, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout)
         
-        if typeLayout == k_layout_list {
+        if layout == k_layout_list {
             collectionView.collectionViewLayout = listLayout
         } else {
             collectionView.collectionViewLayout = gridLayout
@@ -300,8 +300,8 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
                     self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: false)
                 })
             })
-            typeLayout = k_layout_list
-            NCUtility.shared.setLayoutForView(key: keyLayout, layout: typeLayout)
+            layout = k_layout_list
+            NCUtility.shared.setLayoutForView(key: keyLayout, layout: layout)
         } else {
             // grid layout
             UIView.animate(withDuration: 0.0, animations: {
@@ -311,8 +311,8 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
                     self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: false)
                 })
             })
-            typeLayout = k_layout_grid
-            NCUtility.shared.setLayoutForView(key: keyLayout, layout: typeLayout)
+            layout = k_layout_grid
+            NCUtility.shared.setLayoutForView(key: keyLayout, layout: layout)
         }
     }
     
@@ -409,9 +409,9 @@ extension NCSelect: UICollectionViewDataSource {
                 header.delegate = self
                 
                 header.setStatusButton(count: sectionDatasource.allOcId.count)
-                header.setTitleSorted(datasourceTitleButton: self.datasourceTitleButton)
+                header.setTitleSorted(datasourceTitleButton: titleButton)
                 
-                if datasourceGroupBy == "none" {
+                if groupBy == "none" {
                     header.labelSection.isHidden = true
                     header.labelSectionHeightConstraint.constant = 0
                 } else {
@@ -471,7 +471,7 @@ extension NCSelect: UICollectionViewDataSource {
             return collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
         }
         
-        if typeLayout == k_layout_grid {
+        if layout == k_layout_grid {
             cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell
         } else {
             cell = collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
@@ -479,7 +479,7 @@ extension NCSelect: UICollectionViewDataSource {
         
         NCMainCommon.sharedInstance.collectionViewCellForItemAt(indexPath, collectionView: collectionView, cell: cell, metadata: metadata, metadataFolder: metadataFolder, serverUrl: serverUrl, isEditMode: isEditMode, selectocId: selectocId, autoUploadFileName: autoUploadFileName, autoUploadDirectory: autoUploadDirectory ,hideButtonMore: true, downloadThumbnail: true, shares: shares, source: self)
         
-        if typeLayout == k_layout_grid {
+        if layout == k_layout_grid {
             let cell = cell as! NCGridCell
             cell.buttonMore.isHidden = true
             
@@ -498,7 +498,7 @@ extension NCSelect: UICollectionViewDelegateFlowLayout {
 
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
         if section == 0 {
-            if datasourceGroupBy == "none" {
+            if groupBy == "none" {
                 return CGSize(width: collectionView.frame.width, height: headerMenuHeight)
             } else {
                 return CGSize(width: collectionView.frame.width, height: headerMenuHeight + sectionHeaderHeight)
@@ -529,12 +529,12 @@ extension NCSelect {
     @objc func loadDatasource(withLoadFolder: Bool) {
         
         var predicate: NSPredicate?
-        var datasourceSorted: String
-        var datasourceAscending: Bool
-        var datasourceDirectoryOnTop: Bool
+        var sort: String
+        var ascending: Bool
+        var directoryOnTop: Bool
         
         sectionDatasource = CCSectionDataSourceMetadata()
-        (typeLayout, datasourceSorted, datasourceAscending, datasourceGroupBy, datasourceDirectoryOnTop, datasourceTitleButton, datasourceItemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout)
+        (layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout)
         
         if serverUrl == "" {
             
@@ -559,7 +559,7 @@ extension NCSelect {
         }
         
         let metadatas = NCManageDatabase.sharedInstance.getMetadatas(predicate: predicate!)
-        sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: datasourceGroupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: false, sorted: datasourceSorted, ascending: datasourceAscending, directoryOnTop:datasourceDirectoryOnTop, account: appDelegate.account)
+        sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: groupBy, filterTypeFileImage: false, filterTypeFileVideo: false, filterLivePhoto: false, sorted: sort, ascending: ascending, directoryOnTop: directoryOnTop, account: appDelegate.account)
         
         if withLoadFolder {
             loadFolder()

+ 15 - 15
iOSClient/Trash/NCTrash.swift

@@ -39,10 +39,10 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
     
     private var datasource: [tableTrash] = []
     
-    private var typeLayout = ""
-    private var datasourceGroupBy = "none"
-    private var datasourceTitleButton = ""
-    private var datasourceItemForLine = 0
+    private var layout = ""
+    private var groupBy = "none"
+    private var titleButton = ""
+    private var itemForLine = 0
 
     private var listLayout: NCListLayout!
     private var gridLayout: NCGridLayout!
@@ -88,9 +88,9 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
         
         self.navigationItem.title = titleCurrentFolder
 
-        (typeLayout, _, _, datasourceGroupBy, _, datasourceTitleButton, datasourceItemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_trash)
+        (layout, _, _, groupBy, _, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_trash)
 
-        if typeLayout == k_layout_list {
+        if layout == k_layout_list {
             collectionView.collectionViewLayout = listLayout
         } else {
             collectionView.collectionViewLayout = gridLayout
@@ -164,8 +164,8 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
                     self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: false)
                 })
             })
-            typeLayout = k_layout_list
-            NCUtility.shared.setLayoutForView(key: k_layout_view_trash, layout: typeLayout)
+            layout = k_layout_list
+            NCUtility.shared.setLayoutForView(key: k_layout_view_trash, layout: layout)
         } else {
             // grid layout
             UIView.animate(withDuration: 0.0, animations: {
@@ -175,8 +175,8 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
                     self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: false)
                 })
             })
-            typeLayout = k_layout_grid
-            NCUtility.shared.setLayoutForView(key: k_layout_view_trash, layout: typeLayout)
+            layout = k_layout_grid
+            NCUtility.shared.setLayoutForView(key: k_layout_view_trash, layout: layout)
         }
     }
     
@@ -423,7 +423,7 @@ extension NCTrash: UICollectionViewDataSource {
             trashHeader.backgroundColor = NCBrandColor.sharedInstance.backgroundView
             trashHeader.separator.backgroundColor = NCBrandColor.sharedInstance.separator
             trashHeader.setStatusButton(datasource: datasource)
-            trashHeader.setTitleSorted(datasourceTitleButton: self.datasourceTitleButton)
+            trashHeader.setTitleSorted(datasourceTitleButton: titleButton)
             
             return trashHeader
             
@@ -555,14 +555,14 @@ extension NCTrash {
 
     @objc func reloadDataSource() {
         
-        var datasourceSorted: String
-        var datasourceAscending: Bool
+        var sort: String
+        var ascending: Bool
         
-        (typeLayout, datasourceSorted, datasourceAscending, datasourceGroupBy, _, datasourceTitleButton, datasourceItemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_trash)
+        (layout, sort, ascending, groupBy, _, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: k_layout_view_trash)
         
         datasource.removeAll()
         
-        guard let tashItems = NCManageDatabase.sharedInstance.getTrash(filePath: path, sorted: datasourceSorted, ascending: datasourceAscending, account: appDelegate.account) else {
+        guard let tashItems = NCManageDatabase.sharedInstance.getTrash(filePath: path, sorted: sort, ascending: ascending, account: appDelegate.account) else {
             return
         }