Explorar el Código

yesssss !!!! REMOVE CCMAIN

marinofaggiana hace 4 años
padre
commit
693ea94103
Se han modificado 33 ficheros con 56 adiciones y 4164 borrados
  1. 0 1
      Cartfile
  2. 0 43
      Nextcloud.xcodeproj/project.pbxproj
  3. 2 2
      iOSClient/Activity/NCActivity.swift
  4. 1 2
      iOSClient/AppDelegate.h
  5. 8 10
      iOSClient/AppDelegate.m
  6. 0 1
      iOSClient/CCGlobal.h
  7. 9 0
      iOSClient/Files/NCFiles.swift
  8. 0 60
      iOSClient/Main/CCMain+Swift.swift
  9. 0 85
      iOSClient/Main/CCMain.h
  10. 0 2228
      iOSClient/Main/CCMain.m
  11. 0 67
      iOSClient/Main/CCSection.h
  12. 0 354
      iOSClient/Main/CCSection.m
  13. 0 74
      iOSClient/Main/Cell/CCCellMain.swift
  14. 0 136
      iOSClient/Main/Cell/CCCellMain.xib
  15. 0 55
      iOSClient/Main/Cell/CCCellMainTransfer.swift
  16. 0 108
      iOSClient/Main/Cell/CCCellMainTransfer.xib
  17. 4 4
      iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift
  18. 17 42
      iOSClient/Main/Main.storyboard
  19. 0 401
      iOSClient/Main/Menu/CCMain+Menu.swift
  20. 0 17
      iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift
  21. 1 1
      iOSClient/Main/NCDetailViewController.swift
  22. 0 456
      iOSClient/Main/NCMainCommon.swift
  23. 3 7
      iOSClient/Networking/NCNetworkingNotificationCenter.swift
  24. 1 1
      iOSClient/Networking/NCService.swift
  25. 2 0
      iOSClient/Nextcloud-Bridging-Header.h
  26. 1 1
      iOSClient/PeekPop/CCPeekPop.m
  27. 1 1
      iOSClient/RichWorkspace/NCViewerRichWorkspace.swift
  28. 1 1
      iOSClient/Settings/CCAdvanced.m
  29. 0 1
      iOSClient/Settings/CCManageAutoUpload.h
  30. 0 1
      iOSClient/Settings/CCSettings.m
  31. 1 1
      iOSClient/Viewer/NCViewerNextcloudText.swift
  32. 3 2
      iOSClient/Viewer/NCViewerQuickLook.swift
  33. 1 1
      iOSClient/Viewer/NCViewerRichdocument.swift

+ 0 - 1
Cartfile

@@ -1,7 +1,6 @@
 github "nextcloud/ios-communication-library" "v0.79"
 github "tilltue/TLPhotoPicker" "2.0.12"
 github "kishikawakatsumi/UICKeyChainStore"
-github "MortimerGoro/MGSwipeTableCell" "1.6.8"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
 github "jdg/MBProgressHUD" "1.1.0"
 github "SVGKit/SVGKit" "3.x"

+ 0 - 43
Nextcloud.xcodeproj/project.pbxproj

@@ -14,16 +14,12 @@
 		2C33C48623E2C475005F963B /* Notification Service Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 2C33C47F23E2C475005F963B /* Notification Service Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
 		2CB7D1CA23E2EDCB00376EF9 /* NCPushNotificationEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */; };
 		3704EB2A23D5A58400455C5B /* NCMenu.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3704EB2923D5A58400455C5B /* NCMenu.storyboard */; };
-		370D26AD248A3BB800121797 /* CCCellMainTransfer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D26AC248A3BB800121797 /* CCCellMainTransfer.swift */; };
 		370D26AF248A3D7A00121797 /* NCImageCellProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D26AE248A3D7A00121797 /* NCImageCellProtocol.swift */; };
-		370D26B1248A3E1A00121797 /* CCCellMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D26B0248A3E1A00121797 /* CCCellMain.swift */; };
 		371B5A2E23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 371B5A2D23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift */; };
 		371B5A3323D0BD5500FAFAE9 /* FloatingPanel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 371B5A3223D0BD5500FAFAE9 /* FloatingPanel.framework */; };
 		3757A35523D9D76300EC369E /* NCMenuPanelController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3757A35423D9D76300EC369E /* NCMenuPanelController.swift */; };
 		3781B9B023DB2B7E006B4B1D /* AppDelegate+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */; };
-		3781B9B223DB2B9F006B4B1D /* CCMain+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9B123DB2B9F006B4B1D /* CCMain+Menu.swift */; };
 		37C83A0D24532B7200618A3B /* AppDelegate+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C83A0C24532B7200618A3B /* AppDelegate+Swift.swift */; };
-		37C83A0F24532BA600618A3B /* CCMain+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C83A0E24532BA600618A3B /* CCMain+Swift.swift */; };
 		37ECC83B23D0C7410082EFA2 /* NCMenuAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37ECC83A23D0C7400082EFA2 /* NCMenuAction.swift */; };
 		F70006FA24164F8D00F214A5 /* NCViewerImageVideo.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F70006F924164F8D00F214A5 /* NCViewerImageVideo.storyboard */; };
 		F70006FC2416500B00F214A5 /* NCViewerImageVideo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70006FB2416500B00F214A5 /* NCViewerImageVideo.swift */; };
@@ -183,7 +179,6 @@
 		F774DF111FCC26BE002AF9FC /* iTunesArtwork@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F774DF0E1FCC26BE002AF9FC /* iTunesArtwork@3x.png */; };
 		F77A697D250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = F77A697C250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift */; };
 		F77B0DF21D118A16002130FE /* CCUploadFromOtherUpp.m in Sources */ = {isa = PBXBuildFile; fileRef = F7956FCA1B4886E60085DEA3 /* CCUploadFromOtherUpp.m */; };
-		F77B0DF41D118A16002130FE /* CCMain.m in Sources */ = {isa = PBXBuildFile; fileRef = F70211FB1BAC56E9003FC03E /* CCMain.m */; };
 		F77B0DF51D118A16002130FE /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; };
 		F77B0E1B1D118A16002130FE /* CCGraphics.m in Sources */ = {isa = PBXBuildFile; fileRef = F76C3B841C6388BC00DC4301 /* CCGraphics.m */; };
 		F77B0E221D118A16002130FE /* CCManageLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BFCCC11B68C21900548E76 /* CCManageLocation.m */; };
@@ -191,7 +186,6 @@
 		F77B0E311D118A16002130FE /* CCExifGeo.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A54C351C6267B500E2C8BF /* CCExifGeo.m */; };
 		F77B0E4F1D118A16002130FE /* CCManageAutoUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE42F1BAC0268006C0017 /* CCManageAutoUpload.m */; };
 		F77B0E5F1D118A16002130FE /* CCSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE4311BAC0268006C0017 /* CCSettings.m */; };
-		F77B0E8F1D118A16002130FE /* CCSection.m in Sources */ = {isa = PBXBuildFile; fileRef = F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */; };
 		F77B0E981D118A16002130FE /* CCManageAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE42D1BAC0268006C0017 /* CCManageAccount.m */; };
 		F77B0EA61D118A16002130FE /* NSString+TruncateToWidth.m in Sources */ = {isa = PBXBuildFile; fileRef = F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */; };
 		F77B0ED11D118A16002130FE /* Acknowledgements.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE42A1BAC0268006C0017 /* Acknowledgements.m */; };
@@ -201,8 +195,6 @@
 		F77B0F611D118A16002130FE /* Acknowledgements.rtf in Resources */ = {isa = PBXBuildFile; fileRef = F7ACE42B1BAC0268006C0017 /* Acknowledgements.rtf */; };
 		F77B0F631D118A16002130FE /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7E70DE91A24DE4100E1B66A /* Localizable.strings */; };
 		F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7F67BB81A24D27800EE80DA /* Images.xcassets */; };
-		F77B0F8A1D118A16002130FE /* CCCellMain.xib in Resources */ = {isa = PBXBuildFile; fileRef = F70211F61BAC56E9003FC03E /* CCCellMain.xib */; };
-		F77B0F8C1D118A16002130FE /* CCCellMainTransfer.xib in Resources */ = {isa = PBXBuildFile; fileRef = F70211F91BAC56E9003FC03E /* CCCellMainTransfer.xib */; };
 		F77D49A91DC238E500CDC568 /* loading.gif in Resources */ = {isa = PBXBuildFile; fileRef = F77D49A71DC238E500CDC568 /* loading.gif */; };
 		F78071091EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m in Sources */ = {isa = PBXBuildFile; fileRef = F78071081EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m */; };
 		F780710A1EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m in Sources */ = {isa = PBXBuildFile; fileRef = F78071081EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m */; };
@@ -269,7 +261,6 @@
 		F7BAADCC1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */; };
 		F7BF1B431D51E893000854F6 /* CCLogin.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BF1B401D51E893000854F6 /* CCLogin.m */; };
 		F7C1EEA525053A9C00866ACC /* NCDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7C1EEA425053A9C00866ACC /* NCDataSource.swift */; };
-		F7C40BE521998D5B0004137E /* MGSwipeTableCell.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7C40BE421998D5A0004137E /* MGSwipeTableCell.framework */; };
 		F7C40BE721998F410004137E /* DZNEmptyDataSet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7C40BE621998F410004137E /* DZNEmptyDataSet.framework */; };
 		F7C40BEF219994ED0004137E /* KTVCocoaHTTPServer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7C40BEE219994ED0004137E /* KTVCocoaHTTPServer.framework */; };
 		F7C40BF1219994F20004137E /* KTVHTTPCache.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7C40BF0219994F20004137E /* KTVHTTPCache.framework */; };
@@ -289,7 +280,6 @@
 		F7CBC31C24F78E79004D3812 /* NCSortMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7CBC31B24F78E79004D3812 /* NCSortMenu.swift */; };
 		F7D1612023CF19E30039EBBF /* NCViewerRichWorkspace.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7D1611F23CF19E30039EBBF /* NCViewerRichWorkspace.storyboard */; };
 		F7D2C773246470CA008513AE /* XLForm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7D2C772246470CA008513AE /* XLForm.framework */; };
-		F7D6650720FF341600BFBA9E /* NCMainCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7D6650620FF341600BFBA9E /* NCMainCommon.swift */; };
 		F7D96FCC246ED7E200536D73 /* NCNetworkingCheckRemoteUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7D96FCB246ED7E100536D73 /* NCNetworkingCheckRemoteUser.swift */; };
 		F7DBC37C23325E02001A85BA /* NCAppConfigView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DBC37B23325E01001A85BA /* NCAppConfigView.swift */; };
 		F7DBD82C23E46A4700ECB7C6 /* MarkdownKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7DBD82B23E46A4700ECB7C6 /* MarkdownKit.framework */; };
@@ -363,16 +353,12 @@
 		2C33C48123E2C475005F963B /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
 		2C33C48A23E2CC26005F963B /* Notification_Service_Extension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Notification_Service_Extension-Bridging-Header.h"; sourceTree = "<group>"; };
 		3704EB2923D5A58400455C5B /* NCMenu.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCMenu.storyboard; sourceTree = "<group>"; };
-		370D26AC248A3BB800121797 /* CCCellMainTransfer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CCCellMainTransfer.swift; sourceTree = "<group>"; };
 		370D26AE248A3D7A00121797 /* NCImageCellProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageCellProtocol.swift; sourceTree = "<group>"; };
-		370D26B0248A3E1A00121797 /* CCCellMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CCCellMain.swift; sourceTree = "<group>"; };
 		371B5A2D23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMainMenuTableViewController.swift; sourceTree = "<group>"; };
 		371B5A3223D0BD5500FAFAE9 /* FloatingPanel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FloatingPanel.framework; path = Carthage/Build/iOS/FloatingPanel.framework; sourceTree = "<group>"; };
 		3757A35423D9D76300EC369E /* NCMenuPanelController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMenuPanelController.swift; sourceTree = "<group>"; };
 		3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Menu.swift"; sourceTree = "<group>"; };
-		3781B9B123DB2B9F006B4B1D /* CCMain+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CCMain+Menu.swift"; sourceTree = "<group>"; };
 		37C83A0C24532B7200618A3B /* AppDelegate+Swift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Swift.swift"; sourceTree = "<group>"; };
-		37C83A0E24532BA600618A3B /* CCMain+Swift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CCMain+Swift.swift"; sourceTree = "<group>"; };
 		37ECC83A23D0C7400082EFA2 /* NCMenuAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMenuAction.swift; sourceTree = "<group>"; };
 		F70006F924164F8D00F214A5 /* NCViewerImageVideo.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCViewerImageVideo.storyboard; sourceTree = "<group>"; };
 		F70006FB2416500B00F214A5 /* NCViewerImageVideo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewerImageVideo.swift; sourceTree = "<group>"; };
@@ -381,10 +367,6 @@
 		F700510222DF6897003A3356 /* Parchment.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Parchment.framework; path = Carthage/Build/iOS/Parchment.framework; sourceTree = "<group>"; };
 		F700510422DF6A89003A3356 /* NCShare.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShare.swift; sourceTree = "<group>"; };
 		F7020FCD2233D7F700B7297D /* NCCreateFormUploadVoiceNote.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadVoiceNote.swift; sourceTree = "<group>"; };
-		F70211F61BAC56E9003FC03E /* CCCellMain.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CCCellMain.xib; sourceTree = "<group>"; };
-		F70211F91BAC56E9003FC03E /* CCCellMainTransfer.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CCCellMainTransfer.xib; sourceTree = "<group>"; };
-		F70211FA1BAC56E9003FC03E /* CCMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMain.h; sourceTree = "<group>"; };
-		F70211FB1BAC56E9003FC03E /* CCMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CCMain.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
 		F70460512499061800BB98A7 /* NotificationCenter+MainThread.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationCenter+MainThread.swift"; sourceTree = "<group>"; };
 		F704B5E22430AA6F00632F5F /* NCCreateFormUploadConflict.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCCreateFormUploadConflict.storyboard; sourceTree = "<group>"; };
 		F704B5E42430AA8000632F5F /* NCCreateFormUploadConflict.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadConflict.swift; sourceTree = "<group>"; };
@@ -596,8 +578,6 @@
 		F78D6F4D1F0B7CE4002F9619 /* nb-NO */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "nb-NO"; path = "nb-NO.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		F78D6F541F0B7D47002F9619 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F78E7064219F096B006F23E4 /* NCAvatar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAvatar.swift; sourceTree = "<group>"; };
-		F78F6FAE1CC8CCB700F4EA25 /* CCSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSection.h; sourceTree = "<group>"; };
-		F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSection.m; sourceTree = "<group>"; };
 		F78F74332163757000C2ADAD /* NCTrash.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCTrash.storyboard; sourceTree = "<group>"; };
 		F78F74352163781100C2ADAD /* NCTrash.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTrash.swift; sourceTree = "<group>"; };
 		F790110D21415BF600D7B136 /* NCViewerRichdocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewerRichdocument.swift; sourceTree = "<group>"; };
@@ -700,7 +680,6 @@
 		F7D532541F5D4155006568B1 /* sk-SK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sk-SK"; path = "sk-SK.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		F7D5328F1F5D443B006568B1 /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		F7D532A41F5D4461006568B1 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
-		F7D6650620FF341600BFBA9E /* NCMainCommon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMainCommon.swift; sourceTree = "<group>"; };
 		F7D96FCB246ED7E100536D73 /* NCNetworkingCheckRemoteUser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCNetworkingCheckRemoteUser.swift; sourceTree = "<group>"; };
 		F7DBC37B23325E01001A85BA /* NCAppConfigView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCAppConfigView.swift; sourceTree = "<group>"; };
 		F7DBD82B23E46A4700ECB7C6 /* MarkdownKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MarkdownKit.framework; path = Carthage/Build/iOS/MarkdownKit.framework; sourceTree = "<group>"; };
@@ -772,7 +751,6 @@
 				F79918A221997FA300C2E308 /* UICKeyChainStore.framework in Frameworks */,
 				F733B65221997CC2001C1FFA /* TLPhotoPicker.framework in Frameworks */,
 				F7AF7633246BEDFE00B86E3C /* TOPasscodeViewController.framework in Frameworks */,
-				F7C40BE521998D5B0004137E /* MGSwipeTableCell.framework in Frameworks */,
 				F745B251222D871800346520 /* QRCodeReader.framework in Frameworks */,
 				F710C5F02471A6D1009AD8B7 /* Sentry.framework in Frameworks */,
 				F765608723BF806D00765969 /* QuickLayout.framework in Frameworks */,
@@ -814,7 +792,6 @@
 			children = (
 				3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */,
 				F77A697C250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift */,
-				3781B9B123DB2B9F006B4B1D /* CCMain+Menu.swift */,
 				F7CBC31B24F78E79004D3812 /* NCSortMenu.swift */,
 				F710D2012405826100A6033D /* NCDetailNavigationController+Menu.swift */,
 				371B5A2D23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift */,
@@ -834,19 +811,13 @@
 				F7DFB7E9219C5A0500680748 /* Create cloud */,
 				F78ACD50219046AC0088454D /* Section */,
 				F72FCC01250CB8E7005E8D88 /* Collection */,
-				F70211FA1BAC56E9003FC03E /* CCMain.h */,
-				F70211FB1BAC56E9003FC03E /* CCMain.m */,
 				F73F537E1E929C8500F8678D /* CCMore.swift */,
-				F78F6FAE1CC8CCB700F4EA25 /* CCSection.h */,
-				F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */,
 				F7C1EEA425053A9C00866ACC /* NCDataSource.swift */,
 				F7226EDB1EE4089300EBECB1 /* Main.storyboard */,
 				F710D1F624057C9400A6033D /* NCDetailNavigationController.swift */,
 				37C83A0C24532B7200618A3B /* AppDelegate+Swift.swift */,
 				F7ECFB7D251F67E500EDBC17 /* NCMainTabBarController.swift */,
-				37C83A0E24532BA600618A3B /* CCMain+Swift.swift */,
 				F710D1F824057C9D00A6033D /* NCDetailViewController.swift */,
-				F7D6650620FF341600BFBA9E /* NCMainCommon.swift */,
 				F7E09CE223E3087F00FB3E9E /* NCMainRefreshControl.swift */,
 				F7682FDF23C36B0500983A04 /* NCMainTabBar.swift */,
 				F7E09CE623E308AD00FB3E9E /* NCMasterNavigationController.swift */,
@@ -1060,10 +1031,6 @@
 		F78ACD3E21903BA20088454D /* Cell */ = {
 			isa = PBXGroup;
 			children = (
-				370D26B0248A3E1A00121797 /* CCCellMain.swift */,
-				F70211F61BAC56E9003FC03E /* CCCellMain.xib */,
-				370D26AC248A3BB800121797 /* CCCellMainTransfer.swift */,
-				F70211F91BAC56E9003FC03E /* CCCellMainTransfer.xib */,
 				370D26AE248A3D7A00121797 /* NCImageCellProtocol.swift */,
 				F78ACD3F21903CC20088454D /* NCGridCell.swift */,
 				F78ACD4521903D010088454D /* NCGridCell.xib */,
@@ -1874,9 +1841,7 @@
 				F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */,
 				F73CB3B222E072A000AD728E /* NCShareHeaderView.xib in Resources */,
 				F7AE00FA230E81EB007ACF8A /* NCBrowserWeb.storyboard in Resources */,
-				F77B0F8A1D118A16002130FE /* CCCellMain.xib in Resources */,
 				F78ACD58219048040088454D /* NCSectionHeaderMenu.xib in Resources */,
-				F77B0F8C1D118A16002130FE /* CCCellMainTransfer.xib in Resources */,
 				F70006FA24164F8D00F214A5 /* NCViewerImageVideo.storyboard in Resources */,
 				F774DF101FCC26BE002AF9FC /* iTunesArtwork@2x.png in Resources */,
 				F7501C322212E57500FB1415 /* NCMedia.storyboard in Resources */,
@@ -1896,7 +1861,6 @@
 			inputPaths = (
 				"$(SRCROOT)/Carthage/Build/iOS/TLPhotoPicker.framework",
 				"$(SRCROOT)/Carthage/Build/iOS/UICKeyChainStore.framework",
-				"$(SRCROOT)/Carthage/Build/iOS/MGSwipeTableCell.framework",
 				"$(SRCROOT)/Carthage/Build/iOS/DZNEmptyDataSet.framework",
 				"$(SRCROOT)/Carthage/Build/iOS/KTVHTTPCache.framework",
 				"$(SRCROOT)/Carthage/Build/iOS/KTVCocoaHTTPServer.framework",
@@ -2013,16 +1977,13 @@
 				F77B0DF21D118A16002130FE /* CCUploadFromOtherUpp.m in Sources */,
 				F77444F522281649000D5EB0 /* NCGridMediaCell.swift in Sources */,
 				F7E09CE323E3088000FB3E9E /* NCMainRefreshControl.swift in Sources */,
-				F77B0DF41D118A16002130FE /* CCMain.m in Sources */,
 				F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */,
 				F7250C76251C95B4005CF12F /* NCDatabaseJSON.swift in Sources */,
 				F70A58BE24D0349500DED00D /* NCCapabilitiesViewController.swift in Sources */,
 				370D26AF248A3D7A00121797 /* NCImageCellProtocol.swift in Sources */,
-				37C83A0F24532BA600618A3B /* CCMain+Swift.swift in Sources */,
 				F77B0DF51D118A16002130FE /* CCUtility.m in Sources */,
 				F710D1FE24057E5E00A6033D /* NCActionSheetHeader.swift in Sources */,
 				F790110E21415BF600D7B136 /* NCViewerRichdocument.swift in Sources */,
-				370D26AD248A3BB800121797 /* CCCellMainTransfer.swift in Sources */,
 				F78ACD4021903CC20088454D /* NCGridCell.swift in Sources */,
 				37ECC83B23D0C7410082EFA2 /* NCMenuAction.swift in Sources */,
 				F75B0ABD244C4DBB00E58DCA /* NCNetworkingNotificationCenter.swift in Sources */,
@@ -2059,7 +2020,6 @@
 				F704B5E92430C0B800632F5F /* NCCreateFormUploadConflictCell.swift in Sources */,
 				F72D404923D2082500A97FD0 /* NCViewerNextcloudText.swift in Sources */,
 				F77B0E221D118A16002130FE /* CCManageLocation.m in Sources */,
-				F7D6650720FF341600BFBA9E /* NCMainCommon.swift in Sources */,
 				F700510522DF6A89003A3356 /* NCShare.swift in Sources */,
 				F7CA1ED120E7E3FE002CC65E /* PKCircleProgressView.m in Sources */,
 				F72D1007210B6882009C96B7 /* NCPushNotificationEncryption.m in Sources */,
@@ -2079,7 +2039,6 @@
 				F77B0E5F1D118A16002130FE /* CCSettings.m in Sources */,
 				F70460522499061800BB98A7 /* NotificationCenter+MainThread.swift in Sources */,
 				F78F74362163781100C2ADAD /* NCTrash.swift in Sources */,
-				3781B9B223DB2B9F006B4B1D /* CCMain+Menu.swift in Sources */,
 				F7651A8B23A2A3F2001403D2 /* NCCreateFormUploadDocuments.swift in Sources */,
 				F74AF3A4247FB6AE00AC767B /* NCUtilityFileSystem.swift in Sources */,
 				F7417DB3216CE925007D05F5 /* NCTrashSectionHeaderFooter.swift in Sources */,
@@ -2100,7 +2059,6 @@
 				F76B3CCE1EAE01BD00921AC9 /* NCBrand.swift in Sources */,
 				F7BF1B431D51E893000854F6 /* CCLogin.m in Sources */,
 				F769454422E9F142000A798A /* NCShareUserMenuView.swift in Sources */,
-				F77B0E8F1D118A16002130FE /* CCSection.m in Sources */,
 				F7CA1ED720E7E3FE002CC65E /* PKDownloadButton.m in Sources */,
 				F77B0E981D118A16002130FE /* CCManageAccount.m in Sources */,
 				F755BD9B20594AC7008C5FBB /* NCService.swift in Sources */,
@@ -2127,7 +2085,6 @@
 				F79018B9240962C7007C9B6D /* NCViewerImageContentTransformers.swift in Sources */,
 				F70968A424212C4E00ED60E5 /* NCLivePhoto.swift in Sources */,
 				F704FA5C232A343F00BBA952 /* IMImagemeterViewer.swift in Sources */,
-				370D26B1248A3E1A00121797 /* CCCellMain.swift in Sources */,
 				F7CA1ED220E7E3FE002CC65E /* PKCircleView.m in Sources */,
 				F745B253222D88AE00346520 /* NCLoginQRCode.swift in Sources */,
 				F7CBC31C24F78E79004D3812 /* NCSortMenu.swift in Sources */,

+ 2 - 2
iOSClient/Activity/NCActivity.swift

@@ -384,7 +384,7 @@ extension activityTableViewCell: UICollectionViewDelegate {
                         let attr = try FileManager.default.attributesOfItem(atPath: filePath)
                         let fileSize = attr[FileAttributeKey.size] as! UInt64
                         if fileSize > 0 {
-                            self.appDelegate.activeMain.performSegue(withIdentifier: "segueDetail", sender: metadata)
+                            self.appDelegate.activeFiles.segue(metadata: metadata)
                             return
                         }
                     } catch {
@@ -427,7 +427,7 @@ extension activityTableViewCell: UICollectionViewDelegate {
                             CCUtility.moveFile(atPath: atPath, toPath: toPath)
                                                        
                             NCManageDatabase.sharedInstance.addMetadata(metadata!)
-                            self.appDelegate.activeMain.performSegue(withIdentifier: "segueDetail", sender: metadata)
+                            self.appDelegate.activeFiles.segue(metadata: metadata!)
                         }
                     }
                     

+ 1 - 2
iOSClient/AppDelegate.h

@@ -29,8 +29,8 @@
 #import <TOPasscodeViewController/TOPasscodeViewController.h>
 
 #import "CCUtility.h"
-#import "CCMain.h"
 #import "CCSettings.h"
+#import "CCLogin.h"
 
 @class NCFiles;
 @class CCMore;
@@ -90,7 +90,6 @@
 @property (nonatomic, retain) NSString *activeServerUrl;
 @property (nonatomic, retain) id activeViewController;
 
-@property (nonatomic, retain) CCMain *activeMain;
 @property (nonatomic, retain) NCFiles *activeFiles;
 @property (nonatomic, retain) NCFavorite *activeFavorite;
 @property (nonatomic, retain) NCMedia *activeMedia;

+ 8 - 10
iOSClient/AppDelegate.m

@@ -23,7 +23,6 @@
 
 #import "AppDelegate.h"
 #import "CCGraphics.h"
-#import "CCMain.h"
 #import "NCBridgeSwift.h"
 #import "NCAutoUpload.h"
 #import "NCPushNotificationEncryption.h"
@@ -221,7 +220,7 @@
     [[NCAutoUpload sharedInstance] initStateAutoUpload];
     
     // Read active directory
-    [self.activeMain readFileReloadFolder];
+    [self.activeFiles reloadDataSourceNetworkWithForced:false];
     
     // Required unsubscribing / subscribing
     [self pushNotification];
@@ -908,10 +907,10 @@
     if (self.maintenanceMode)
         return;
     
-    tableDirectory *tableDirectory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", self.account, self.activeMain.serverUrl]];
+    tableDirectory *tableDirectory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", self.account, self.activeServerUrl]];
     
     if ([tableDirectory.permissions containsString:@"CK"]) {
-        UIViewController *vc = _activeMain.splitViewController.viewControllers[0];
+        UIViewController *vc = self.activeFiles.splitViewController.viewControllers[0];
         [self showMenuInViewController: vc];
     } else {
         [[NCContentPresenter shared] messageNotification:@"_warning_" description:@"_no_permission_add_file_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorInternalError forced:false];
@@ -963,7 +962,6 @@
         
     [NCBrandColor.sharedInstance setDarkMode];
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        [[NCMainCommon shared] createImagesThemingColor];
         [[NCCollectionCommon shared] createImagesThemingColor];
         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_changeTheming object:nil];
     });
@@ -1070,7 +1068,7 @@
     NSString *scheme = url.scheme;
 
     dispatch_time_t timer = 0;
-    if (self.activeMain == nil) timer = 1;
+    if (self.activeFiles == nil) timer = 1;
 
     if ([scheme isEqualToString:@"nextcloud"]) {
         
@@ -1146,7 +1144,7 @@
                                         
                                         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
                                             
-                                            [self.activeMain.navigationController popToRootViewControllerAnimated:NO];
+                                            [self.activeFiles.navigationController popToRootViewControllerAnimated:NO];
                                             
                                             dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
                                                 
@@ -1159,15 +1157,15 @@
                                                     NSString *fileName = [[path stringByDeletingLastPathComponent] lastPathComponent];
                                                     NSString *serverUrl = [CCUtility deletingLastPathComponentFromServerUrl:[NSString stringWithFormat:@"%@/%@/%@", matchedAccount.urlBase, webDAV, [path stringByDeletingLastPathComponent]]];
                                                     tableMetadata *metadata = [[NCManageDatabase sharedInstance] createMetadataWithAccount:matchedAccount.account fileName:fileName ocId:[[NSUUID UUID] UUIDString] serverUrl:serverUrl urlBase: @"" url:@"" contentType:@"" livePhoto:false];
-                                                    [self.activeMain performSegueDirectoryWithMetadata:metadata blinkFileNamePath:fileNamePath];
+//                                                    [self.activeFiles performSegueDirectoryWithMetadata:metadata blinkFileNamePath:fileNamePath];
                                                     
                                                 } else {
                                                     
                                                     // Reload folder
                                                     NSString *serverUrl = [NSString stringWithFormat:@"%@/%@", matchedAccount.urlBase, webDAV];
                                                     
-                                                    self.activeMain.blinkFileNamePath = fileNamePath;
-                                                    [self.activeMain readFolder:serverUrl];
+//                                                    self.activeMain.blinkFileNamePath = fileNamePath;
+//                                                    [self.activeMain readFolder:serverUrl];
                                                 }
                                             });
                                         });

+ 0 - 1
iOSClient/CCGlobal.h

@@ -183,7 +183,6 @@
 #define selectorLoadOffline                             @"loadOffline"
 #define selectorOpenIn                                  @"openIn"
 #define selectorOpenInDetail                            @"openInDetail"
-#define selectorSaveAlbum                               @"saveAlbum"
 #define selectorUploadAutoUpload                        @"uploadAutoUpload"
 #define selectorUploadAutoUploadAll                     @"uploadAutoUploadAll"
 #define selectorUploadFile                              @"uploadFile"

+ 9 - 0
iOSClient/Files/NCFiles.swift

@@ -38,6 +38,15 @@ class NCFiles: NCCollectionViewCommon  {
         DZNdescription = "_no_file_pull_down_"
     }
     
+    override func viewWillAppear(_ animated: Bool) {
+        
+        if isRoot  {
+            serverUrl = NCUtility.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account)
+        }
+        
+        super.viewWillAppear(animated)
+    }
+    
     // MARK: - NotificationCenter
     
     override func initializeMain() {

+ 0 - 60
iOSClient/Main/CCMain+Swift.swift

@@ -1,60 +0,0 @@
-//
-//  CCMain+Swift.swift
-//  Nextcloud
-//
-//  Created by Philippe Weidmann on 24.04.20.
-//  Copyright © 2020 Marino Faggiana. All rights reserved.
-//
-
-import Foundation
-
-extension CCMain {
-
-    @objc func updateNavBarShadow(_ scrollView: UIScrollView, force: Bool) {
-        if (scrollView.contentOffset.y > -self.viewRichWorkspace.topView.frame.size.height || self.searchController.isActive || force) {
-            if #available(iOS 13.0, *) {
-                let navBarAppearance = UINavigationBarAppearance()
-                navBarAppearance.configureWithOpaqueBackground()
-                navBarAppearance.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
-                navBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
-                navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-                self.navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
-                navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.tabBar
-                self.navigationController?.navigationBar.standardAppearance = navBarAppearance
-
-            } else {
-                self.navigationController?.navigationBar.barStyle = .default
-                self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
-                self.navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
-                self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.backgroundView
-                self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandElement
-                self.navigationController?.navigationBar.shadowImage = nil
-                self.navigationController?.navigationBar.setValue(false, forKey: "hidesShadow")
-            }
-            self.navigationController?.navigationBar.setNeedsLayout()
-
-        } else {
-            if #available(iOS 13.0, *) {
-                let navBarAppearance = UINavigationBarAppearance()
-                navBarAppearance.configureWithOpaqueBackground()
-                navBarAppearance.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
-                navBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
-                navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-                navBarAppearance.shadowColor = .clear
-                navBarAppearance.shadowImage = UIImage()
-                self.navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
-                navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.tabBar
-                self.navigationController?.navigationBar.standardAppearance = navBarAppearance
-            } else {
-                self.navigationController?.navigationBar.barStyle = .default
-                self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
-                self.navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
-                self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.backgroundView
-                self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandElement
-                self.navigationController?.navigationBar.shadowImage = UIImage()
-                self.navigationController?.navigationBar.setValue(true, forKey: "hidesShadow")
-            }
-            self.navigationController?.navigationBar.setNeedsLayout()
-        }
-    }
-}

+ 0 - 85
iOSClient/Main/CCMain.h

@@ -1,85 +0,0 @@
-//
-//  CCMain.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 04/09/14.
-//  Copyright (c) 2014 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <UIKit/UIKit.h>
-#import <MobileCoreServices/MobileCoreServices.h>
-#import <MediaPlayer/MediaPlayer.h>
-#import <AudioToolbox/AudioToolbox.h>
-#import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h>
-
-#import "NSString+TruncateToWidth.h"
-#import "CCLogin.h"
-#import "CCGraphics.h"
-#import "CCSection.h"
-#import "CCUtility.h"
-#import "CCHud.h"
-#import "CCPeekPop.h"
-#import <MGSwipeTableCell/MGSwipeTableCell.h>
-
-@class tableMetadata;
-@class NCViewRichWorkspace;
-
-@interface CCMain : UITableViewController <UIActionSheetDelegate, UIGestureRecognizerDelegate, UIViewControllerPreviewingDelegate, UISplitViewControllerDelegate, UIPopoverControllerDelegate, UIDocumentPickerDelegate, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate, UIScrollViewDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
-
-@property (nonatomic, strong) NCViewRichWorkspace *viewRichWorkspace;
-
-@property (nonatomic, strong) tableMetadata *metadata;
-@property (nonatomic, strong) tableMetadata *metadataForPushDetail;
-@property (nonatomic, strong) NSString *selectorForPushDetail;
-
-@property (nonatomic, strong) UIButton *sortButton;
-
-@property (nonatomic, strong) NSString *serverUrl;
-@property (nonatomic, strong) NSString *titleMain;
-@property (nonatomic, strong) NSString *richWorkspaceText;
-@property (nonatomic, strong) UISearchController *searchController;
-@property (nonatomic, strong) UITapGestureRecognizer *singleFingerTap;
-@property (nonatomic, strong) NSString *blinkFileNamePath;
-@property (nonatomic, readonly, strong) UIImage *cellFavouriteImage;
-@property (nonatomic, readonly, strong) UIImage *cellTrashImage;
-
-@property BOOL isSelectedMode;
-
-- (void)shouldPerformSegue:(tableMetadata *)metadata selector:(NSString *)selector;
-- (void)performSegueDirectoryWithMetadata:(tableMetadata *)metadata blinkFileNamePath:(NSString *)blinkFileNamePath;
-
-- (void)saveToPhotoAlbum:(tableMetadata *)metadata;
-
-- (void)copyFileToPasteboard:(tableMetadata *)metadata;
-
-- (void)setUINavigationBarDefault;
-
-- (void)readFolder:(NSString *)serverUrl;
-- (void)readFileReloadFolder;
-- (void)setTableViewHeader;
-
-//expose methods for swift
-- (void)didSelectAll;
-- (void)deleteMetadatas;
-- (void)saveSelectedFiles;
-- (void)moveOpenWindow:(NSArray *)indexPaths;
-
-- (void)actionDelete:(NSIndexPath *)indexPath;
-
-@end
-

+ 0 - 2228
iOSClient/Main/CCMain.m

@@ -1,2228 +0,0 @@
-//
-//  CCMain.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 04/09/14.
-//  Copyright (c) 2014 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCMain.h"
-#import "AppDelegate.h"
-#import "NCAutoUpload.h"
-#import "NCBridgeSwift.h"
-#import "PKDownloadButton.h"
-
-@interface CCMain () <UITextViewDelegate, MGSwipeTableCellDelegate, NCSelectDelegate, UITextFieldDelegate, UIAdaptivePresentationControllerDelegate>
-{
-    AppDelegate *appDelegate;
-        
-    BOOL _isRoot;
-    BOOL _isViewDidLoad;
-        
-    UIImageView *_imageTitleHome;
-    
-    NSUInteger _failedAttempts;
-    NSDate *_lockUntilDate;
-
-    UIRefreshControl *refreshControl;
-
-    CCHud *_hud;
-    
-    // Datasource
-    CCSectionDataSourceMetadata *sectionDataSource;
-    
-    // Search
-    NSString *_searchFileName;
-    NSMutableArray *_searchResultMetadatas;
-    NSString *_noFilesSearchTitle;
-    NSString *_noFilesSearchDescription;
-    NSTimer *_timerWaitInput;
-
-    // Automatic Upload Folder
-    NSString *_autoUploadFileName;
-    NSString *_autoUploadDirectory;
-    
-    // Folder
-    BOOL _loadingFolder;
-    tableMetadata *_metadataFolder;
-    
-    CGFloat heightRichWorkspace;
-    CGFloat heightSearchBar;
-    
-    //
-    NSMutableArray *selectOcId;
-    
-    BOOL livePhoto;
-}
-@end
-
-@implementation CCMain
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Init =====
-#pragma --------------------------------------------------------------------------------------------
-
--  (id)initWithCoder:(NSCoder *)aDecoder
-{    
-    if (self = [super initWithCoder:aDecoder])  {
-        
-        appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-        appDelegate.activeMain = self;
-        
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(initializeMain:) name:k_notificationCenter_initializeMain object:nil];
-    }
-    
-    return self;
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== View =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    
-    // init object
-    self.metadata = [tableMetadata new];
-    _hud = [[CCHud alloc] initWithView:[[[UIApplication sharedApplication] delegate] window]];
-    _isViewDidLoad = YES;
-    _searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
-    _searchResultMetadatas = [NSMutableArray new];
-    _searchFileName = @"";
-    _noFilesSearchTitle = @"";
-    _noFilesSearchDescription = @"";
-    _cellFavouriteImage = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"favorite"] width:50 height:50 color:[UIColor whiteColor]];
-    _cellTrashImage = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"trash"] width:50 height:50 color:[UIColor whiteColor]];
-    
-    selectOcId = [NSMutableArray new];
-    
-    // delegate
-    self.tableView.tableFooterView = [UIView new];
-    self.tableView.emptyDataSetDelegate = self;
-    self.tableView.emptyDataSetSource = self;
-    self.searchController.delegate = self;
-    self.searchController.searchBar.delegate = self;
-    
-    // Notification
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasource:) name:k_notificationCenter_reloadDataSource object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setTitle) name:k_notificationCenter_setTitleMain object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:k_notificationCenter_changeTheming object:nil];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deleteFile:) name:k_notificationCenter_deleteFile object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(favoriteFile:) name:k_notificationCenter_favoriteFile object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moveFile:) name:k_notificationCenter_moveFile object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(copyFile:) name:k_notificationCenter_copyFile object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(createFolder:) name:k_notificationCenter_createFolder object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasourceTransfer:) name:k_notificationCenter_renameFile object:nil];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasourceTransfer:) name:k_notificationCenter_downloadStartFile object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasourceTransfer:) name:k_notificationCenter_downloadedFile object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasourceTransfer:) name:k_notificationCenter_downloadCancelFile object:nil];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasourceTransfer:) name:k_notificationCenter_uploadStartFile object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasourceTransfer:) name:k_notificationCenter_uploadedFile object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasourceTransfer:) name:k_notificationCenter_uploadCancelFile object:nil];
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:k_notificationCenter_progressTask object:nil];
-
-    // Search
-    self.definesPresentationContext = YES;
-    self.searchController.searchResultsUpdater = self;
-    self.searchController.dimsBackgroundDuringPresentation = NO;
-    UIButton *searchButton = self.searchController.searchBar.subviews.firstObject.subviews.lastObject;
-    if (searchButton && [searchButton isKindOfClass:[UIButton class]]) {
-        [searchButton setTitleColor:NCBrandColor.sharedInstance.brandElement forState:UIControlStateNormal];
-    }
-    UITextField *searchTextField = [self.searchController.searchBar valueForKey:@"searchField"];
-    if (searchTextField && [searchTextField isKindOfClass:[UITextField class]]) {
-        searchTextField.textColor = NCBrandColor.sharedInstance.textView;
-    }
-            
-    // Load Rich Workspace
-    self.viewRichWorkspace = [[[NSBundle mainBundle] loadNibNamed:@"NCRichWorkspace" owner:self options:nil] firstObject];
-    UITapGestureRecognizer *viewRichWorkspaceTapped = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(viewRichWorkspaceTapAction:)];
-    viewRichWorkspaceTapped.numberOfTapsRequired = 1;
-    viewRichWorkspaceTapped.delegate = self;
-    [self.viewRichWorkspace.richView addGestureRecognizer:viewRichWorkspaceTapped];
-    
-    self.sortButton = self.viewRichWorkspace.sortButton;
-    heightSearchBar = self.viewRichWorkspace.topView.frame.size.height;
-
-    [self.sortButton setTitleColor:NCBrandColor.sharedInstance.brandElement forState:UIControlStateNormal];
-    [self.sortButton addTarget:self action:@selector(toggleSortMenu) forControlEvents:UIControlEventTouchUpInside];
-    
-    heightRichWorkspace = UIScreen.mainScreen.bounds.size.height / 4 + heightSearchBar;
-    [self.viewRichWorkspace setFrame:CGRectMake(0, 0, self.tableView.frame.size.width, heightRichWorkspace)];
-    self.navigationItem.searchController = self.searchController;
-    self.searchController.hidesNavigationBarDuringPresentation = true;
-    self.navigationController.navigationBar.prefersLargeTitles = true;
-    self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
-
-    // Table Header View
-    [self.tableView setTableHeaderView:self.viewRichWorkspace];
-
-    // Register cell
-    [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMain" bundle:nil] forCellReuseIdentifier:@"CellMain"];
-    [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMainTransfer" bundle:nil] forCellReuseIdentifier:@"CellMainTransfer"];
-    self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 35, 0);
-
-    // long press recognizer TableView
-    UILongPressGestureRecognizer* longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(onLongPressTableView:)];
-    [self.tableView addGestureRecognizer:longPressRecognizer];
-    
-    // Pull-to-Refresh
-    [self createRefreshControl];
-    
-    // Register for 3D Touch Previewing if available
-    if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) {
-        [self registerForPreviewingWithDelegate:self sourceView:self.view];
-    }
-
-    // if this is not Main (the Main uses inizializeMain)
-    if (_isRoot == NO && appDelegate.account.length > 0) {
-        // Read (File) Folder
-        [self readFileReloadFolder];
-    }
-    
-    // Title
-    [self setTitle];
-    // changeTheming
-    [self changeTheming];
-}
-
-- (void)willDismissSearchController:(UISearchController *)searchController
-{
-    [self.tableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
-}
-
-- (void)willPresentSearchController:(UISearchController *)searchController
-{
-    [self updateNavBarShadow:self.tableView force:true];
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    
-    [self updateNavBarShadow:self.tableView force:false];
-    if(_isViewDidLoad && _isRoot) {
-        self.navigationItem.hidesSearchBarWhenScrolling = false;
-        [self.navigationController.navigationBar sizeToFit];
-    }
-    // test
-    if (appDelegate.account.length == 0)
-        return;
-    
-    if (_isSelectedMode)
-        [self setUINavigationBarSelected];
-    else
-        [self setUINavigationBarDefault];
-    
-    // If not editing mode remove _selectedocIds
-    if (!self.tableView.editing)
-        [selectOcId removeAllObjects];
-
-    // Check server URL "/"
-    if (self.navigationController.viewControllers.firstObject == self && self.serverUrl == nil) {
-        self.serverUrl = [[NCUtility shared] getHomeServerWithUrlBase:appDelegate.urlBase account:appDelegate.account];
-    }
-    
-    // RichWorkspace
-    tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.account, self.serverUrl]];
-    if (![self.richWorkspaceText isEqualToString:directory.richWorkspace]) {
-        self.richWorkspaceText = directory.richWorkspace;
-        [self setTableViewHeader];
-    }
-    
-    // Query data source
-    if (self.searchController.isActive == false) {
-        [self reloadDatasource:self.serverUrl ocId:nil];
-    }
-    
-    appDelegate.activeServerUrl = self.serverUrl;
-    appDelegate.activeViewController = self;
-}
-
-- (void)viewDidAppear:(BOOL)animated
-{
-    [super viewDidAppear:animated];
-    if(_isViewDidLoad && _isRoot) {
-        self.navigationItem.hidesSearchBarWhenScrolling = true;
-    }
-    // Active Main
-    appDelegate.activeMain = self;
-    
-    // Test viewDidLoad
-    if (_isViewDidLoad) {
-        
-        _isViewDidLoad = NO;
-        
-    } else {
-        
-        if (appDelegate.account.length > 0 && [selectOcId count] == 0) {
-            // Read (file) Folder
-            [self readFileReloadFolder];
-        }
-    }
-
-    // Title
-    [self setTitle];
-}
-
-- (void)viewWillDisappear:(BOOL)animated
-{
-    [super viewWillDisappear:animated];
-}
-
-- (void) viewDidLayoutSubviews
-{
-    [super viewDidLayoutSubviews];
-    [self setTableViewHeader];
-}
-
-- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
-{
-    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
-    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
-        [self.tableView beginUpdates];
-        [self.tableView endUpdates];
-        [self setTableViewHeader];
-    } completion:^(id<UIViewControllerTransitionCoordinatorContext> context){
-        [self updateNavBarShadow:self.tableView force:false];
-    }];
-}
-
-- (void)presentationControllerWillDismiss:(UIPresentationController *)presentationController
-{
-    [self viewDidAppear:true];
-}
-
-- (BOOL)prefersStatusBarHidden
-{
-    return NO;
-}
-
-// detect scroll for remove keyboard in search mode
-- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
-{
-    if (self.searchController.isActive && scrollView == self.tableView) {
-        
-        [self.searchController.searchBar endEditing:YES];
-    }
-}
-
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
-    [self updateNavBarShadow:self.tableView force:false];
-}
-
-- (void)changeTheming
-{
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
-    
-    // Refresh control
-    refreshControl.tintColor = UIColor.lightGrayColor;
-    refreshControl.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-
-    [self.sortButton setTitleColor:NCBrandColor.sharedInstance.brandElement forState:UIControlStateNormal];
-    // color searchbar
-    self.searchController.searchBar.tintColor = NCBrandColor.sharedInstance.brandElement;
-    // color searchbbar button text (cancel)
-    UIButton *searchButton = self.searchController.searchBar.subviews.firstObject.subviews.lastObject;
-    if (searchButton && [searchButton isKindOfClass:[UIButton class]]) {
-        [searchButton setTitleColor:NCBrandColor.sharedInstance.brandElement forState:UIControlStateNormal];
-    }
-    // color textview searchbbar
-    UITextField *searchTextView = [self.searchController.searchBar valueForKey:@"searchField"];
-    if (searchTextView && [searchTextView isKindOfClass:[UITextField class]]) {
-        searchTextView.textColor = NCBrandColor.sharedInstance.textView;
-    }
-    // Rich Workspace
-    [self.viewRichWorkspace loadWithRichWorkspaceText:self.richWorkspaceText];
-    // Title
-    [self setTitle];
-    // Reload Table View
-    [self tableViewReloadData];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Initialization =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)initializeMain:(NSNotification *)notification
-{    
-    // test
-    if (appDelegate.account.length == 0)
-        return;
-    
-    if ([appDelegate.listMainVC count] == 0 || _isRoot) {
-        
-        // This is Root home main add list
-        _isRoot = YES;
-        _serverUrl = [[NCUtility shared] getHomeServerWithUrlBase:appDelegate.urlBase account:appDelegate.account];
-        [appDelegate.listMainVC setObject:self forKey:_serverUrl];
-        
-        // go Home
-        [self.navigationController popToRootViewControllerAnimated:NO];
-                
-        // Remove search mode
-        [self cancelSearchBar];
-        
-        // Read this folder
-        [self readFileReloadFolder];
-                
-    } else {
-        
-        // reload datasource
-        [self reloadDatasource:_serverUrl ocId:nil];
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== NotificationCenter ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)createFolder:(NSNotification *)notification
-{
-    if (self.view.window == nil) { return; }
-    
-    NSDictionary *userInfo = notification.userInfo;
-    tableMetadata *metadata = userInfo[@"metadata"];
-    
-    if (metadata) {
-         if (![metadata.serverUrl isEqualToString:self.serverUrl]) { return; }
-        [self reloadDatasource:self.serverUrl ocId:nil];
-    } else {
-        [self readFolder:self.serverUrl];
-    }
-}
-
-- (void)deleteFile:(NSNotification *)notification
-{
-    if (self.view.window == nil) { return; }
-    
-    NSDictionary *userInfo = notification.userInfo;
-    tableMetadata *metadata = userInfo[@"metadata"];
-    
-    if (![metadata.serverUrl isEqualToString:self.serverUrl]) { return; }
-    
-    [self reloadDatasource:self.serverUrl ocId:nil];
-}
-
-- (void)moveFile:(NSNotification *)notification
-{
-    if (self.view.window == nil) { return; }
-    
-    NSDictionary *userInfo = notification.userInfo;
-    tableMetadata *metadata = userInfo[@"metadata"];
-    tableMetadata *metadataNew = userInfo[@"metadataNew"];
-    
-    if (![metadata.serverUrl isEqualToString:self.serverUrl] &&  ![metadataNew.serverUrl isEqualToString:self.serverUrl]) { return; }
-    
-    [self reloadDatasource:self.serverUrl ocId:nil];
-}
-
-- (void)copyFile:(NSNotification *)notification
-{
-    if (self.view.window == nil) { return; }
-    
-    NSDictionary *userInfo = notification.userInfo;
-    tableMetadata *metadata = userInfo[@"metadata"];
-    NSString *serverUrlTo = userInfo[@"serverUrlTo"];
-
-    if (![metadata.serverUrl isEqualToString:self.serverUrl] && ![serverUrlTo isEqualToString:self.serverUrl]) { return; }
-    
-    [self reloadDatasource:self.serverUrl ocId:nil];
-}
-
-- (void)favoriteFile:(NSNotification *)notification
-{
-    if (self.view.window == nil) { return; }
-    
-    NSDictionary *userInfo = notification.userInfo;
-    tableMetadata *metadata = userInfo[@"metadata"];
-    
-    if (![metadata.serverUrl isEqualToString:self.serverUrl]) { return; }
-
-    if (self.searchController.isActive) {
-        [self readFolder:self.serverUrl];
-    } else {
-        [self reloadDatasource:self.serverUrl ocId:nil];
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== DZNEmptyDataSetSource ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
-{
-    if (_loadingFolder)
-        return NO;
-    else
-        return YES;
-}
-
-- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView
-{
-    CGFloat height = self.tabBarController.tabBar.frame.size.height;
-    return -height;
-}
-
-- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return NCBrandColor.sharedInstance.backgroundView;
-}
-
-- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
-{
-    if (self.searchController.isActive)
-        return [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"search"] width:300 height:300 color:NCBrandColor.sharedInstance.brandElement];
-    else
-        return [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folder"] width:300 height:300 color:NCBrandColor.sharedInstance.brandElement];
-}
-
-- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView
-{
-    if (_loadingFolder && refreshControl.isRefreshing == NO) {
-    
-        UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
-        activityView.transform = CGAffineTransformMakeScale(1.5f, 1.5f);
-        activityView.color = NCBrandColor.sharedInstance.brandElement;
-        [activityView startAnimating];
-        
-        return activityView;
-    }
-    
-    return nil;
-}
-
-- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
-{
-    NSString *text;
-    
-    if (self.searchController.isActive) {
-        
-        text = _noFilesSearchTitle;
-        
-    } else {
-        
-        text = [NSString stringWithFormat:@"%@", NSLocalizedString(@"_files_no_files_", nil)];
-    }
-    
-    NSDictionary *attributes = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:20.0f], NSForegroundColorAttributeName:[UIColor lightGrayColor]};
-    
-    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
-}
-
-- (NSAttributedString *)descriptionForEmptyDataSet:(UIScrollView *)scrollView
-{
-    NSString *text;
-    
-    if (self.searchController.isActive) {
-        
-        text = _noFilesSearchDescription;
-        
-    } else {
-        
-        text = [NSString stringWithFormat:@"\n%@", NSLocalizedString(@"_no_file_pull_down_", nil)];
-    }
-    
-    NSMutableParagraphStyle *paragraph = [NSMutableParagraphStyle new];
-    paragraph.lineBreakMode = NSLineBreakByWordWrapping;
-    paragraph.alignment = NSTextAlignmentCenter;
-    
-    NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:14.0], NSForegroundColorAttributeName: [UIColor lightGrayColor], NSParagraphStyleAttributeName: paragraph};
-    
-    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Graphic Window =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)createRefreshControl
-{
-    refreshControl = [NCMainRefreshControl new];
-    
-    self.tableView.refreshControl = refreshControl;
-    
-    refreshControl.tintColor = UIColor.lightGrayColor;
-    refreshControl.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    [refreshControl addTarget:self action:@selector(refreshControlTarget) forControlEvents:UIControlEventValueChanged];
-}
-
-- (void)deleteRefreshControl
-{
-    [refreshControl endRefreshing];
-    [refreshControl removeFromSuperview];
-    refreshControl = nil;
-}
-
-- (void)refreshControlTarget
-{
-    [self readFolder:_serverUrl];
-    
-    // Actuate `Peek` feedback (weak boom)
-    AudioServicesPlaySystemSound(1519);
-}
-
-- (void)setTitle
-{
-    if (_isSelectedMode) {
-        
-        NSUInteger totali = [sectionDataSource.allRecordsDataSource count];
-        NSUInteger selezionati = [[self.tableView indexPathsForSelectedRows] count];
-        
-        self.navigationItem.titleView = nil;
-        self.navigationItem.title = [NSString stringWithFormat:@"%@ : %lu / %lu", NSLocalizedString(@"_selected_", nil), (unsigned long)selezionati, (unsigned long)totali];
-
-    } else {
-        if (_isRoot) {
-            self.navigationItem.title = NCBrandOptions.sharedInstance.brand;
-        } else {
-            self.navigationItem.title = _titleMain;
-        }
-    }
-    
-    NSString *titleButtonMenuSort = [[NCUtility shared] getTitleButtonForViewWithKey:k_layout_view_main];
-    [self.sortButton setTitle:NSLocalizedString(titleButtonMenuSort, nil) forState:UIControlStateNormal];
-}
-
-- (void)setUINavigationBarDefault
-{
-    UIBarButtonItem *buttonSelect = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"_select_", @"") style:UIBarButtonItemStylePlain target:self action:@selector(tableViewToggle)];
-    
-    self.navigationController.navigationBar.hidden = NO;
-
-    self.navigationItem.rightBarButtonItem = buttonSelect;
-    self.navigationItem.leftBarButtonItem = nil;
-}
-
-- (void)setUINavigationBarSelected
-{    
-    UIBarButtonItem *buttonMore = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"navigationMore"] style:UIBarButtonItemStylePlain target:self action:@selector(toggleSelectMenu)];
-    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIBarButtonItemStylePlain target:self action:@selector(cancelSelect)];
-    
-    self.navigationItem.leftBarButtonItem = leftButton;
-    self.navigationItem.rightBarButtonItem = buttonMore; //[[NSArray alloc] initWithObjects:buttonMore, nil];
-}
-
-- (void)cancelSelect
-{
-    [self tableViewSelect:false];
-}
-
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Save selected File =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)saveToPhotoAlbum:(tableMetadata *)metadata
-{
-    NSString *fileNamePath = [CCUtility getDirectoryProviderStorageOcId:metadata.ocId fileNameView:metadata.fileNameView];
-    PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus];
-    
-    if ([metadata.typeFile isEqualToString: k_metadataTypeFile_image] && status == PHAuthorizationStatusAuthorized) {
-        
-        UIImage *image = [UIImage imageWithContentsOfFile:fileNamePath];
-        
-        if (image)
-            UIImageWriteToSavedPhotosAlbum(image, self, @selector(saveSelectedFilesSelector: didFinishSavingWithError: contextInfo:), nil);
-        else
-            [[NCContentPresenter shared] messageNotification:@"_save_selected_files_" description:@"_file_not_saved_cameraroll_" delay:k_dismissAfterSecond type:messageTypeError errorCode:k_CCErrorFileNotSaved forced:false];
-    }
-    
-    if ([metadata.typeFile isEqualToString: k_metadataTypeFile_video] && status == PHAuthorizationStatusAuthorized) {
-        
-        if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(fileNamePath)) {
-            
-            UISaveVideoAtPathToSavedPhotosAlbum(fileNamePath, self, @selector(saveSelectedFilesSelector: didFinishSavingWithError: contextInfo:), nil);
-        } else {
-            [[NCContentPresenter shared] messageNotification:@"_save_selected_files_" description:@"_file_not_saved_cameraroll_" delay:k_dismissAfterSecond type:messageTypeError errorCode:k_CCErrorFileNotSaved forced:false];
-        }
-    }
-    
-    if (status != PHAuthorizationStatusAuthorized) {
-        
-        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_access_photo_not_enabled_", nil) message:NSLocalizedString(@"_access_photo_not_enabled_msg_", nil) preferredStyle:UIAlertControllerStyleAlert];
-        UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {}];
-        
-        [alertController addAction:okAction];
-        [self presentViewController:alertController animated:YES completion:nil];
-    }
-}
-
-- (void)saveSelectedFilesSelector:(NSString *)path didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
-{
-    if (error) {
-        [[NCContentPresenter shared] messageNotification:@"_save_selected_files_" description:@"_file_not_saved_cameraroll_" delay:k_dismissAfterSecond type:messageTypeError errorCode:error.code forced:false];
-    }
-}
-
-- (void)saveSelectedFiles
-{
-    if (_isSelectedMode && [selectOcId count] == 0)
-        return;
-    
-    [_hud visibleHudTitle:@"" mode:MBProgressHUDModeIndeterminate color:nil];
-    
-    NSArray *metadatas = [self getMetadatasFromSelectedRows:[self.tableView indexPathsForSelectedRows]];
-    
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.01 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-        
-        for (tableMetadata *metadata in metadatas) {
-            
-            if (metadata.directory == NO && ([metadata.typeFile isEqualToString: k_metadataTypeFile_image] || [metadata.typeFile isEqualToString: k_metadataTypeFile_video])) {
-                
-                [[NCOperationQueue shared] downloadWithMetadata:metadata selector:selectorSaveAlbum setFavorite:false];
-            }
-        }
-        
-        [_hud hideHud];
-    });
-    
-    [self tableViewSelect:false];
-}
-
-#pragma mark -
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Peek & Pop  =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location
-{
-    CGPoint convertedLocation = [self.view convertPoint:location toView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:convertedLocation];
-    tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    CCCellMain *cell = [self.tableView cellForRowAtIndexPath:indexPath];
-        
-    if (cell) {
-        previewingContext.sourceRect = cell.frame;
-        CCPeekPop *viewController = [[UIStoryboard storyboardWithName:@"CCPeekPop" bundle:nil] instantiateViewControllerWithIdentifier:@"PeekPopImagePreview"];
-            
-        viewController.metadata = metadata;
-        viewController.imageFile = cell.file.image;
-        viewController.showOpenIn = true;
-        viewController.showShare = true;
-        viewController.showOpenQuickLook = [[NCUtility shared] isQuickLookDisplayableWithMetadata:metadata];
-        
-        return viewController;
-    }
-    
-    return nil;
-}
-
-- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext commitViewController:(UIViewController *)viewControllerToCommit
-{
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:previewingContext.sourceRect.origin];
-    
-    [self tableView:self.tableView didSelectRowAtIndexPath:indexPath];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Read Folder ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)readFolder:(NSString *)serverUrl
-{
-    // init control
-    if (!serverUrl || !appDelegate.account || appDelegate.maintenanceMode) {
-        [refreshControl endRefreshing];
-        return;
-    }
-    
-    // Search Mode
-    if (self.searchController.isActive) {
-        
-        _searchFileName = @""; // forced reload searchg
-        [self updateSearchResultsForSearchController:self.searchController];
-        
-        return;
-    }
-    
-    _loadingFolder = YES;
-    [refreshControl endRefreshing];
-    [self tableViewReloadData];
-    
-    [[NCNetworking shared] readFolderWithServerUrl:serverUrl account:appDelegate.account completion:^(NSString *account, tableMetadata *metadataFolder, NSArray *metadatas, NSArray *metadatasUpdate, NSArray *metadatasLocalUpdate, NSInteger errorCode, NSString *errorDescription) {
-        
-        if (errorCode == 0 ) {
-            
-            _metadataFolder = metadataFolder;
-            BOOL isFolderEncrypted = [CCUtility isFolderEncrypted:serverUrl e2eEncrypted:_metadataFolder.e2eEncrypted account:appDelegate.account urlBase:_metadataFolder.urlBase];
-            [self setTitle];
-            
-            for (tableMetadata *metadata in metadatasLocalUpdate) {
-                if (!metadata.directory) {
-                    [[NCNetworking shared] downloadWithMetadata:metadata selector:selectorDownloadFile setFavorite:false completion:^(NSInteger errorCode) { }];
-                }
-            }
-            
-            // E2EE Is encrypted folder get metadata
-            if (isFolderEncrypted) {
-                if ([CCUtility isEndToEndEnabled:account]) {
-                    
-                    [[NCCommunication shared] getE2EEMetadataWithFileId:metadataFolder.fileId e2eToken:nil customUserAgent:nil addCustomHeaders:nil completionHandler:^(NSString *account, NSString *e2eMetadata, NSInteger errorCode, NSString *errorDescription) {
-                       
-                        if (errorCode == 0 && e2eMetadata != nil) {
-                            
-                            BOOL result = [[NCEndToEndMetadata sharedInstance] decoderMetadata:e2eMetadata privateKey:[CCUtility getEndToEndPrivateKey:account] serverUrl:self.serverUrl account:account urlBase:appDelegate.urlBase];
-                            
-                            if (result == false) {
-                                [[NCContentPresenter shared] messageNotification:@"_error_e2ee_" description:@"_e2e_error_decode_metadata_" delay:k_dismissAfterSecond type:messageTypeError errorCode:k_CCErrorDecodeMetadata forced:true];
-                            }
-                                                        
-                        } else if (errorCode != 404) {
-                            
-                            [[NCContentPresenter shared] messageNotification:@"_e2e_error_get_metadata_" description:errorDescription delay:k_dismissAfterSecond type:messageTypeError errorCode:errorCode forced:true];
-                        }
-                        
-                       [self reloadDatasource:_serverUrl ocId:nil];
-                    }];
-                    
-                } else {
-                    
-                    [[NCContentPresenter shared] messageNotification:@"_info_" description:@"_e2e_goto_settings_for_enable_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorE2EENotEnabled forced:true];
-                }
-            }
-            
-        } else {
-            [[NCContentPresenter shared] messageNotification:@"_error_" description:errorDescription delay:k_dismissAfterSecond type:messageTypeError errorCode:errorCode forced:true];
-        }
-        
-        _loadingFolder = NO;
-        [self reloadDatasource:serverUrl ocId:nil];
-    }];
-}
-
-- (void)readFileReloadFolder
-{
-    if (!_serverUrl || !appDelegate.account || appDelegate.maintenanceMode)
-        return;
-    
-    [[NCNetworking shared] readFileWithServerUrlFileName:self.serverUrl account:appDelegate.account completion:^(NSString *account, tableMetadata *metadata, NSInteger errorCode, NSString *errorDescription) {
-        if (errorCode == 0 && [account isEqualToString:appDelegate.account]) {
-            
-            tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", account, self.serverUrl]];
-            
-            // Rich Workspace
-            if (![self.richWorkspaceText isEqualToString:directory.richWorkspace]) {
-                self.richWorkspaceText = directory.richWorkspace;
-            }
-            [self setTableViewHeader];
-            
-            // Read folder: No record, Change etag or BLINK
-            if ([sectionDataSource.allRecordsDataSource count] == 0 || [metadata.etag isEqualToString:directory.etag] == NO || self.blinkFileNamePath != nil) {
-                [self readFolder:self.serverUrl];
-            }
-            
-        } else if (errorCode != 0) {
-            [[NCContentPresenter shared] messageNotification:@"_error_" description:errorDescription delay:k_dismissAfterSecond type:messageTypeError errorCode:errorCode forced:false];
-        }
-    }];
-}
-
-#pragma mark -
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Search =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)searchStartTimer
-{
-    if (self.searchController.isActive == false) {
-        return;
-    }
-        
-    [[NCCommunication shared] searchLiteralWithServerUrl:appDelegate.urlBase depth:@"infinity" literal:_searchFileName showHiddenFiles:[CCUtility getShowHiddenFiles] customUserAgent:nil addCustomHeaders:nil timeout:120 completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorDescription) {
-        
-         if (errorCode == 0 && [account isEqualToString:appDelegate.account] && files != nil) {
-             
-             [[NCManageDatabase sharedInstance] convertNCCommunicationFilesToMetadatas:files useMetadataFolder:false account:account completion:^(tableMetadata *metadataFolder, NSArray<tableMetadata *> *metadatasFolder, NSArray<tableMetadata *> *metadatas) {
-                 
-                 [[NCManageDatabase sharedInstance] addMetadatas:metadatas];
-                 _searchResultMetadatas = [[NSMutableArray alloc] initWithArray:metadatas];
-                 _metadataFolder = nil;
-                 
-                 [self reloadDatasource:_serverUrl ocId:nil];
-                 [self tableViewReloadData];
-                 [self setTitle];
-             }];
-                          
-         } else {
-             
-             if (errorCode != 0) {
-                 [[NCContentPresenter shared] messageNotification:@"_error_" description:errorDescription delay:k_dismissAfterSecond type:messageTypeError errorCode:errorCode forced:true];
-             }
-             
-             _searchFileName = @"";
-             [self cancelSearchBar];
-         }
-        
-    }];
-    
-    _noFilesSearchTitle = @"";
-    _noFilesSearchDescription = NSLocalizedString(@"_search_in_progress_", nil);
-    
-    [self.tableView reloadEmptyDataSet];
-}
-
-- (void)updateSearchResultsForSearchController:(UISearchController *)searchController
-{
-    // Color text "Cancel"
-    [[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]] setTintColor:NCBrandColor.sharedInstance.brandElement];
-    
-    if (searchController.isActive) {
-        [self deleteRefreshControl];
-        
-        NSString *fileName = [CCUtility removeForbiddenCharactersServer:searchController.searchBar.text];
-        
-        if (fileName.length >= k_minCharsSearch && [fileName isEqualToString:_searchFileName] == NO) {
-            
-            _searchFileName = fileName;
-            _metadataFolder = nil;
-            
-            // First : filter
-                
-            NSArray *records = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND fileNameView CONTAINS[cd] %@", appDelegate.account, _serverUrl, fileName] page:0 limit:0 sorted:@"fileName" ascending:NO];
-                
-            [_searchResultMetadatas removeAllObjects];
-            for (tableMetadata *record in records) {
-                [_searchResultMetadatas addObject:record];
-            }
-            
-            // Version >= 12
-            NSInteger serverVersionMajor = [[NCManageDatabase sharedInstance] getCapabilitiesServerIntWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesVersionMajor];
-            if (serverVersionMajor >= 12) {
-                
-                [_timerWaitInput invalidate];
-                _timerWaitInput = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(searchStartTimer) userInfo:nil repeats:NO];
-            }
-            
-            [self setTitle];
-        }
-        
-        if (_searchResultMetadatas.count == 0 && fileName.length == 0) {
-
-            [self reloadDatasource:_serverUrl ocId:nil];
-        }
-        
-    } else {
-        
-        [self createRefreshControl];
-
-        [self reloadDatasource:_serverUrl ocId:nil];
-    }
-}
-
-- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
-{
-    [self cancelSearchBar];
-}
-
-- (void)cancelSearchBar
-{
-    if (self.searchController.active) {
-        
-        [self.searchController setActive:NO];
-    
-        _searchFileName = @"";
-        _searchResultMetadatas = [NSMutableArray new];
-        
-        [self reloadDatasource:_serverUrl ocId:nil];
-    }
-
-}
-
-#pragma mark -
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Delete File or Folder =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)deleteMetadatas
-{
-    if (_isSelectedMode) {
-        for (NSString *ocId in selectOcId) {
-            tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataFromOcId:ocId];
-            if (metadata) {
-                [[NCOperationQueue shared] deleteWithMetadata:metadata onlyLocal:false];
-            }
-        }
-        [selectOcId removeAllObjects];
-        [self tableViewSelect:false];
-    } else {
-        [[NCOperationQueue shared] deleteWithMetadata:self.metadata onlyLocal:false];
-    }
-}
-
-// DELEGATE : Select
-
-- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type array:(NSArray *)array buttonType:(NSString *)buttonType overwrite:(BOOL)overwrite
-{
-    if (serverUrl != nil) {
-        // E2EE DENIED
-        if ([CCUtility isFolderEncrypted:serverUrl e2eEncrypted:metadata.e2eEncrypted account:appDelegate.account urlBase:appDelegate.urlBase]) {
-            
-            [[NCContentPresenter shared] messageNotification:@"_move_" description:@"_e2e_error_not_move_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorE2EENotMove forced:true];
-            return;
-        }
-        
-        BOOL move = true;
-        if ([buttonType isEqualToString:@"done1"]) { move = false; }
-        
-        if (_isSelectedMode) {
-            for (NSString *ocId in selectOcId) {
-                tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataFromOcId:ocId];
-                if (metadata) {
-                    [[NCOperationQueue shared] copyMoveWithMetadata:metadata serverUrl:serverUrl overwrite:overwrite move:move];
-                }
-            }
-            [selectOcId removeAllObjects];
-            [self tableViewSelect:false];
-        } else {
-            [[NCOperationQueue shared] copyMoveWithMetadata:self.metadata serverUrl:serverUrl overwrite:overwrite move:move];
-        }
-    }
-}
-
-- (void)moveOpenWindow:(NSArray *)indexPaths
-{
-    if (_isSelectedMode && [selectOcId count] == 0)
-        return;
-    
-    UINavigationController *navigationController = [[UIStoryboard storyboardWithName:@"NCSelect" bundle:nil] instantiateInitialViewController];
-    NCSelect *viewController = (NCSelect *)navigationController.topViewController;
-    
-    viewController.delegate = self;
-    viewController.hideButtonCreateFolder = false;
-    viewController.selectFile = false;
-    viewController.includeDirectoryE2EEncryption = false;
-    viewController.includeImages = false;
-    viewController.type = @"";
-    viewController.titleButtonDone = NSLocalizedString(@"_move_", nil);
-    viewController.titleButtonDone1 = NSLocalizedString(@"_copy_", nil);
-    viewController.isButtonDone1Hide = false;
-    viewController.isOverwriteHide = false;
-    viewController.keyLayout = k_layout_view_move;
-    viewController.array = selectOcId;
-    
-    [navigationController setModalPresentationStyle:UIModalPresentationFullScreen];
-    [self presentViewController:navigationController animated:YES completion:nil];
-}
-
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Progress & Task Button =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)triggerProgressTask:(NSNotification *)notification
-{
-    if (sectionDataSource.ocIdIndexPath != nil) {
-        [[NCMainCommon shared] triggerProgressTask:notification sectionDataSourceocIdIndexPath:sectionDataSource.ocIdIndexPath tableView:self.tableView viewController:self serverUrlViewController:self.serverUrl];
-    }
-}
-
-- (void)cancelTaskButton:(id)sender withEvent:(UIEvent *)event
-{
-    UITouch *touch = [[event allTouches] anyObject];
-    CGPoint location = [touch locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
-    
-    if ([self indexPathIsValid:indexPath]) {
-        
-        tableMetadata *metadataSection = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-        
-        if (metadataSection) {
-            [[NCNetworking shared] cancelTransferMetadata:metadataSection completion:^{ }];
-        }
-    }
-}
-
-- (void)cancelAllTask:(id)sender
-{
-    CGPoint location = [sender locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
-    
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_all_task_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
-        [NCUtility.shared startActivityIndicatorWithView:self.view bottom:0];
-        [[NCNetworking shared] cancelAllTransferWithAccount:appDelegate.account completion:^{
-            [self reloadDatasource:self.serverUrl ocId:nil];
-        }];
-        [NCUtility.shared stopActivityIndicator];
-    }]];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { }]];
-    
-    alertController.popoverPresentationController.sourceView = self.tableView;
-    alertController.popoverPresentationController.sourceRect = [self.tableView rectForRowAtIndexPath:indexPath];
-    
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-        [alertController.view layoutIfNeeded];
-    
-    [self presentViewController:alertController animated:YES completion:nil];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Tap =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)tapActionComment:(UITapGestureRecognizer *)tapGesture
-{
-    CGPoint location = [tapGesture locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
-    
-    tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    if (metadata && ![CCUtility isFolderEncrypted:self.serverUrl e2eEncrypted:metadata.e2eEncrypted account:appDelegate.account urlBase: appDelegate.urlBase]) {
-        [[NCNetworkingNotificationCenter shared] openShareWithViewController:self metadata:metadata indexPage:1];
-    }
-}
-
-- (void)tapActionShared:(UITapGestureRecognizer *)tapGesture
-{
-    CGPoint location = [tapGesture locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
-    
-    tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    if (metadata && ![CCUtility isFolderEncrypted:self.serverUrl e2eEncrypted:metadata.e2eEncrypted account:appDelegate.account urlBase:appDelegate.urlBase]) {
-        [[NCNetworkingNotificationCenter shared] openShareWithViewController:self metadata:metadata indexPage:2];
-    }
-}
-
-- (void)tapActionConnectionMounted:(UITapGestureRecognizer *)tapGesture
-{
-    CGPoint location = [tapGesture locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
-    
-    tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    if (metadata) {
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Rich Workspace =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)viewRichWorkspaceTapAction:(UITapGestureRecognizer *)tapGesture
-{
-    UINavigationController *navigationController = [[UIStoryboard storyboardWithName:@"NCViewerRichWorkspace" bundle:nil] instantiateInitialViewController];
-    NCViewerRichWorkspace *viewerRichWorkspace = (NCViewerRichWorkspace *)[navigationController topViewController];
-    viewerRichWorkspace.richWorkspaceText = self.richWorkspaceText;
-    viewerRichWorkspace.serverUrl = self.serverUrl;
-    
-    navigationController.modalPresentationStyle = UIModalPresentationFullScreen;
-    
-    [self presentViewController:navigationController animated:NO completion:NULL];
-}
-
-- (void)toggleSortMenu
-{
-    NCSortMenu *sortMenu = [NCSortMenu new];
-    [sortMenu toggleMenuWithViewController:self key:k_layout_view_main sortButton:self.sortButton serverUrl:self.serverUrl hideDirectoryOnTop:false];
-}
-
-- (void)toggleSelectMenu
-{
-    [self toggleSelectMenuWithViewController:self.navigationController];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Long Press Recognized Table View / Menu Controller =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)onLongPressTableView:(UILongPressGestureRecognizer*)recognizer
-{
-    if (recognizer.state == UIGestureRecognizerStateBegan) {
-        
-        CGPoint touchPoint = [recognizer locationInView:self.tableView];
-        NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:touchPoint];
-        NSMutableArray *items = [NSMutableArray new];
-        
-        if ([self indexPathIsValid:indexPath])
-            self.metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-       
-        [self becomeFirstResponder];
-        
-        UIMenuController *menuController = [UIMenuController sharedMenuController];
-        
-        [items addObject:[[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"_copy_file_", nil) action:@selector(copyTouchFile:)]];
-        [items addObject:[[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"_copy_files_", nil) action:@selector(copyTouchFiles:)]];
-        if ([NCBrandOptions sharedInstance].disable_openin_file == false) {
-            [items addObject:[[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"_open_in_", nil) action:@selector(openinTouchFile:)]];
-        }
-        if ([[NCUtility shared] isQuickLookDisplayableWithMetadata:self.metadata]) {
-            [items addObject:[[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"_open_quicklook_", nil) action:@selector(openQuickLookTouch:)]];
-        }
-        [items addObject:[[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"_paste_file_", nil) action:@selector(pasteTouchFile:)]];
-        [items addObject:[[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"_paste_files_", nil) action:@selector(pasteTouchFiles:)]];
-
-        [menuController setMenuItems:items];
-        [menuController setTargetRect:CGRectMake(touchPoint.x, touchPoint.y, 0.0f, 0.0f) inView:self.tableView];
-        [menuController setMenuVisible:YES animated:YES];
-    }
-}
-
-- (BOOL)canBecomeFirstResponder
-{
-    return YES;
-}
-
-- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
-{
-    // For copy file, copy files, Open in ... :
-    //
-    // NO Directory
-    // NO Error Passcode
-    // NO In Session mode (download/upload)
-    // NO Template
-    
-    if (@selector(copyTouchFile:) == action || @selector(openinTouchFile:) == action || @selector(openQuickLookTouch:) == action) {
-        
-        if (_isSelectedMode == NO && self.metadata && !self.metadata.directory && self.metadata.status == k_metadataStatusNormal) return YES;
-        else return NO;
-    }
-    
-    if (@selector(copyTouchFiles:) == action) {
-        
-        if (_isSelectedMode) {
-            
-            NSArray *selectedMetadatas = [self getMetadatasFromSelectedRows:[self.tableView indexPathsForSelectedRows]];
-            
-            for (tableMetadata *metadata in selectedMetadatas) {
-                
-                if (!metadata.directory && metadata.status == k_metadataStatusNormal)
-                    return YES;
-            }
-        }
-        return NO;
-    }
-
-    if (@selector(pasteTouchFile:) == action) {
-        
-        UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
-        NSArray *items = [pasteboard items];
-        
-        if ([items count] == 1) {
-            
-            // Value : (NSData) ocId
-            
-            NSDictionary *dic = [items objectAtIndex:0];
-            
-            NSData *dataocId = [dic objectForKey: k_metadataKeyedUnarchiver];
-            NSString *ocId = [NSKeyedUnarchiver unarchiveObjectWithData:dataocId];
-            
-            if (ocId) {
-                tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", ocId]];
-                if (metadata) {
-                    return [CCUtility fileProviderStorageExists:metadata.ocId fileNameView:metadata.fileNameView];
-                } else {
-                    return NO;
-                }
-            }
-        }
-            
-        return NO;
-    }
-    
-    if (@selector(pasteTouchFiles:) == action) {
-        
-        BOOL isValid = NO;
-        
-        UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
-        NSArray *items = [pasteboard items];
-        
-        if ([items count] <= 1) return NO;
-        
-        for (NSDictionary *dic in items) {
-            
-            // Value : (NSData) ocId
-            
-            NSData *dataocId = [dic objectForKey: k_metadataKeyedUnarchiver];
-            NSString *ocId = [NSKeyedUnarchiver unarchiveObjectWithData:dataocId];
-
-            if (ocId) {
-                tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataFromOcId:ocId];
-                if (metadata) {
-                    if ([CCUtility fileProviderStorageExists:metadata.ocId fileNameView:metadata.fileNameView]) {
-                        isValid = YES;
-                    } else {
-                        isValid = NO;
-                        break;
-                    }
-                } else {
-                    isValid = NO;
-                    break;
-                }
-            } else {
-                isValid = NO;
-                break;
-            }
-        }
-        
-        return isValid;
-    }
-    
-    return NO;
-}
-
-/************************************ COPY ************************************/
-
-- (void)copyTouchFile:(id)sender
-{
-    // Remove all item
-    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
-    pasteboard.items = [[NSArray alloc] init];
-    
-    if ([CCUtility fileProviderStorageExists:self.metadata.ocId fileNameView:self.metadata.fileNameView]) {
-        
-        [self copyFileToPasteboard:self.metadata];
-        
-    } else {
-        
-        [[NCNetworking shared] downloadWithMetadata:self.metadata selector:selectorLoadCopy setFavorite:false completion:^(NSInteger errorCode) { }];
-    }
-}
-
-- (void)copyTouchFiles:(id)sender
-{
-    // Remove all item
-    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
-    pasteboard.items = [[NSArray alloc] init];
-    
-    NSArray *selectedMetadatas = [self getMetadatasFromSelectedRows:[self.tableView indexPathsForSelectedRows]];
-    
-    for (tableMetadata *metadata in selectedMetadatas) {
-        
-        if ([CCUtility fileProviderStorageExists:metadata.ocId fileNameView:metadata.fileNameView]) {
-            
-            [self copyFileToPasteboard:metadata];
-            
-        } else {
-
-            [[NCNetworking shared] downloadWithMetadata:metadata selector:selectorLoadCopy setFavorite:false completion:^(NSInteger errorCode) { }];
-        }
-    }
-    
-    [self tableViewSelect:false];
-}
-
-- (void)copyFileToPasteboard:(tableMetadata *)metadata
-{
-    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
-    NSMutableArray *items = [[NSMutableArray alloc] initWithArray:pasteboard.items];
-    
-    // Value : (NSData) ocId
-    
-    NSDictionary *item = [NSDictionary dictionaryWithObjectsAndKeys:[NSKeyedArchiver archivedDataWithRootObject:metadata.ocId], k_metadataKeyedUnarchiver,nil];
-    [items addObject:item];
-    
-    [pasteboard setItems:items];
-}
-
-/************************************ OPEN IN ... ******************************/
-
-- (void)openinTouchFile:(id)sender
-{
-    [[NCNetworkingNotificationCenter shared] downloadOpenWithMetadata:self.metadata selector:selectorOpenIn];
-}
-
-/************************************ OPEN QUICK LOOK ******************************/
-
-- (void)openQuickLookTouch:(id)sender
-{
-    [[NCNetworkingNotificationCenter shared] downloadOpenWithMetadata:self.metadata selector:selectorLoadFileQuickLook];
-}
-
-/************************************ PASTE ************************************/
-
-- (void)pasteTouchFile:(id)sender
-{
-    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
-    [self uploadFilePasteArray:[pasteboard items]];
-}
-
-- (void)pasteTouchFiles:(id)sender
-{
-    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
-    [self uploadFilePasteArray:[pasteboard items]];
-}
-
-- (void)uploadFilePasteArray:(NSArray *)items
-{
-    for (NSDictionary *dic in items) {
-        
-        // Value : (NSData) ocId
-        
-        NSData *dataocId = [dic objectForKey: k_metadataKeyedUnarchiver];
-        NSString *ocId = [NSKeyedUnarchiver unarchiveObjectWithData:dataocId];
-
-        tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataFromOcId:ocId];
-        
-        if (metadata) {
-            
-            if ([CCUtility fileProviderStorageExists:metadata.ocId fileNameView:metadata.fileNameView]) {
-                
-                NSString *fileName = [[NCUtility shared] createFileName:metadata.fileNameView serverUrl:self.serverUrl account:appDelegate.account];
-                NSString *ocId = [[NSUUID UUID] UUIDString];
-                
-                [CCUtility copyFileAtPath:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId fileNameView:metadata.fileNameView] toPath:[CCUtility getDirectoryProviderStorageOcId:ocId fileNameView:fileName]];
-                    
-                // Prepare record metadata
-                tableMetadata *metadataForUpload = [[NCManageDatabase sharedInstance] createMetadataWithAccount:appDelegate.account fileName:fileName ocId:ocId serverUrl:self.serverUrl urlBase:appDelegate.urlBase url:@"" contentType:@"" livePhoto:false];
-            
-                metadataForUpload.session = NCNetworking.shared.sessionIdentifierBackground;
-                metadataForUpload.sessionSelector = selectorUploadFile;
-                metadataForUpload.size = metadata.size;
-                metadataForUpload.status = k_metadataStatusWaitUpload;
-                            
-                // Add Medtadata for upload
-                [[NCManageDatabase sharedInstance] addMetadata:metadataForUpload];
-            }
-        }
-    }
-    
-    [[appDelegate networkingAutoUpload] startProcess];
-}
-
-#pragma mark -
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== menu action : Favorite, More, Delete [swipe] =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)canOpenMenuAction:(tableMetadata *)metadata
-{
-    if (metadata == nil)
-        return NO;
-    
-    // E2EE
-    if (_metadataFolder.e2eEncrypted && [CCUtility isEndToEndEnabled:appDelegate.account] == NO)
-        return NO;
-    
-    return YES;
-}
-
-- (BOOL)swipeTableCell:(MGSwipeTableCell *)cell canSwipe:(MGSwipeDirection)direction
-{
-    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
-    tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    return [self canOpenMenuAction:metadata];
-}
-
--(void)swipeTableCell:(nonnull MGSwipeTableCell *)cell didChangeSwipeState:(MGSwipeState)state gestureIsActive:(BOOL)gestureIsActive
-{
-}
-
-- (BOOL)swipeTableCell:(MGSwipeTableCell *)cell tappedButtonAtIndex:(NSInteger)index direction:(MGSwipeDirection)direction fromExpansion:(BOOL)fromExpansion
-{
-    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
-    self.metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    if (direction == MGSwipeDirectionRightToLeft) {
-        [self actionDelete:indexPath];
-    }
-    
-    if (direction == MGSwipeDirectionLeftToRight) {
-        [[NCNetworking shared] favoriteMetadata:self.metadata urlBase:appDelegate.urlBase completion:^(NSInteger errorCode, NSString *errorDescription) {
-            if (errorCode != 0) {
-                [[NCContentPresenter shared] messageNotification:@"_error_" description:errorDescription delay:k_dismissAfterSecond type:messageTypeError errorCode:errorCode forced:false];
-            }
-        }];
-    }
-    
-    return YES;
-}
-
-- (void)actionDelete:(NSIndexPath *)indexPath
-{
-    tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    tableLocalFile *localFile = [[NCManageDatabase sharedInstance] getTableLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadata.ocId]];
-    
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_delete_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
-        [self performSelector:@selector(deleteMetadatas) withObject:nil];
-    }]];
-    
-    if (localFile) {
-        [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_remove_local_file_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
-            tableMetadata *metadataLivePhoto = [[NCManageDatabase sharedInstance] isLivePhotoWithMetadata:metadata];
-            
-            [[NCManageDatabase sharedInstance] deleteLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadata.ocId]];
-            [[NSFileManager defaultManager] removeItemAtPath:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId] error:nil];
-            
-            if (metadataLivePhoto) {
-                [[NCManageDatabase sharedInstance] deleteLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadataLivePhoto.ocId]];
-                [[NSFileManager defaultManager] removeItemAtPath:[CCUtility getDirectoryProviderStorageOcId:metadataLivePhoto.ocId] error:nil];
-            }
-            
-            [self reloadDatasource:metadata.serverUrl ocId:metadata.ocId];
-        }]];
-    }
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
-    }]];
-    
-    alertController.popoverPresentationController.sourceView = self.tableView;
-    alertController.popoverPresentationController.sourceRect = [self.tableView rectForRowAtIndexPath:indexPath];
-    
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-        [alertController.view layoutIfNeeded];
-    
-    [self presentViewController:alertController animated:YES completion:nil];
-}
-
-- (void)actionMore:(UITapGestureRecognizer *)gestureRecognizer
-{
-    CGPoint touch = [gestureRecognizer locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:touch];
-    
-    self.metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    [self toggleMoreMenuWithViewController:self.tabBarController indexPath:indexPath metadata:self.metadata metadataFolder:_metadataFolder];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark - ==== Datasource ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)reloadDatasource:(NSNotification *)notification
-{
-    NSDictionary *userInfo = notification.userInfo;
-    NSString *ocId = userInfo[@"ocId"];
-    NSString *serverUrl = userInfo[@"serverUrl"];
-    
-    [self reloadDatasource:serverUrl ocId:ocId];
-}
-
-- (void)reloadDatasourceTransfer:(NSNotification *)notification
-{
-    if (self.view.window == nil) { return; }
-    
-    NSDictionary *userInfo = notification.userInfo;
-    tableMetadata *metadata = userInfo[@"metadata"];
-    NSInteger errorCode = [userInfo[@"errorCode"] integerValue];
-    NSString *errorDescription = userInfo[@"errorDescription"];
-    
-    if (errorCode != 0 && self.view.window != nil) {
-        [[NCContentPresenter shared] messageNotification:@"_error_" description:errorDescription delay:k_dismissAfterSecond type:messageTypeError errorCode:errorCode forced:false];
-    }
-    
-    [self reloadDatasource:metadata.serverUrl ocId:metadata.ocId];
-}
-
-- (void)reloadDatasource:(NSString *)serverUrl ocId:(NSString *)ocId
-{
-    // test
-    if (appDelegate.account.length == 0 || serverUrl.length == 0 || serverUrl == nil) // || self.view.window == nil)
-        return;
-    
-    // Se non siamo nella dir appropriata esci
-    if ([serverUrl isEqualToString:self.serverUrl] == NO || self.serverUrl == nil)
-        return;
-    
-    // live photo
-    livePhoto = [CCUtility getLivePhoto];
-    
-    // load share
-    appDelegate.shares = [[NCManageDatabase sharedInstance] getTableSharesWithAccount:appDelegate.account];
-    
-    // Search Mode
-    if (self.searchController.isActive) {
-        
-        // Create metadatas
-        NSMutableArray *metadatas = [NSMutableArray new];
-        for (tableMetadata *resultMetadata in _searchResultMetadatas) {
-            tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataFromOcId:resultMetadata.ocId];
-            if (metadata) {
-                [metadatas addObject:metadata];
-            }
-        }
-        
-        // [CCUtility getGroupBySettings]
-        sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:metadatas listProgressMetadata:nil groupBy:nil filterTypeFileImage:NO filterTypeFileVideo:NO filterLivePhoto:YES sort:@"fileName" ascending:NO directoryOnTop:NO account:appDelegate.account];
-
-        [self tableViewReloadData];
-        
-        if ([sectionDataSource.allRecordsDataSource count] == 0 && [_searchFileName length] >= k_minCharsSearch) {
-            
-            _noFilesSearchTitle = NSLocalizedString(@"_search_no_record_found_", nil);
-            _noFilesSearchDescription = @"";
-        }
-        
-        if ([sectionDataSource.allRecordsDataSource count] == 0 && [_searchFileName length] < k_minCharsSearch) {
-            
-            _noFilesSearchTitle = @"";
-            _noFilesSearchDescription = NSLocalizedString(@"_search_instruction_", nil);
-        }
-    
-        [self.tableView reloadEmptyDataSet];
-        
-        return;
-    }
-    
-    // Get MetadataFolder
-    if ([serverUrl isEqualToString:[[NCUtility shared] getHomeServerWithUrlBase:appDelegate.urlBase account:appDelegate.account]])
-        _metadataFolder = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.account, k_serverUrl_root]];
-    else
-        _metadataFolder = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.account, serverUrl]];
-    
-    _autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
-    _autoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectoryWithUrlBase:appDelegate.urlBase account:appDelegate.account];
-    
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-                
-        NSArray *recordsTableMetadata = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.account, serverUrl] page:0 limit:0 sorted:@"fileName" ascending:NO];
-        
-        // [CCUtility getGroupBySettings]
-        NSString *sort = [[NCUtility shared] getSortedForViewWithKey:k_layout_view_main];
-        BOOL ascending = [[NCUtility shared] getAscendingForViewWithKey:k_layout_view_main];
-        BOOL directoryOnTop = [[NCUtility shared] getDirectoryOnTopForViewWithKey:k_layout_view_main];
-
-        CCSectionDataSourceMetadata *sectionDataSourceTemp = [CCSectionMetadata creataDataSourseSectionMetadata:recordsTableMetadata listProgressMetadata:nil groupBy:nil filterTypeFileImage:NO filterTypeFileVideo:NO filterLivePhoto:YES sort:sort ascending:ascending directoryOnTop:directoryOnTop account:appDelegate.account];
-            
-        dispatch_async(dispatch_get_main_queue(), ^{
-            sectionDataSource = sectionDataSourceTemp;
-            [self tableViewReloadData];
-        });
-    });
-    
-    // BLINK
-    if (self.blinkFileNamePath != nil) {
-        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-            for (NSString *key in sectionDataSource.allRecordsDataSource) {
-                tableMetadata *metadata = [sectionDataSource.allRecordsDataSource objectForKey:key];
-                NSString *metadataFileNamePath = [NSString stringWithFormat:@"%@/%@", metadata.serverUrl, metadata.fileName];
-                if ([metadataFileNamePath isEqualToString:self.blinkFileNamePath]) {
-                    for (NSString *key in sectionDataSource.ocIdIndexPath) {
-                        if ([key isEqualToString:metadata.ocId]) {
-                            NSIndexPath *indexPath = [sectionDataSource.ocIdIndexPath objectForKey:key];
-                            [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:NO];
-                            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-                                CCCellMain *cell = [self.tableView cellForRowAtIndexPath:indexPath];
-                                if (cell) {
-                                    self.blinkFileNamePath = nil;
-                                    [[NCUtility shared] blinkWithCell:cell];
-                                }
-                            });
-                        }
-                    }
-                }
-            }
-        });
-    }
-}
-
-- (NSArray *)getMetadatasFromSelectedRows:(NSArray *)selectedRows
-{
-    NSMutableArray *metadatas = [[NSMutableArray alloc] init];
-    
-    if (selectedRows.count > 0) {
-    
-        for (NSIndexPath *selectionIndex in selectedRows) {
-            
-            NSString *ocId = [[sectionDataSource.sectionArrayRow objectForKey:[sectionDataSource.sections objectAtIndex:selectionIndex.section]] objectAtIndex:selectionIndex.row];
-            tableMetadata *metadata = [sectionDataSource.allRecordsDataSource objectForKey:ocId];
-
-            [metadatas addObject:metadata];
-        }
-    }
-    
-    return metadatas;
-}
-
-- (NSArray *)getMetadatasFromSectionDataSource:(NSInteger)section
-{
-    NSInteger totSections =[sectionDataSource.sections count] ;
-    
-    if ((totSections < (section + 1)) || ((section + 1) > totSections)) {
-        return nil;
-    }
-    
-    id valueSection = [sectionDataSource.sections objectAtIndex:section];
-    
-    return [sectionDataSource.sectionArrayRow objectForKey:valueSection];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark - ==== Table ==== 
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)tableViewToggle
-{
-    [self tableViewSelect:!_isSelectedMode];
-}
-
-- (void)tableViewSelect:(BOOL)toggle
-{
-    _isSelectedMode = toggle;
-    // chiudiamo eventuali swipe aperti
-    if (_isSelectedMode)
-        [self.tableView setEditing:NO animated:NO];
-    
-    [self.tableView setAllowsMultipleSelectionDuringEditing:_isSelectedMode];
-    [self.tableView setEditing:_isSelectedMode animated:YES];
-    
-    if (_isSelectedMode)
-        [self setUINavigationBarSelected];
-    else
-        [self setUINavigationBarDefault];
-    
-    [selectOcId removeAllObjects];
-    
-    [self setTitle];
-}
-
-- (void)tableViewReloadData
-{
-    // store selected cells before relod
-    NSArray *indexPaths = [self.tableView indexPathsForSelectedRows];
-    
-    // reload table view
-    [self.tableView reloadData];
-    
-    // selected cells stored
-    for (NSIndexPath *path in indexPaths)
-        [self.tableView selectRowAtIndexPath:path animated:NO scrollPosition:UITableViewScrollPositionNone];
-    
-    [self setTableViewHeader];
-    [self setTableViewFooter];
-    
-    if (self.tableView.editing)
-        [self setTitle];
-    
-    [self.tableView reloadEmptyDataSet];
-}
-
-- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
-{    
-    if (tableView.editing == 1) {
-        
-        tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-        
-        if (!metadata || [[NCManageDatabase sharedInstance] isTableInvalidated:metadata])
-            return NO;
-        
-        if (metadata == nil || metadata.status != k_metadataStatusNormal)
-            return NO;
-        else
-            return YES;
-        
-    } else {
-        
-        [selectOcId removeAllObjects];
-    }
-    
-    return YES;
-}
-
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    return 60;
-}
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
-    return [[sectionDataSource.sectionArrayRow allKeys] count];
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    return [[sectionDataSource.sectionArrayRow objectForKey:[sectionDataSource.sections objectAtIndex:section]] count];
-}
-- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
-{
-    return 0.0f;
-}
-
--(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
-{
-    float shift;
-    UIVisualEffectView *visualEffectView;
-    
-    NSString *titleSection = @"";
-    
-    if (![self indexPathIsValid:[NSIndexPath indexPathForRow:0 inSection:section]])
-        return nil;
-    
-    if ([[sectionDataSource.sections objectAtIndex:section] isKindOfClass:[NSString class]])
-        titleSection = [sectionDataSource.sections objectAtIndex:section];
-    
-    if ([[sectionDataSource.sections objectAtIndex:section] isKindOfClass:[NSDate class]])
-        titleSection = [CCUtility getTitleSectionDate:[sectionDataSource.sections objectAtIndex:section]];
-    
-    // Format title
-    UIVisualEffect *blurEffect;
-    blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
-    visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
-    visualEffectView.backgroundColor = [NCBrandColor.sharedInstance.brandElement colorWithAlphaComponent:0.2];
-    
-    if ([[CCUtility getGroupBySettings] isEqualToString:@"alphabetic"]) {
-        
-        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-            shift = - 35;
-        else
-            shift =  - 20;
-        
-    } else shift = - 10;
-    
-    // Title
-    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, -12, 0, 44)];
-    titleLabel.backgroundColor = [UIColor clearColor];
-    titleLabel.textColor = NCBrandColor.sharedInstance.textView;
-    titleLabel.font = [UIFont systemFontOfSize:12];
-    titleLabel.textAlignment = NSTextAlignmentLeft;
-    titleLabel.text = titleSection;
-    titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-
-    [visualEffectView.contentView addSubview:titleLabel];
-    
-    // Elements
-    UILabel *elementLabel= [[UILabel alloc]initWithFrame:CGRectMake(shift, -12, 0, 44)];
-    elementLabel.backgroundColor = [UIColor clearColor];
-    elementLabel.textColor = NCBrandColor.sharedInstance.textView;
-    elementLabel.font = [UIFont systemFontOfSize:12];
-    elementLabel.textAlignment = NSTextAlignmentRight;
-    elementLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    
-    NSArray *metadatas = [self getMetadatasFromSectionDataSource:section];
-    NSUInteger rowsCount = [metadatas count];
-    
-    if (rowsCount == 0) return nil;
-    if (rowsCount == 1) elementLabel.text = [NSString stringWithFormat:@"%lu %@", (unsigned long)rowsCount,  NSLocalizedString(@"_element_",nil)];
-    if (rowsCount > 1) elementLabel.text = [NSString stringWithFormat:@"%lu %@", (unsigned long)rowsCount,  NSLocalizedString(@"_elements_",nil)];
-    
-    [visualEffectView.contentView addSubview:elementLabel];
-    
-    return visualEffectView;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
-{
-    return [sectionDataSource.sections indexOfObject:title];
-}
-
-- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
-{
-    if ([[CCUtility getGroupBySettings] isEqualToString:@"alphabetic"])
-        return [[UILocalizedIndexedCollation currentCollation] sectionIndexTitles];
-    else
-        return nil;
-}
-
-/*
--(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    if([indexPath row] == ((NSIndexPath*)[[tableView indexPathsForVisibleRows] lastObject]).row){
-        
-    }
-}
-*/
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    tableShare *shareCell;
-   
-    if (metadata == nil || [[NCManageDatabase sharedInstance] isTableInvalidated:metadata] || (_metadataFolder != nil && [[NCManageDatabase sharedInstance] isTableInvalidated:_metadataFolder])) {
-        return [CCCellMain new];
-    }
-    
-    for (tableShare *share in appDelegate.shares) {
-        if ([share.serverUrl isEqualToString:metadata.serverUrl] && [share.fileName isEqualToString:metadata.fileName]) {
-            shareCell = share;
-            break;
-        }
-    }
-
-    UITableViewCell *cell = [[NCMainCommon shared] cellForRowAtIndexPath:indexPath tableView:tableView metadata:metadata metadataFolder:_metadataFolder serverUrl:self.serverUrl autoUploadFileName:_autoUploadFileName autoUploadDirectory:_autoUploadDirectory tableShare:shareCell livePhoto:livePhoto];
-    
-    // NORMAL - > MAIN
-    
-    if ([cell isKindOfClass:[CCCellMain class]]) {
-        
-        // Comment tap
-        if (metadata.commentsUnread) {
-            UITapGestureRecognizer *tapComment = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapActionComment:)];
-            [tapComment setNumberOfTapsRequired:1];
-            ((CCCellMain *)cell).comment.userInteractionEnabled = YES;
-            [((CCCellMain *)cell).comment addGestureRecognizer:tapComment];
-        }
-        
-        // Share add Tap
-        UITapGestureRecognizer *tapShare = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapActionShared:)];
-        [tapShare setNumberOfTapsRequired:1];
-        ((CCCellMain *)cell).viewShared.userInteractionEnabled = YES;
-        [((CCCellMain *)cell).viewShared addGestureRecognizer:tapShare];
-        
-        // More
-        if ([self canOpenMenuAction:metadata]) {
-            UITapGestureRecognizer *tapMore = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(actionMore:)];
-            [tapMore setNumberOfTapsRequired:1];
-            ((CCCellMain *)cell).more.userInteractionEnabled = YES;
-            [((CCCellMain *)cell).more addGestureRecognizer:tapMore];
-        }
-        
-        // MGSwipeButton
-        ((CCCellMain *)cell).delegate = self;
-
-        // LEFT
-        ((CCCellMain *)cell).leftButtons = @[[MGSwipeButton buttonWithTitle:@"" icon:self.cellFavouriteImage backgroundColor:NCBrandColor.sharedInstance.yellowFavorite padding:25]];
-        
-        ((CCCellMain *)cell).leftExpansion.buttonIndex = 0;
-        ((CCCellMain *)cell).leftExpansion.fillOnTrigger = NO;
-        
-        //centerIconOverText
-        MGSwipeButton *favoriteButton = (MGSwipeButton *)[((CCCellMain *)cell).leftButtons objectAtIndex:0];
-        [favoriteButton centerIconOverText];
-        
-        // RIGHT
-        ((CCCellMain *)cell).rightButtons = @[[MGSwipeButton buttonWithTitle:@"" icon:self.cellTrashImage backgroundColor:[UIColor redColor] padding:25]];
-        
-        ((CCCellMain *)cell).rightExpansion.buttonIndex = 0;
-        ((CCCellMain *)cell).rightExpansion.fillOnTrigger = NO;
-        
-        //centerIconOverText
-        MGSwipeButton *deleteButton = (MGSwipeButton *)[((CCCellMain *)cell).rightButtons objectAtIndex:0];
-        [deleteButton centerIconOverText];
-    }
-    
-    // TRANSFER
-    
-    if ([cell isKindOfClass:[CCCellMainTransfer class]]) {
-        
-        // gesture Transfer
-        [((CCCellMainTransfer *)cell).transferButton.stopButton addTarget:self action:@selector(cancelTaskButton:withEvent:) forControlEvents:UIControlEventTouchUpInside];
-        
-        UILongPressGestureRecognizer *stopLongGesture = [UILongPressGestureRecognizer new];
-        [stopLongGesture addTarget:self action:@selector(cancelAllTask:)];
-        [((CCCellMainTransfer *)cell).transferButton.stopButton addGestureRecognizer:stopLongGesture];
-    }
-    
-    return cell;
-    
-}
-
-- (void)setTableViewHeader
-{
-    NSInteger serverVersionMajor = [[NCManageDatabase sharedInstance] getCapabilitiesServerIntWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesVersionMajor];
-
-    NSString *trimmedRichWorkspaceText = [self.richWorkspaceText stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
-
-    if (serverVersionMajor < k_nextcloud_version_18_0 || trimmedRichWorkspaceText.length == 0 ) {
-                
-        [self.tableView.tableHeaderView setFrame:CGRectMake(self.tableView.tableHeaderView.frame.origin.x, self.tableView.tableHeaderView.frame.origin.y, self.tableView.frame.size.width, heightSearchBar)];
-        
-    } else {
-        
-        [self.viewRichWorkspace setFrame:CGRectMake(self.tableView.tableHeaderView.frame.origin.x, self.tableView.tableHeaderView.frame.origin.y, self.tableView.frame.size.width, heightRichWorkspace)];
-    }
-    
-    if (self.searchController.isActive == true) {
-        [self.tableView.tableHeaderView setFrame:CGRectMake(self.tableView.tableHeaderView.frame.origin.x, self.tableView.tableHeaderView.frame.origin.y, self.tableView.frame.size.width, 0)];
-    }
-    
-    [self.viewRichWorkspace setNeedsLayout];
-    [self.viewRichWorkspace loadWithRichWorkspaceText:self.richWorkspaceText];
-}
-
-- (void)setTableViewFooter
-{
-    UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 40)];
-    [footerView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin];
-    
-    UILabel *footerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 40)];
-    [footerLabel setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin];
-    
-    UIFont *appFont = [UIFont systemFontOfSize:12];
-    
-    footerLabel.font = appFont;
-    footerLabel.textColor = [UIColor grayColor];
-    footerLabel.backgroundColor = [UIColor clearColor];
-    footerLabel.textAlignment = NSTextAlignmentCenter;
-    
-    NSString *folders;
-    NSString *files;
-    NSString *footerText;
-    
-    if (sectionDataSource.directories > 1) {
-        folders = [NSString stringWithFormat:@"%ld %@", (long)sectionDataSource.directories, NSLocalizedString(@"_folders_", nil)];
-    } else if (sectionDataSource.directories == 1){
-        folders = [NSString stringWithFormat:@"%ld %@", (long)sectionDataSource.directories, NSLocalizedString(@"_folder_", nil)];
-    } else {
-        folders = @"";
-    }
-    
-    if (sectionDataSource.files > 1) {
-        files = [NSString stringWithFormat:@"%ld %@ %@", (long)sectionDataSource.files, NSLocalizedString(@"_files_", nil), [CCUtility transformedSize:sectionDataSource.totalSize]];
-    } else if (sectionDataSource.files == 1){
-        files = [NSString stringWithFormat:@"%ld %@ %@", (long)sectionDataSource.files, NSLocalizedString(@"_file_", nil), [CCUtility transformedSize:sectionDataSource.totalSize]];
-    } else {
-        files = @"";
-    }
-    
-    if ([folders isEqualToString:@""]) {
-        footerText = files;
-    } else if ([files isEqualToString:@""]) {
-        footerText = folders;
-    } else {
-        footerText = [NSString stringWithFormat:@"%@, %@", folders, files];
-    }
-    
-    footerLabel.text = footerText;
-    
-    [footerView addSubview:footerLabel];
-    [self.tableView setTableFooterView:footerView];
-}
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{    
-    CCCellMain *cell = [tableView cellForRowAtIndexPath:indexPath];
-    
-    // settiamo il record file.
-    self.metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    if (!self.metadata)
-        return;
-    
-    // se non può essere selezionata deseleziona
-    if ([cell isEditing] == NO)
-        [tableView deselectRowAtIndexPath:indexPath animated:YES];
-    
-    // se siamo in modalità editing impostiamo il titolo dei selezioati e usciamo subito
-    if (self.tableView.editing) {
-        
-        [selectOcId addObject:self.metadata.ocId];
-        [self setTitle];
-        return;
-    }
-    
-    if (self.metadata.status != k_metadataStatusNormal && self.metadata.status != k_metadataStatusDownloadError) {
-        return;
-    }
-    
-    // file
-    if (self.metadata.directory == NO) {
-        
-        // se il file esiste andiamo direttamente al delegato altrimenti carichiamolo
-        if ([CCUtility fileProviderStorageExists:self.metadata.ocId fileNameView:self.metadata.fileNameView]) {
-            
-            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_downloadedFile object:nil userInfo:@{@"metadata": self.metadata, @"selector": selectorLoadFileView, @"errorCode": @(0), @"errorDescription": @""}];
-                        
-        } else {
-            
-            if (_metadataFolder.e2eEncrypted && ![CCUtility isEndToEndEnabled:appDelegate.account]) {
-                
-                [[NCContentPresenter shared] messageNotification:@"_info_" description:@"_e2e_goto_settings_for_enable_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorE2EENotEnabled forced:true];
-                
-            } else {
-            
-                if (([self.metadata.typeFile isEqualToString: k_metadataTypeFile_video] || [self.metadata.typeFile isEqualToString: k_metadataTypeFile_audio]) && _metadataFolder.e2eEncrypted == NO) {
-                    
-                    [self shouldPerformSegue:self.metadata selector:@""];
-                    
-                } else if ([self.metadata.typeFile isEqualToString: k_metadataTypeFile_document] && [[NCUtility shared] isDirectEditingWithAccount:self.metadata.account contentType:self.metadata.contentType] != nil) {
-                    
-                    if (NCCommunication.shared.isNetworkReachable) {
-                        [self shouldPerformSegue:self.metadata selector:@""];
-                    } else {
-                        [[NCContentPresenter shared] messageNotification:@"_info_" description:@"_go_online_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorOffline forced:true];
-                    }
-                    
-                } else if ([self.metadata.typeFile isEqualToString: k_metadataTypeFile_document] && [[NCUtility shared] isRichDocument:self.metadata]) {
-                    
-                    if (NCCommunication.shared.isNetworkReachable) {
-                        [self shouldPerformSegue:self.metadata selector:@""];
-                    } else {
-                        [[NCContentPresenter shared] messageNotification:@"_info_" description:@"_go_online_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorOffline forced:true];
-                    }
-                    
-                } else {
-                    
-                    if ([self.metadata.typeFile isEqualToString: k_metadataTypeFile_image]) {
-                        [self shouldPerformSegue:self.metadata selector:selectorLoadFileView];
-                    }
-                   
-                    [[NCNetworking shared] downloadWithMetadata:self.metadata selector:selectorLoadFileView setFavorite:false completion:^(NSInteger errorCode) { }];
-                }
-            }
-        }
-    }
-    
-    if (self.metadata.directory) {
-        
-        [self performSegueDirectoryWithMetadata:self.metadata blinkFileNamePath:self.blinkFileNamePath];
-    }
-}
-
-- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(nonnull NSIndexPath *)indexPath
-{
-    tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    [selectOcId removeObject:metadata.ocId];
-    
-    [self setTitle];
-}
-
-- (void)didSelectAll
-{
-    for (int i = 0; i < self.tableView.numberOfSections; i++) {
-        for (int j = 0; j < [self.tableView numberOfRowsInSection:i]; j++) {
-            NSIndexPath *indexPath = [NSIndexPath indexPathForRow:j inSection:i];
-            tableMetadata *metadata = [[NCMainCommon shared] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-            [selectOcId addObject:metadata.ocId];
-            [self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
-        }
-    }
-    [self setTitle];
-}
-
-- (BOOL)indexPathIsValid:(NSIndexPath *)indexPath
-{
-    if (!indexPath)
-        return NO;
-    
-    NSInteger section = indexPath.section;
-    NSInteger row = indexPath.row;
-    
-    NSInteger lastSectionIndex = [self numberOfSectionsInTableView:self.tableView] - 1;
-    
-    if (section > lastSectionIndex || lastSectionIndex < 0)
-        return NO;
-    
-    NSInteger rowCount = [self.tableView numberOfRowsInSection:indexPath.section] - 1;
-    
-    if (rowCount < 0)
-        return NO;
-    
-    return row <= rowCount;
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Navigation ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)shouldPerformSegue:(tableMetadata *)metadata selector:(NSString *)selector
-{
-    // if background return
-    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) return;
-    
-    if (self.view.window == NO)
-        return;
-    
-    // Collapsed ma siamo già in detail esci
-    if (self.splitViewController.isCollapsed) {
-        if (appDelegate.activeDetail.isViewLoaded && appDelegate.activeDetail.view.window) return;
-    }
-    
-    // Metadata for push detail
-    self.metadataForPushDetail = metadata;
-    self.selectorForPushDetail = selector;
-    
-    [self performSegueWithIdentifier:@"segueDetail" sender:self];
-}
-
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
-{
-    tableMetadata *metadata;
-    NSMutableArray *photoDataSource = [NSMutableArray new];
-
-    UINavigationController *navigationController = segue.destinationViewController;
-    NCDetailViewController *detailViewController = (NCDetailViewController *)navigationController.topViewController;
-    
-    if ([sender isKindOfClass:[tableMetadata class]]) {
-    
-        metadata = sender;
-        [photoDataSource addObject:sender];
-        
-    } else {
-        
-        metadata = self.metadataForPushDetail;
-        
-        for (NSString *ocId in sectionDataSource.allOcId) {
-            tableMetadata *metadata = [sectionDataSource.allRecordsDataSource objectForKey:ocId];
-            if ([metadata.typeFile isEqualToString: k_metadataTypeFile_image])
-                [photoDataSource addObject:metadata];
-        }
-    }
-    
-    detailViewController.metadata = metadata;
-    detailViewController.selector = self.selectorForPushDetail;
-    
-    [detailViewController setTitle:metadata.fileNameView];
-}
-
-// can i go to next viewcontroller
-- (void)performSegueDirectoryWithMetadata:(tableMetadata *)metadata blinkFileNamePath:(NSString *)blinkFileNamePath
-{
-    NSString *nomeDir;
-    
-    if (self.tableView.editing == NO) {
-        
-        // E2EE Check enable
-        if (metadata.e2eEncrypted && [CCUtility isEndToEndEnabled:appDelegate.account] == NO) {
-            
-            [[NCContentPresenter shared] messageNotification:@"_info_" description:@"_e2e_goto_settings_for_enable_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorE2EENotEnabled forced:true];
-            return;
-        }
-        
-        nomeDir = metadata.fileName;
-        
-        NSString *serverUrlPush = [CCUtility stringAppendServerUrl:metadata.serverUrl addFileName:nomeDir];
-    
-        CCMain *viewController = [appDelegate.listMainVC objectForKey:serverUrlPush];
-        
-        if (!viewController) {
-            
-            viewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"CCMain"];
-            
-            viewController.serverUrl = serverUrlPush;
-            viewController.titleMain = metadata.fileNameView;
-            viewController.blinkFileNamePath = blinkFileNamePath;
-            
-            // save self
-            [appDelegate.listMainVC setObject:viewController forKey:serverUrlPush];
-            
-            [self.navigationController pushViewController:viewController animated:YES];
-        
-        } else {
-           
-            if (viewController.isViewLoaded) {
-                
-                viewController.titleMain = metadata.fileNameView;
-                viewController.blinkFileNamePath = blinkFileNamePath;
-                
-                // Fix : Application tried to present modally an active controller
-                if ([self.navigationController isBeingPresented]) {
-                    // being presented
-                } else if ([self.navigationController isMovingToParentViewController]) {
-                    // being pushed
-                } else {
-                    [self.navigationController pushViewController:viewController animated:YES];
-                }
-            }
-        }
-    }
-}
-
-@end

+ 0 - 67
iOSClient/Main/CCSection.h

@@ -1,67 +0,0 @@
-//
-//  CCSection.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 04/02/16.
-//  Copyright (c) 2016 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface CCSectionDataSourceMetadata : NSObject
-    
-@property (nonatomic, strong) NSMutableDictionary *allRecordsDataSource;
-@property (nonatomic, strong) NSMutableArray *allOcId;
-@property (nonatomic, strong) NSMutableArray *sections;
-@property (nonatomic, strong) NSMutableDictionary *sectionArrayRow;
-@property (nonatomic, strong) NSMutableDictionary *ocIdIndexPath;
-@property (nonatomic, strong) NSMutableArray *metadatas;
-
-@property NSInteger video;
-@property NSInteger image;
-
-@property NSInteger directories;
-@property NSInteger files;
-@property double totalSize;
-
-- (id)copyWithZone:(NSZone *)zone;
-
-@end
-
-@interface CCSectionMetadata : NSObject
-
-+ (CCSectionDataSourceMetadata *)creataDataSourseSectionMetadata:(NSArray *)arrayMetadatas listProgressMetadata:(NSMutableDictionary *)listProgressMetadata groupBy:(NSString *)groupBy filterTypeFileImage:(BOOL)filterTypeFileImage filterTypeFileVideo:(BOOL)filterTypeFileVideo filterLivePhoto:(BOOL)filterLivePhoto sort:(NSString *)sort ascending:(BOOL)ascending directoryOnTop:(BOOL)directoryOnTop account:(NSString *)account;
-
-+ (void)removeAllObjectsSectionDataSource:(CCSectionDataSourceMetadata *)sectionDataSource;
-
-@end
-
-// -----------------------------------
-
-@interface CCSectionDataSourceActivity : NSObject
-
-@property (nonatomic, strong) NSMutableArray *sections;
-@property (nonatomic, strong) NSMutableDictionary *sectionArrayRow;
-
-@end
-
-@interface CCSectionActivity : NSObject
-
-+ (CCSectionDataSourceActivity *)creataDataSourseSectionActivity:(NSArray *)records account:(NSString *)account;
-
-@end

+ 0 - 354
iOSClient/Main/CCSection.m

@@ -1,354 +0,0 @@
-//
-//  CCSection.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 04/02/16.
-//  Copyright (c) 2016 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCSection.h"
-#import "CCExifGeo.h"
-#import "NCBridgeSwift.h"
-
-@implementation CCSectionDataSourceMetadata
-
-- (id)init {
-    
-    self = [super init];
-    
-    _allRecordsDataSource = [[NSMutableDictionary alloc] init];
-    _allOcId  = [[NSMutableArray alloc] init];
-    _sections = [[NSMutableArray alloc] init];
-    _sectionArrayRow = [[NSMutableDictionary alloc] init];
-    _ocIdIndexPath = [[NSMutableDictionary alloc] init];
-    _metadatas = [NSMutableArray new];
-    
-    _image = 0;
-    _video = 0;
-    _directories = 0;
-    _files = 0;
-    _totalSize = 0;
-    
-    return self;
-}
-
-- (id)copyWithZone: (NSZone *) zone
-{
-    CCSectionDataSourceMetadata *sectionDataSourceMetadata = [[CCSectionDataSourceMetadata allocWithZone: zone] init];
-    
-    [sectionDataSourceMetadata setAllRecordsDataSource: self.allRecordsDataSource];
-    [sectionDataSourceMetadata setAllOcId: self.allOcId];
-    [sectionDataSourceMetadata setSections: self.sections];
-    [sectionDataSourceMetadata setSectionArrayRow: self.sectionArrayRow];
-    [sectionDataSourceMetadata setOcIdIndexPath: self.ocIdIndexPath];
-    [sectionDataSourceMetadata setMetadatas: self.metadatas];
-
-    [sectionDataSourceMetadata setVideo: self.video];
-    [sectionDataSourceMetadata setImage: self.image];
-    
-    [sectionDataSourceMetadata setDirectories: self.directories];
-    [sectionDataSourceMetadata setFiles: self.files];
-    [sectionDataSourceMetadata setTotalSize: self.totalSize];
-    
-    return sectionDataSourceMetadata;
-}
-
-@end
-
-
-@implementation CCSectionMetadata
-
-//
-// orderByField : nil, date, typeFile
-//
-+ (CCSectionDataSourceMetadata *)creataDataSourseSectionMetadata:(NSArray *)arrayMetadatas listProgressMetadata:(NSMutableDictionary *)listProgressMetadata groupBy:(NSString *)groupBy filterTypeFileImage:(BOOL)filterTypeFileImage filterTypeFileVideo:(BOOL)filterTypeFileVideo filterLivePhoto:(BOOL)filterLivePhoto sort:(NSString *)sort ascending:(BOOL)ascending directoryOnTop:(BOOL)directoryOnTop account:(NSString *)account
-{
-    id dataSection;
-    
-    NSMutableDictionary *dictionaryEtagMetadataForIndexPath = [NSMutableDictionary new];
-    CCSectionDataSourceMetadata *sectionDataSource = [CCSectionDataSourceMetadata new];
-    NSArray *arraySoprtedMetadatas;
-    NSMutableArray *filterocId = [NSMutableArray new];
-    
-    /*
-     Live Photo
-    */
-    
-    if ([CCUtility getLivePhoto] && filterLivePhoto) {
-        for (tableMetadata *metadata in arrayMetadatas) {
-            if ([metadata.ext isEqualToString:@"mov"] && metadata.livePhoto) {
-                [filterocId addObject:metadata.ocId];
-            }
-        }
-    }
-    
-    /*
-     Metadata order
-    */
-    
-    arraySoprtedMetadatas = [arrayMetadatas sortedArrayUsingComparator:^NSComparisonResult(tableMetadata *obj1, tableMetadata *obj2) {
-        // Sort with Locale
-        if ([sort isEqualToString:@"date"]) {
-            if (ascending) return [obj1.date compare:obj2.date];
-            else return [obj2.date compare:obj1.date];
-        } else if ([sort isEqualToString:@"sessionTaskIdentifier"]) {
-            if (ascending) return (obj1.sessionTaskIdentifier < obj2.sessionTaskIdentifier);
-            else return (obj1.sessionTaskIdentifier > obj2.sessionTaskIdentifier);
-        } else if ([sort isEqualToString:@"size"]) {
-            if (ascending) return (obj1.size < obj2.size);
-            else return (obj1.size > obj2.size);
-        } else {
-            if (ascending) return [obj1.fileNameView compare:obj2.fileNameView options:NSCaseInsensitiveSearch range:NSMakeRange(0,[obj1.fileNameView length]) locale:[NSLocale currentLocale]];
-            else return [obj2.fileNameView compare:obj1.fileNameView options:NSCaseInsensitiveSearch range:NSMakeRange(0,[obj2.fileNameView length]) locale:[NSLocale currentLocale]];
-        }
-    }];
-    
-    /*
-     Initialize datasource
-    */
-    
-    NSInteger numDirectory = 0;
-    NSInteger numDirectoryFavorite = 0;
-    NSMutableArray *metadataFilesFavorite = [NSMutableArray new];
-    
-    for (tableMetadata *metadata in arraySoprtedMetadatas) {
-        
-        // *** LIST : DO NOT INSERT ***
-        if ([filterocId containsObject: metadata.ocId] || (filterTypeFileImage == YES && [metadata.typeFile isEqualToString: k_metadataTypeFile_image]) || (filterTypeFileVideo == YES && [metadata.typeFile isEqualToString: k_metadataTypeFile_video])) {
-            continue;
-        }
-        
-        if ([listProgressMetadata objectForKey:metadata.ocId] && [groupBy isEqualToString:@"session"]) {
-            
-            [sectionDataSource.metadatas insertObject:metadata atIndex:0];
-            
-        } else {
-            
-            if (metadata.directory && directoryOnTop) {
-                if (metadata.favorite) {
-                    [sectionDataSource.metadatas insertObject:metadata atIndex:numDirectoryFavorite++];
-                    numDirectory++;
-                } else {
-                    [sectionDataSource.metadatas insertObject:metadata atIndex:numDirectory++];
-                }
-            } else {
-                if (metadata.favorite && directoryOnTop) {
-                    [metadataFilesFavorite addObject:metadata];
-                } else {
-                    [sectionDataSource.metadatas addObject:metadata];
-                }
-            }
-        }
-    }
-    if (directoryOnTop && metadataFilesFavorite.count > 0) {
-        [sectionDataSource.metadatas insertObjects:metadataFilesFavorite atIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(numDirectoryFavorite, metadataFilesFavorite.count)]]; // Add Favorite files at end of favorite folders
-    }
-    
-    /*
-     sectionArrayRow
-    */
-    
-    for (tableMetadata *metadata in  sectionDataSource.metadatas) {
-        
-        if ([metadata.session length] > 0 && [groupBy isEqualToString:@"session"]) {
-            
-            if ([metadata.session containsString:@"wwan"]) dataSection = [@"." stringByAppendingString:metadata.session];
-            else dataSection = metadata.session;
-        }
-        else if ([groupBy isEqualToString:@"none"]) dataSection = @"_none_";
-        else if ([groupBy isEqualToString:@"date"]) dataSection = [CCUtility datetimeWithOutTime:metadata.date];
-        else if ([groupBy isEqualToString:@"alphabetic"]) dataSection = [[metadata.fileNameView substringToIndex:1] uppercaseString];
-        else if ([groupBy isEqualToString:@"typefile"]) dataSection = metadata.typeFile;
-        if (!dataSection) dataSection = @"_none_";
-        
-        NSMutableArray *metadatasSection = [sectionDataSource.sectionArrayRow objectForKey:dataSection];
-        
-        if (metadatasSection) {
-            
-            // ROW ++
-            [metadatasSection addObject:metadata.ocId];
-            [sectionDataSource.sectionArrayRow setObject:metadatasSection forKey:dataSection];
-            
-        } else {
-            
-            // SECTION ++
-            metadatasSection = [[NSMutableArray alloc] initWithObjects:metadata.ocId, nil];
-            [sectionDataSource.sectionArrayRow setObject:metadatasSection forKey:dataSection];
-        }
-
-        if (metadata && [metadata.ocId length] > 0)
-            [dictionaryEtagMetadataForIndexPath setObject:metadata forKey:metadata.ocId];
-    }
-    
-    /*
-    Sections order
-    */
-    
-    /*
-    BOOL ascending;
-    
-    if ([groupByField isEqualToString:@"date"]) ascending = NO;
-    else ascending = YES;
-    */
-    
-    NSArray *sortSections = [[sectionDataSource.sectionArrayRow allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
-        
-        if ([groupBy isEqualToString:@"session"]) {
-        
-            if ([obj1 isKindOfClass:[NSString class]] && [obj1 containsString:@"download"]) return NSOrderedAscending;
-            if ([obj2 isKindOfClass:[NSString class]] && [obj2 containsString:@"download"]) return NSOrderedDescending;
-        
-            if ([obj1 isKindOfClass:[NSString class]] && [obj1 containsString:@"upload"]) return NSOrderedAscending;
-            if ([obj2 isKindOfClass:[NSString class]] && [obj2 containsString:@"upload"]) return NSOrderedDescending;
-        }
-        
-        // Directory at Top
-        if ([obj1 isKindOfClass:[NSString class]] && [obj1 containsString: k_metadataTypeFile_directory]) return NSOrderedAscending;
-        if ([obj2 isKindOfClass:[NSString class]] && [obj2 containsString: k_metadataTypeFile_directory]) return NSOrderedDescending;
-        
-        // Sort with Locale
-        if ([obj1 isKindOfClass:[NSDate class]]) {
-            if (ascending) return [obj1 compare:obj2];
-            else return [obj2 compare:obj1];
-        } else {
-            if (ascending) return [obj1 compare:obj2 options:NSCaseInsensitiveSearch range:NSMakeRange(0,[obj1 length]) locale:[NSLocale currentLocale]];
-            else return [obj2 compare:obj1 options:NSCaseInsensitiveSearch range:NSMakeRange(0,[obj2 length]) locale:[NSLocale currentLocale]];
-        }
-    }];
-    
-    /*
-    create allEtag, allRecordsDataSource, ocIdIndexPath, section
-    */
-    
-    NSInteger indexSection = 0;
-    NSInteger indexRow = 0;
-    
-    for (id section in sortSections) {
-        
-        [sectionDataSource.sections addObject:section];
-        
-        NSArray *rows = [sectionDataSource.sectionArrayRow objectForKey:section];
-        
-        for (NSString *ocId in rows) {
-            
-            tableMetadata *metadata = [dictionaryEtagMetadataForIndexPath objectForKey:ocId];
-            
-            if (metadata.ocId) {
-                
-                [sectionDataSource.allOcId addObject:metadata.ocId];
-                [sectionDataSource.allRecordsDataSource setObject:metadata forKey:metadata.ocId];
-                [sectionDataSource.ocIdIndexPath setObject:[NSIndexPath indexPathForRow:indexRow inSection:indexSection] forKey:metadata.ocId];
-                
-                if ([metadata.typeFile isEqualToString: k_metadataTypeFile_image])
-                    sectionDataSource.image++;
-                if ([metadata.typeFile isEqualToString: k_metadataTypeFile_video])
-                    sectionDataSource.video++;
-                if (metadata.directory)
-                    sectionDataSource.directories++;
-                else {
-                    sectionDataSource.files++;
-                    sectionDataSource.totalSize = sectionDataSource.totalSize + metadata.size;
-                }
-                
-                indexRow++;
-            }
-        }
-        indexSection++;
-        indexRow = 0;
-    }
-    
-    /*
-    end
-    */
-    
-    return sectionDataSource;
-}
-
-+ (void)removeAllObjectsSectionDataSource:(CCSectionDataSourceMetadata *)sectionDataSource
-{
-    [sectionDataSource.allRecordsDataSource removeAllObjects];
-    [sectionDataSource.allOcId removeAllObjects];
-    [sectionDataSource.sections removeAllObjects];
-    [sectionDataSource.sectionArrayRow removeAllObjects];
-    [sectionDataSource.ocIdIndexPath removeAllObjects];
-    
-    sectionDataSource.image = 0;
-    sectionDataSource.video = 0;
-    sectionDataSource.directories = 0;
-    sectionDataSource.files = 0;
-    sectionDataSource.totalSize = 0;
-}
-
-@end
-
-
-@implementation CCSectionDataSourceActivity
-
-- (id)init {
-    
-    self = [super init];
-    
-    _sections = [NSMutableArray new];
-    _sectionArrayRow = [NSMutableDictionary new];
-
-    return self;
-}
-
-@end
-
-@implementation CCSectionActivity
-
-+ (CCSectionDataSourceActivity *)creataDataSourseSectionActivity:(NSArray *)records account:(NSString *)account
-{
-    CCSectionDataSourceActivity *sectionDataSource = [CCSectionDataSourceActivity new];
-    NSDate *oldDate = [NSDate date];
-    
-    for (tableActivity *record in records) {
-        
-        NSDateComponents* comps = [[NSCalendar currentCalendar] components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay fromDate:record.date];
-        NSDate *date = [[NSCalendar currentCalendar] dateFromComponents:comps];
-        
-        if ([oldDate compare:date] != NSOrderedSame) {
-            
-            [sectionDataSource.sections addObject:date];
-            oldDate = date;
-        }
-        
-        NSMutableArray *activities = [sectionDataSource.sectionArrayRow objectForKey:date];
-        
-        if (activities) {
-            
-            // ROW ++
-            [activities addObject:record];
-            [sectionDataSource.sectionArrayRow setObject:activities forKey:date];
-            
-        } else {
-            
-            // SECTION ++
-            activities = [[NSMutableArray alloc] initWithObjects:record, nil];
-            [sectionDataSource.sectionArrayRow setObject:activities forKey:date];
-        }
-    }
-    
-    return sectionDataSource;
-}
-
-@end
-
-
-

+ 0 - 74
iOSClient/Main/Cell/CCCellMain.swift

@@ -1,74 +0,0 @@
-//
-//  CCCellMain.swift
-//  Nextcloud
-//
-//  Created by Philippe Weidmann on 05.06.20.
-//  Copyright © 2020 Marino Faggiana. All rights reserved.
-//
-
-import UIKit
-import MGSwipeTableCell
-
-class CCCellMain: MGSwipeTableCell, NCImageCellProtocol {
-
-    @IBOutlet weak var file: UIImageView!
-    @IBOutlet weak var status: UIImageView!
-    @IBOutlet weak var favorite: UIImageView!
-    @IBOutlet weak var local: UIImageView!
-    @IBOutlet weak var comment: UIImageView!
-    @IBOutlet weak var shared: UIImageView!
-    @IBOutlet weak var viewShared: UIView!
-    @IBOutlet weak var more: UIImageView!
-    @IBOutlet weak var labelTitle: UILabel!
-    @IBOutlet weak var labelInfoFile: UILabel!
-
-    @IBOutlet weak var labelTitleTrailingConstraint: NSLayoutConstraint!
-
-    var filePreviewImageView : UIImageView {
-        get{
-         return file
-        }
-    }
-    
-    override func awakeFromNib() {
-        super.awakeFromNib()
-        self.initCell()
-    }
-    
-    override func prepareForReuse() {
-        super.prepareForReuse()
-        self.initCell()
-    }
-
-    override func setSelected(_ selected: Bool, animated: Bool) {
-        super.setSelected(selected, animated: animated)
-
-        self.contentView.preservesSuperviewLayoutMargins = false
-    }
-    
-    func initCell() {
-        separatorInset = UIEdgeInsets.init(top: 0, left: 60, bottom: 0, right: 0)
-        accessoryType = UITableViewCell.AccessoryType.none
-        file.image = nil
-        file.layer.cornerRadius = 6
-        file.layer.masksToBounds = true
-        status.image = nil
-        favorite.image = nil
-        shared.image = nil
-        local.image = nil
-        comment.image = nil
-        shared.isUserInteractionEnabled = false
-        backgroundColor = NCBrandColor.sharedInstance.backgroundView
-        
-        // change color selection
-        let selectionColor = UIView()
-        selectionColor.backgroundColor = NCBrandColor.sharedInstance.select
-        selectedBackgroundView = selectionColor
-        tintColor = NCBrandColor.sharedInstance.brandElement
-        
-        labelTitle.textColor = NCBrandColor.sharedInstance.textView
-        
-        file.backgroundColor = nil
-    }
-
-}

+ 0 - 136
iOSClient/Main/Cell/CCCellMain.xib

@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait" appearance="light"/>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CustomCellFileAndDirectory"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="0.0" reuseIdentifier="CellMain" id="2" customClass="CCCellMain" customModule="Nextcloud" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="600" height="60"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
-            <tableViewCellContentView key="contentView" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2" id="sQq-jC-UEV">
-                <rect key="frame" x="0.0" y="0.0" width="600" height="60"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QNC-8X-DAC">
-                        <rect key="frame" x="65" y="13" width="425" height="18"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
-                        <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        <nil key="highlightedColor"/>
-                    </label>
-                    <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p7I-KN-FVZ">
-                        <rect key="frame" x="65" y="31" width="425" height="15"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                        <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
-                        <nil key="highlightedColor"/>
-                    </label>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="5">
-                        <rect key="frame" x="15" y="10" width="40" height="40"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="40" id="kM5-Uf-S8Z"/>
-                            <constraint firstAttribute="height" constant="40" id="ukt-iQ-Nva"/>
-                        </constraints>
-                    </imageView>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Fw2-NW-hsK" userLabel="Status">
-                        <rect key="frame" x="10" y="40" width="15" height="15"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="15" id="EkP-Tz-P1M"/>
-                            <constraint firstAttribute="height" constant="15" id="lkK-a4-Q2V"/>
-                        </constraints>
-                    </imageView>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="DQR-yN-JaH" userLabel="Local">
-                        <rect key="frame" x="44" y="40.5" width="15" height="15"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="15" id="bgo-QS-x7k"/>
-                            <constraint firstAttribute="width" constant="15" id="g4P-aH-jOh"/>
-                        </constraints>
-                    </imageView>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="QQH-5M-Zyv" userLabel="Favorite">
-                        <rect key="frame" x="44" y="4" width="15" height="15"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="15" id="MT4-aL-Ops"/>
-                            <constraint firstAttribute="height" constant="15" id="Oxa-YI-vu7"/>
-                        </constraints>
-                    </imageView>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="avatar" translatesAutoresizingMaskIntoConstraints="NO" id="qhJ-el-R92" userLabel="Shared">
-                        <rect key="frame" x="510" y="15" width="30" height="30"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="30" id="3Kr-Hv-AdZ"/>
-                            <constraint firstAttribute="width" constant="30" id="Ijp-se-6KO"/>
-                        </constraints>
-                    </imageView>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HRe-1g-6Q1" userLabel="ViewShared">
-                        <rect key="frame" x="500" y="1" width="50" height="58"/>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                        <color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="58" id="0wA-tf-66c"/>
-                            <constraint firstAttribute="width" constant="50" id="qwf-D7-GQV"/>
-                        </constraints>
-                    </view>
-                    <imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="aRp-Ql-cyA" userLabel="More">
-                        <rect key="frame" x="550" y="0.0" width="50" height="60"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="60" id="2ti-Wp-PzP"/>
-                            <constraint firstAttribute="width" constant="50" id="yIY-em-v2F"/>
-                        </constraints>
-                    </imageView>
-                    <imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Gci-mp-QNh" userLabel="Comment">
-                        <rect key="frame" x="450" y="0.0" width="50" height="60"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="60" id="26v-yY-Eaq"/>
-                            <constraint firstAttribute="width" constant="50" id="M8j-zF-tB7"/>
-                        </constraints>
-                    </imageView>
-                </subviews>
-                <constraints>
-                    <constraint firstItem="aRp-Ql-cyA" firstAttribute="leading" secondItem="HRe-1g-6Q1" secondAttribute="trailing" id="17F-cr-JRN"/>
-                    <constraint firstItem="Gci-mp-QNh" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="1DB-lM-7dD"/>
-                    <constraint firstAttribute="bottom" secondItem="p7I-KN-FVZ" secondAttribute="bottom" constant="14" id="2Ay-YK-f66"/>
-                    <constraint firstItem="5" firstAttribute="leading" secondItem="Fw2-NW-hsK" secondAttribute="trailing" constant="-10" id="32q-iB-1GU"/>
-                    <constraint firstItem="DQR-yN-JaH" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="-9.5" id="3A5-mA-6Hh"/>
-                    <constraint firstItem="QNC-8X-DAC" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="top" constant="13" id="4ds-S3-swp"/>
-                    <constraint firstItem="5" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leading" constant="15" id="5es-ma-EXb"/>
-                    <constraint firstItem="qhJ-el-R92" firstAttribute="centerX" secondItem="HRe-1g-6Q1" secondAttribute="centerX" id="9bQ-Is-znw"/>
-                    <constraint firstItem="aRp-Ql-cyA" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="DOx-77-6Mg"/>
-                    <constraint firstAttribute="trailing" secondItem="p7I-KN-FVZ" secondAttribute="trailing" constant="110" id="JlG-wl-TXg"/>
-                    <constraint firstItem="qhJ-el-R92" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="Jrh-En-806"/>
-                    <constraint firstItem="p7I-KN-FVZ" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="Rcn-fx-Tz6"/>
-                    <constraint firstItem="QNC-8X-DAC" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="TON-2X-Sf9"/>
-                    <constraint firstItem="Fw2-NW-hsK" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="-10" id="WBB-F1-EeD"/>
-                    <constraint firstItem="5" firstAttribute="top" secondItem="QQH-5M-Zyv" secondAttribute="bottom" constant="-9" id="bNf-mC-wVr"/>
-                    <constraint firstItem="HRe-1g-6Q1" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="dko-At-sWL"/>
-                    <constraint firstItem="HRe-1g-6Q1" firstAttribute="leading" secondItem="Gci-mp-QNh" secondAttribute="trailing" id="h70-Ov-4F7"/>
-                    <constraint firstItem="QQH-5M-Zyv" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="-11" id="jUJ-Sc-hQy"/>
-                    <constraint firstAttribute="trailing" secondItem="QNC-8X-DAC" secondAttribute="trailing" constant="110" id="ljw-Qp-g60"/>
-                    <constraint firstItem="DQR-yN-JaH" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="-11" id="nA1-42-OwZ"/>
-                    <constraint firstItem="5" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="nyn-bs-x8N"/>
-                    <constraint firstAttribute="trailing" secondItem="aRp-Ql-cyA" secondAttribute="trailing" id="o1F-h3-kBd"/>
-                </constraints>
-            </tableViewCellContentView>
-            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-            <gestureRecognizers/>
-            <connections>
-                <outlet property="comment" destination="Gci-mp-QNh" id="l6k-8K-UB7"/>
-                <outlet property="favorite" destination="QQH-5M-Zyv" id="c7k-6l-9Jt"/>
-                <outlet property="file" destination="5" id="Lfe-3W-yYr"/>
-                <outlet property="labelInfoFile" destination="p7I-KN-FVZ" id="5Yb-hH-k73"/>
-                <outlet property="labelTitle" destination="QNC-8X-DAC" id="dFX-Cb-8IE"/>
-                <outlet property="labelTitleTrailingConstraint" destination="ljw-Qp-g60" id="Iu0-wc-FFr"/>
-                <outlet property="local" destination="DQR-yN-JaH" id="LBA-Bm-Mz9"/>
-                <outlet property="more" destination="aRp-Ql-cyA" id="vbC-Za-UhD"/>
-                <outlet property="shared" destination="qhJ-el-R92" id="P3Z-pt-baO"/>
-                <outlet property="status" destination="Fw2-NW-hsK" id="PjC-tV-ROx"/>
-                <outlet property="viewShared" destination="HRe-1g-6Q1" id="32S-Ee-2cG"/>
-            </connections>
-            <point key="canvasLocation" x="664" y="152.02398800599701"/>
-        </tableViewCell>
-    </objects>
-    <resources>
-        <image name="avatar" width="25" height="25"/>
-    </resources>
-</document>

+ 0 - 55
iOSClient/Main/Cell/CCCellMainTransfer.swift

@@ -1,55 +0,0 @@
-//
-//  CCCellMainTransfer.swift
-//  Nextcloud
-//
-//  Created by Philippe Weidmann on 05.06.20.
-//  Copyright © 2020 Marino Faggiana. All rights reserved.
-//
-
-import UIKit
-
-class CCCellMainTransfer: UITableViewCell, NCImageCellProtocol {
-
-    @IBOutlet weak var file: UIImageView!
-    @IBOutlet weak var status: UIImageView!
-    @IBOutlet weak var user: UIImageView!
-
-    @IBOutlet weak var labelTitle: UILabel!
-    @IBOutlet weak var labelInfoFile: UILabel!
-
-    @IBOutlet weak var transferButton: PKStopDownloadButton!
-
-    var filePreviewImageView: UIImageView {
-        get {
-            return file
-        }
-    }
-
-    override func awakeFromNib() {
-        super.awakeFromNib()
-        self.initCell()
-    }
-
-    override func prepareForReuse() {
-        super.prepareForReuse()
-        self.initCell()
-    }
-
-    func initCell() {
-        separatorInset = UIEdgeInsets.init(top: 0, left: 60, bottom: 0, right: 0)
-        accessoryType = UITableViewCell.AccessoryType.none
-        file.image = nil
-        file.layer.cornerRadius = 6
-        file.layer.masksToBounds = true
-        status.image = nil
-        user.image = nil
-        backgroundColor = NCBrandColor.sharedInstance.backgroundView
-
-        labelTitle.textColor = NCBrandColor.sharedInstance.textView
-        transferButton.tintColor = NCBrandColor.sharedInstance.optionItem
-        labelTitle.isEnabled = true
-        labelInfoFile.isEnabled = true
-        file.backgroundColor = nil
-    }
-
-}

+ 0 - 108
iOSClient/Main/Cell/CCCellMainTransfer.xib

@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait" appearance="light"/>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CustomCellFileAndDirectory"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="0.0" reuseIdentifier="CellMainTransfer" id="2" customClass="CCCellMainTransfer" customModule="Nextcloud" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="600" height="60"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
-            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2" id="sQq-jC-UEV">
-                <rect key="frame" x="0.0" y="0.0" width="600" height="60"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QNC-8X-DAC" userLabel="labelTitle">
-                        <rect key="frame" x="65" y="13" width="484" height="18"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
-                        <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        <nil key="highlightedColor"/>
-                    </label>
-                    <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p7I-KN-FVZ" userLabel="labelInfoFile">
-                        <rect key="frame" x="65" y="31.5" width="484" height="15"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                        <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.63921568627450975" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        <nil key="highlightedColor"/>
-                    </label>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="5" userLabel="file">
-                        <rect key="frame" x="15" y="10" width="40" height="40"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="40" id="kM5-Uf-S8Z"/>
-                            <constraint firstAttribute="height" constant="40" id="l9C-BW-ogy"/>
-                        </constraints>
-                    </imageView>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="DQR-yN-JaH" userLabel="status">
-                        <rect key="frame" x="10" y="40" width="15" height="15"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="15" id="bgo-QS-x7k"/>
-                            <constraint firstAttribute="width" constant="15" id="g4P-aH-jOh"/>
-                        </constraints>
-                    </imageView>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dhS-83-mLd" userLabel="transferButton" customClass="PKStopDownloadButton">
-                        <rect key="frame" x="557" y="15" width="30" height="30"/>
-                        <color key="tintColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="30" id="D19-j7-ihe"/>
-                            <constraint firstAttribute="height" constant="30" id="cqM-8R-MXo"/>
-                        </constraints>
-                        <userDefinedRuntimeAttributes>
-                            <userDefinedRuntimeAttribute type="number" keyPath="radius">
-                                <real key="value" value="15"/>
-                            </userDefinedRuntimeAttribute>
-                            <userDefinedRuntimeAttribute type="number" keyPath="stopButtonWidth">
-                                <real key="value" value="10"/>
-                            </userDefinedRuntimeAttribute>
-                            <userDefinedRuntimeAttribute type="number" keyPath="progress">
-                                <real key="value" value="0.0"/>
-                            </userDefinedRuntimeAttribute>
-                            <userDefinedRuntimeAttribute type="number" keyPath="filledLineWidth">
-                                <real key="value" value="2"/>
-                            </userDefinedRuntimeAttribute>
-                            <userDefinedRuntimeAttribute type="number" keyPath="emptyLineWidth">
-                                <real key="value" value="1"/>
-                            </userDefinedRuntimeAttribute>
-                        </userDefinedRuntimeAttributes>
-                    </view>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="jy6-cx-LK4">
-                        <rect key="frame" x="35" y="30" width="25" height="25"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="25" id="3xZ-lf-n4v"/>
-                            <constraint firstAttribute="height" constant="25" id="l81-IO-fzK"/>
-                        </constraints>
-                    </imageView>
-                </subviews>
-                <color key="tintColor" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                <constraints>
-                    <constraint firstItem="QNC-8X-DAC" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="0Oa-uE-QbX"/>
-                    <constraint firstItem="5" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leading" constant="15" id="1B0-QJ-6w2"/>
-                    <constraint firstItem="p7I-KN-FVZ" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="4Xt-42-ra7"/>
-                    <constraint firstItem="5" firstAttribute="leading" secondItem="DQR-yN-JaH" secondAttribute="trailing" constant="-10" id="6Op-l4-GTN"/>
-                    <constraint firstItem="DQR-yN-JaH" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="-10" id="CGn-pQ-QmD"/>
-                    <constraint firstItem="jy6-cx-LK4" firstAttribute="bottom" secondItem="5" secondAttribute="bottom" constant="5" id="MNe-PS-i7m"/>
-                    <constraint firstItem="jy6-cx-LK4" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" constant="5" id="Ooq-nL-VC8"/>
-                    <constraint firstItem="dhS-83-mLd" firstAttribute="leading" secondItem="QNC-8X-DAC" secondAttribute="trailing" constant="8" id="Z0z-bK-Qhh"/>
-                    <constraint firstItem="5" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="asW-ir-Cfb"/>
-                    <constraint firstItem="QNC-8X-DAC" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="top" constant="13" id="d78-LV-sUw"/>
-                    <constraint firstItem="dhS-83-mLd" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="eA9-jd-n75"/>
-                    <constraint firstAttribute="trailing" secondItem="dhS-83-mLd" secondAttribute="trailing" constant="13" id="j62-Bl-LTq"/>
-                    <constraint firstItem="dhS-83-mLd" firstAttribute="leading" secondItem="p7I-KN-FVZ" secondAttribute="trailing" constant="8" id="mBK-VJ-KZG"/>
-                    <constraint firstAttribute="bottom" secondItem="p7I-KN-FVZ" secondAttribute="bottom" constant="13.5" id="ofO-Ef-6wt"/>
-                </constraints>
-            </tableViewCellContentView>
-            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-            <connections>
-                <outlet property="file" destination="5" id="h6v-aL-JbR"/>
-                <outlet property="labelInfoFile" destination="p7I-KN-FVZ" id="bIH-yL-aSv"/>
-                <outlet property="labelTitle" destination="QNC-8X-DAC" id="coV-Xj-n1Q"/>
-                <outlet property="status" destination="DQR-yN-JaH" id="neR-jW-zwL"/>
-                <outlet property="transferButton" destination="dhS-83-mLd" id="eza-fH-eAU"/>
-                <outlet property="user" destination="jy6-cx-LK4" id="PgZ-Rz-vJZ"/>
-            </connections>
-            <point key="canvasLocation" x="662.39999999999998" y="219.49025487256372"/>
-        </tableViewCell>
-    </objects>
-</document>

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

@@ -330,8 +330,8 @@ import NCCommunication
                         self.dismiss(animated: true, completion: {
                             let metadata = NCManageDatabase.sharedInstance.createMetadata(account: self.appDelegate.account, fileName: fileName, ocId: CCUtility.createRandomString(12), serverUrl: self.serverUrl, urlBase: self.appDelegate.urlBase, url: url ?? "", contentType: result.contentType, livePhoto: false)
                             
-                            if self.appDelegate.activeViewController is CCMain {
-                                (self.appDelegate.activeViewController as! CCMain).shouldPerformSegue(metadata, selector: "")
+                            if self.appDelegate.activeViewController is NCFiles {
+                                (self.appDelegate.activeViewController as! NCFiles).segue(metadata: metadata)
                             } else if self.appDelegate.activeViewController is NCFavorite {
                                 (self.appDelegate.activeViewController as! NCFavorite).segue(metadata: metadata)
                             } else if self.appDelegate.activeViewController is NCOffline {
@@ -358,8 +358,8 @@ import NCCommunication
                     
                         let metadata = NCManageDatabase.sharedInstance.createMetadata(account: self.appDelegate.account, fileName: (fileName as NSString).deletingPathExtension + "." + self.fileNameExtension, ocId: CCUtility.createRandomString(12), serverUrl: self.serverUrl, urlBase: self.appDelegate.urlBase, url: url!, contentType: "", livePhoto: false)
                     
-                        if self.appDelegate.activeViewController is CCMain {
-                            (self.appDelegate.activeViewController as! CCMain).shouldPerformSegue(metadata, selector: "")
+                        if self.appDelegate.activeViewController is NCFiles {
+                            (self.appDelegate.activeViewController as! NCFiles).segue(metadata: metadata)
                         } else if self.appDelegate.activeViewController is NCFavorite {
                             (self.appDelegate.activeViewController as! NCFavorite).segue(metadata: metadata)
                         } else if self.appDelegate.activeViewController is NCOffline {

+ 17 - 42
iOSClient/Main/Main.storyboard

@@ -208,13 +208,13 @@
                 <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="bSZ-tE-FEj" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="File" id="Zxv-aS-HGF"/>
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" largeTitles="YES" id="cj6-rT-wnB">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" largeTitles="YES" id="cj6-rT-wnB">
                         <rect key="frame" x="0.0" y="44" width="414" height="96"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
                     <nil name="viewControllers"/>
                     <connections>
-                        <segue destination="DGE-qR-SnB" kind="relationship" relationship="rootViewController" id="Zy5-nA-QZa"/>
+                        <segue destination="fdj-aV-gGf" kind="relationship" relationship="rootViewController" id="mIO-J3-3uM"/>
                     </connections>
                 </navigationController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="k95-tV-JJx" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -227,8 +227,8 @@
                 <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="hwM-4d-Afb" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="Favorites" id="o09-67-hwf"/>
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="MJw-Bn-5le">
-                        <rect key="frame" x="0.0" y="44" width="414" height="44"/>
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" largeTitles="YES" id="MJw-Bn-5le">
+                        <rect key="frame" x="0.0" y="44" width="414" height="96"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
                     <nil name="viewControllers"/>
@@ -246,8 +246,8 @@
                 <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="Npr-vu-PSD" userLabel="Media" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="Media" id="5cw-bP-7It"/>
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="ixg-Pw-TNO">
-                        <rect key="frame" x="0.0" y="44" width="414" height="44"/>
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" largeTitles="YES" id="ixg-Pw-TNO">
+                        <rect key="frame" x="0.0" y="44" width="414" height="96"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
                     <nil name="viewControllers"/>
@@ -265,8 +265,8 @@
                 <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="Cc7-4O-z6Q" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" enabled="NO" title="" image="tabBarPlus" id="vIy-cM-ojV"/>
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="jCU-so-Np6">
-                        <rect key="frame" x="0.0" y="44" width="414" height="44"/>
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" largeTitles="YES" id="jCU-so-Np6">
+                        <rect key="frame" x="0.0" y="44" width="414" height="96"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
                     <nil name="viewControllers"/>
@@ -281,8 +281,8 @@
                 <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="1Z8-Bx-Dqo" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="More" id="U4f-qS-cgh"/>
                     <toolbarItems/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="yVo-p8-ApS">
-                        <rect key="frame" x="0.0" y="44" width="414" height="44"/>
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" largeTitles="YES" id="yVo-p8-ApS">
+                        <rect key="frame" x="0.0" y="44" width="414" height="96"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
                     <nil name="viewControllers"/>
@@ -381,37 +381,15 @@
             </objects>
             <point key="canvasLocation" x="9900" y="1217"/>
         </scene>
-        <!--Main-->
-        <scene sceneID="5Py-sI-zil">
+        <!--NCFiles.storyboard-->
+        <scene sceneID="xwl-IR-lkD">
             <objects>
-                <tableViewController storyboardIdentifier="CCMain" extendedLayoutIncludesOpaqueBars="YES" id="DGE-qR-SnB" customClass="CCMain" sceneMemberID="viewController">
-                    <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="idK-Vi-sZF">
-                        <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
-                        <prototypes>
-                            <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" id="lCY-Ug-mrO">
-                                <rect key="frame" x="0.0" y="28" width="414" height="43.5"/>
-                                <autoresizingMask key="autoresizingMask"/>
-                                <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="lCY-Ug-mrO" id="ZmT-UI-0kb">
-                                    <rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/>
-                                    <autoresizingMask key="autoresizingMask"/>
-                                </tableViewCellContentView>
-                            </tableViewCell>
-                        </prototypes>
-                        <connections>
-                            <outlet property="dataSource" destination="DGE-qR-SnB" id="gUu-C3-ycj"/>
-                            <outlet property="delegate" destination="DGE-qR-SnB" id="Q2x-eV-dQq"/>
-                        </connections>
-                    </tableView>
-                    <navigationItem key="navigationItem" id="EkG-fE-q92"/>
-                    <connections>
-                        <segue destination="mtc-lf-PRo" kind="showDetail" identifier="segueDetail" id="hse-Jl-nJQ"/>
-                    </connections>
-                </tableViewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="Bg4-W5-lB8" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
+                <viewControllerPlaceholder storyboardName="NCFiles" referencedIdentifier="NCFiles.storyboard" id="fdj-aV-gGf" sceneMemberID="viewController">
+                    <navigationItem key="navigationItem" id="Jvo-0f-hQ4"/>
+                </viewControllerPlaceholder>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="Vst-OD-Y5z" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="5214" y="1217"/>
+            <point key="canvasLocation" x="5214" y="899"/>
         </scene>
         <!--NCFavorite.storyboard-->
         <scene sceneID="zqD-Jj-h2w">
@@ -569,9 +547,6 @@
             <size key="intrinsicContentSize" width="-1" height="83"/>
         </designable>
     </designables>
-    <inferredMetricsTieBreakers>
-        <segue reference="hse-Jl-nJQ"/>
-    </inferredMetricsTieBreakers>
     <resources>
         <image name="logo" width="223" height="157.5"/>
         <image name="tabBarPlus" width="80" height="80"/>

+ 0 - 401
iOSClient/Main/Menu/CCMain+Menu.swift

@@ -1,401 +0,0 @@
-//
-//  CCMain+Menu.swift
-//  Nextcloud
-//
-//  Created by Philippe Weidmann on 24.01.20.
-//  Copyright © 2020 Philippe Weidmann. All rights reserved.
-//  Copyright © 2020 Marino Faggiana All rights reserved.
-//
-//  Author Philippe Weidmann <philippe.weidmann@infomaniak.com>
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-import FloatingPanel
-import NCCommunication
-
-extension CCMain {
-
-    // MARK: - Select Menu
-    
-    @objc func toggleSelectMenu(viewController: UIViewController) {
-           
-        let mainMenuViewController = UIStoryboard.init(name: "NCMenu", bundle: nil).instantiateViewController(withIdentifier: "NCMainMenuTableViewController") as! NCMainMenuTableViewController
-        mainMenuViewController.actions = self.initSelectMenu()
-
-        let menuPanelController = NCMenuPanelController()
-        menuPanelController.parentPresenter = viewController
-        menuPanelController.delegate = mainMenuViewController
-        menuPanelController.set(contentViewController: mainMenuViewController)
-        menuPanelController.track(scrollView: mainMenuViewController.tableView)
-
-        viewController.present(menuPanelController, animated: true, completion: nil)
-    }
-    
-    private func initSelectMenu() -> [NCMenuAction] {
-        var actions = [NCMenuAction]()
-
-        actions.append(
-            NCMenuAction(
-                title: NSLocalizedString("_select_all_", comment: ""),
-                icon: CCGraphics.changeThemingColorImage(UIImage(named: "selectFull"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                action: { menuAction in
-                    self.didSelectAll()
-                }
-            )
-        )
-
-        actions.append(
-            NCMenuAction(
-                title: NSLocalizedString("_move_or_copy_selected_files_", comment: ""),
-                icon: CCGraphics.changeThemingColorImage(UIImage(named: "move"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                action: { menuAction in
-                    self.moveOpenWindow(self.tableView.indexPathsForSelectedRows)
-                }
-            )
-        )
-
-        actions.append(
-            NCMenuAction(
-                title: NSLocalizedString("_save_selected_files_", comment: ""),
-                icon: CCGraphics.changeThemingColorImage(UIImage(named: "saveSelectedFiles"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                action: { menuAction in
-                    self.saveSelectedFiles()
-                }
-            )
-        )
-
-        actions.append(
-            NCMenuAction(
-                title: NSLocalizedString("_delete_selected_files_", comment: ""),
-                icon: CCGraphics.changeThemingColorImage(UIImage(named: "trash"), width: 50, height: 50, color: .red),
-                action: { menuAction in
-                    self.deleteMetadatas()
-                }
-            )
-        )
-
-        return actions
-    }
-
-    // MARK: - More Menu ...
-
-    @objc func toggleMoreMenu(viewController: UIViewController, indexPath: IndexPath, metadata: tableMetadata, metadataFolder: tableMetadata) {
-           
-        if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(metadata.ocId) {
-            
-            let mainMenuViewController = UIStoryboard.init(name: "NCMenu", bundle: nil).instantiateViewController(withIdentifier: "NCMainMenuTableViewController") as! NCMainMenuTableViewController
-            mainMenuViewController.actions = self.initMoreMenu(indexPath: indexPath, metadata: metadata, metadataFolder: metadataFolder)
-
-            let menuPanelController = NCMenuPanelController()
-            menuPanelController.parentPresenter = viewController
-            menuPanelController.delegate = mainMenuViewController
-            menuPanelController.set(contentViewController: mainMenuViewController)
-            menuPanelController.track(scrollView: mainMenuViewController.tableView)
-
-            viewController.present(menuPanelController, animated: true, completion: nil)
-        }
-    }
-    
-    private func initMoreMenu(indexPath: IndexPath, metadata: tableMetadata, metadataFolder: tableMetadata) -> [NCMenuAction] {
-        let appDelegate = UIApplication.shared.delegate as! AppDelegate
-
-        var actions = [NCMenuAction]()
-
-        if (metadata.directory) {
-            
-            var isOffline = false
-            let isFolderEncrypted = CCUtility.isFolderEncrypted(metadata.serverUrl+"/"+metadata.fileName, e2eEncrypted: metadata.e2eEncrypted, account: metadata.account, urlBase: metadata.urlBase)
-
-            if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!)) {
-                isOffline = directory.offline
-            }
-
-            actions.append(
-                NCMenuAction(
-                    title: metadata.fileNameView,
-                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "folder"), width: 50, height: 50, color: NCBrandColor.sharedInstance.brandElement),
-                    action: nil
-                )
-            )
-
-            actions.append(
-                NCMenuAction(
-                    title: metadata.favorite ? NSLocalizedString("_remove_favorites_", comment: "") : NSLocalizedString("_add_favorites_", comment: ""),
-                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "favorite"), width: 50, height: 50, color: NCBrandColor.sharedInstance.yellowFavorite),
-                    action: { menuAction in
-                        NCNetworking.shared.favoriteMetadata(metadata, urlBase: appDelegate.urlBase) { (errorCode, errorDescription) in
-                            if errorCode != 0 {
-                                NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
-                            }
-                        }
-                    }
-                )
-            )
-
-            if (!isFolderEncrypted) {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_details_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "details"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            NCNetworkingNotificationCenter.shared.openShare(ViewController: self, metadata: metadata, indexPage: 0)
-                        }
-                    )
-                )
-            }
-
-            if (!metadata.e2eEncrypted) {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_rename_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "rename"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            let alertController = UIAlertController(title: NSLocalizedString("_rename_", comment: ""), message: nil, preferredStyle: .alert)
-
-                            alertController.addTextField { (textField) in
-                                textField.text = metadata.fileNameView
-                            }
-
-                            let cancelAction = UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil)
-
-                            let okAction = UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { action in
-                                let fileNameNew = alertController.textFields![0].text
-                                NCNetworking.shared.renameMetadata(metadata, fileNameNew: fileNameNew!, urlBase: appDelegate.urlBase, viewController: self) { (errorCode, errorDescription) in
-                                    if errorCode != 0 {
-                                        NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
-                                    }
-                                }
-                            })
-
-                            alertController.addAction(cancelAction)
-                            alertController.addAction(okAction)
-
-                            self.present(alertController, animated: true, completion: nil)
-                        }
-                    )
-                )
-            }
-
-            if (!isFolderEncrypted) {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_move_or_copy_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "move"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            self.moveOpenWindow([indexPath])
-                        }
-                    )
-                )
-            }
-
-            if (!isFolderEncrypted) {
-                actions.append(
-                    NCMenuAction(
-                        title: isOffline ? NSLocalizedString("_remove_available_offline_", comment: "") : NSLocalizedString("_set_available_offline_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "offline"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            let serverUrl = CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!
-                            NCManageDatabase.sharedInstance.setDirectory(serverUrl: serverUrl, offline: !isOffline, account: appDelegate.account)
-                            if (!isOffline) {
-                                NCOperationQueue.shared.synchronizationMetadata(metadata, selector: selectorDownloadAllFile)
-                            }
-                            NotificationCenter.default.postOnMainThread(name: k_notificationCenter_reloadDataSource, userInfo: ["ocId":metadata.ocId, "serverUrl":metadata.serverUrl])
-                        }
-                    )
-                )
-            }
-
-            if (!metadata.e2eEncrypted && CCUtility.isEnd(toEndEnabled: appDelegate.account)) {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_e2e_set_folder_encrypted_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "lock"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            NCCommunication.shared.markE2EEFolder(fileId: metadata.fileId, delete: false) { (account, errorCode, errorDescription) in
-                                if errorCode == 0 {
-                                    let serverUrl = self.serverUrl + "/" + metadata.fileName
-                                    NCManageDatabase.sharedInstance.deleteE2eEncryption(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl))
-                                    NCManageDatabase.sharedInstance.setDirectory(serverUrl: serverUrl, serverUrlTo: nil, etag: nil, ocId: nil, fileId: nil, encrypted: true, richWorkspace: nil, account: metadata.account)
-                                    NCManageDatabase.sharedInstance.setMetadataEncrypted(ocId: metadata.ocId, encrypted: true)
-                                    
-                                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_reloadDataSource, userInfo: ["ocId":metadata.ocId, "serverUrl":metadata.serverUrl])
-                                } else {
-                                    NCContentPresenter.shared.messageNotification(NSLocalizedString("_e2e_error_mark_folder_", comment: ""), description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: .error, errorCode: errorCode)
-                                }
-                            }
-                        }
-                    )
-                )
-            }
-        
-            if (metadata.e2eEncrypted && !metadataFolder.e2eEncrypted && CCUtility.isEnd(toEndEnabled: appDelegate.account)) {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_e2e_remove_folder_encrypted_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "lock"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            NCCommunication.shared.markE2EEFolder(fileId: metadata.fileId, delete: true) { (account, errorCode, errorDescription) in
-                                if errorCode == 0 {
-                                    let serverUrl = self.serverUrl + "/" + metadata.fileName
-                                    NCManageDatabase.sharedInstance.deleteE2eEncryption(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, "\(self.serverUrl ?? "")/\(metadata.fileName)"))
-                                    NCManageDatabase.sharedInstance.setDirectory(serverUrl: serverUrl, serverUrlTo: nil, etag: nil, ocId: nil, fileId: nil, encrypted: false, richWorkspace: nil, account: metadata.account)
-                                    NCManageDatabase.sharedInstance.setMetadataEncrypted(ocId: metadata.ocId, encrypted: false)
-                                    
-                                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_reloadDataSource, userInfo: ["ocId":metadata.ocId, "serverUrl":metadata.serverUrl])
-                                } else {
-                                    NCContentPresenter.shared.messageNotification(NSLocalizedString("_e2e_error_delete_mark_folder_", comment: ""), description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: .error, errorCode: errorCode)
-                                }
-                            }
-                        }
-                    )
-                )
-            }
-            
-        } else {
-            
-            var iconHeader: UIImage!
-            if let icon = UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)) {
-                iconHeader = icon
-            } else {
-                iconHeader = UIImage(named: metadata.iconName)
-            }
-            let isEncrypted = CCUtility.isFolderEncrypted(metadata.serverUrl, e2eEncrypted: metadata.e2eEncrypted, account: metadata.account, urlBase: metadata.urlBase)
-
-            actions.append(
-                NCMenuAction(
-                    title: metadata.fileNameView,
-                    icon: iconHeader,
-                    action: nil
-                )
-            )
-
-            actions.append(
-                NCMenuAction(
-                    title: metadata.favorite ? NSLocalizedString("_remove_favorites_", comment: "") : NSLocalizedString("_add_favorites_", comment: ""),
-                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "favorite"), width: 50, height: 50, color: NCBrandColor.sharedInstance.yellowFavorite),
-                    action: { menuAction in
-                        NCNetworking.shared.favoriteMetadata(metadata, urlBase: appDelegate.urlBase) { (errorCode, errorDescription) in }
-                    }
-                )
-            )
-
-            if (!isEncrypted) {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_details_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "details"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            NCNetworkingNotificationCenter.shared.openShare(ViewController: self, metadata: metadata, indexPage: 0)
-                        }
-                    )
-                )
-            }
-
-            if(!NCBrandOptions.sharedInstance.disable_openin_file) {
-                actions.append(
-                    NCMenuAction(title: NSLocalizedString("_open_in_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "openFile"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            self.tableView.setEditing(false, animated: true)
-                            NCNetworkingNotificationCenter.shared.downloadOpen(metadata: metadata, selector: selectorOpenIn)
-                        }
-                    )
-                )
-            }
-
-            actions.append(
-                NCMenuAction(
-                    title: NSLocalizedString("_rename_", comment: ""),
-                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "rename"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                    action: { menuAction in
-                        let alertController = UIAlertController(title: NSLocalizedString("_rename_", comment: ""), message: nil, preferredStyle: .alert)
-
-                        alertController.addTextField { (textField) in
-                            textField.text = metadata.fileNameView
-                        }
-
-                        let cancelAction = UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil)
-
-                        let okAction = UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { action in
-                            let fileNameNew = alertController.textFields![0].text
-                            NCNetworking.shared.renameMetadata(metadata, fileNameNew: fileNameNew!, urlBase: appDelegate.urlBase, viewController: self) { (errorCode, errorDescription) in }
-                        })
-                        
-                        alertController.addAction(cancelAction)
-                        alertController.addAction(okAction)
-
-                        self.present(alertController, animated: true, completion: nil)
-                    }
-                )
-            )
-            
-            if (!isEncrypted) {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_move_or_copy_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "move"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            self.moveOpenWindow([indexPath])
-                        }
-                    )
-                )
-            }
-
-            if (!isEncrypted) {
-                let localFile = NCManageDatabase.sharedInstance.getTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
-                var title: String!
-                if (localFile == nil || localFile!.offline == false) {
-                    title = NSLocalizedString("_set_available_offline_", comment: "")
-                } else {
-                    title = NSLocalizedString("_remove_available_offline_", comment: "")
-                }
-
-                actions.append(
-                    NCMenuAction(
-                        title: title,
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "offline"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            if (localFile == nil || !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView)) {
-                                
-                                NCNetworking.shared.download(metadata: metadata, selector: selectorLoadOffline) { (_) in }
-                                
-                                if let metadataLivePhoto = NCManageDatabase.sharedInstance.isLivePhoto(metadata: metadata) {
-                                    NCNetworking.shared.download(metadata: metadataLivePhoto, selector: selectorLoadOffline) { (_) in }
-                                }
-                                
-                            } else {
-                                NCManageDatabase.sharedInstance.setLocalFile(ocId: metadata.ocId, offline: !localFile!.offline)
-                                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_reloadDataSource, userInfo: ["ocId":metadata.ocId, "serverUrl":metadata.serverUrl])
-                            }
-                        }
-                    )
-                )
-            }
-        }
-
-        actions.append(
-            NCMenuAction(
-                title: NSLocalizedString("_delete_", comment: ""),
-                icon: CCGraphics.changeThemingColorImage(UIImage(named: "trash"), width: 50, height: 50, color: .red),
-                action: { menuAction in
-                    self.actionDelete(indexPath)
-                }
-            )
-        )
-
-        return actions
-    }
-}

+ 0 - 17
iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift

@@ -365,23 +365,6 @@ extension NCCollectionViewCommon {
             )
         )
         
-        actions.append(
-            NCMenuAction(
-                title: NSLocalizedString("_save_selected_files_", comment: ""),
-                icon: CCGraphics.changeThemingColorImage(UIImage(named: "saveSelectedFiles"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                action: { menuAction in
-                    for ocId in selectOcId {
-                        if let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(ocId) {
-                            if metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video {
-                                NCOperationQueue.shared.download(metadata: metadata, selector: selectorSaveAlbum, setFavorite: false)
-                            }
-                        }
-                    }
-                    self.tapSelect(sender: self)
-                }
-            )
-        )
-        
         return actions
     }
 }

+ 1 - 1
iOSClient/Main/NCDetailViewController.swift

@@ -537,7 +537,7 @@ class NCDetailViewController: UIViewController {
         CCUtility.copyFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView), toPath: fileNamePath)
 
         viewerQuickLook = NCViewerQuickLook.init()
-        viewerQuickLook?.quickLook(url: URL(fileURLWithPath: fileNamePath), viewController: self)
+        viewerQuickLook?.quickLook(url: URL(fileURLWithPath: fileNamePath))
         
         DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
             self.unload(checkWindow: false)

+ 0 - 456
iOSClient/Main/NCMainCommon.swift

@@ -1,456 +0,0 @@
-//
-//  NCMainCommon.swift
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 18/07/18.
-//  Copyright © 2018 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-import Foundation
-import TLPhotoPicker
-import ZIPFoundation
-import NCCommunication
-
-//MARK: - Main Common
-
-class NCMainCommon: NSObject {
-    @objc static let shared: NCMainCommon = {
-        let instance = NCMainCommon()
-        instance.createImagesThemingColor()
-        return instance
-    }()
-    
-    var metadataEditPhoto: tableMetadata?
-
-    //MARK: -
-    
-    struct NCMainCommonImages {
-        static var cellSharedImage = UIImage()
-        static var cellCanShareImage = UIImage()
-        static var cellShareByLinkImage = UIImage()
-        static var cellFavouriteImage = UIImage()
-        static var cellMoreImage = UIImage()
-        static var cellCommentImage = UIImage()
-        static var cellLivePhotoImage = UIImage()
-
-        static var cellFolderEncryptedImage = UIImage()
-        static var cellFolderSharedWithMeImage = UIImage()
-        static var cellFolderPublicImage = UIImage()
-        static var cellFolderGroupImage = UIImage()
-        static var cellFolderExternalImage = UIImage()
-        static var cellFolderAutomaticUploadImage = UIImage()
-        static var cellFolderImage = UIImage()
-        
-        static var cellPlayImage = UIImage()
-    }
-    
-    @objc func createImagesThemingColor() {
-        NCMainCommonImages.cellSharedImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), width: 100, height: 100, color: NCBrandColor.sharedInstance.textView)
-        NCMainCommonImages.cellCanShareImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), width: 100, height: 100, color: NCBrandColor.sharedInstance.optionItem)
-        NCMainCommonImages.cellShareByLinkImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "sharebylink"), width: 100, height: 100, color: NCBrandColor.sharedInstance.optionItem)
-        NCMainCommonImages.cellFavouriteImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "favorite"), width: 100, height: 100, color: NCBrandColor.sharedInstance.yellowFavorite)
-        NCMainCommonImages.cellMoreImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), width: 50, height: 50, color: NCBrandColor.sharedInstance.optionItem)
-        NCMainCommonImages.cellCommentImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "comment"), width: 30, height: 30, color: NCBrandColor.sharedInstance.graySoft)
-        NCMainCommonImages.cellLivePhotoImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "livePhoto"), width: 100, height: 100, color: NCBrandColor.sharedInstance.textView)
-        
-        NCMainCommonImages.cellFolderEncryptedImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "folderEncrypted"), width: 600, height: 600, color: NCBrandColor.sharedInstance.brandElement)
-        NCMainCommonImages.cellFolderSharedWithMeImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "folder_shared_with_me"), width: 600, height: 600, color: NCBrandColor.sharedInstance.brandElement)
-        NCMainCommonImages.cellFolderPublicImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "folder_public"), width: 600, height: 600, color: NCBrandColor.sharedInstance.brandElement)
-        NCMainCommonImages.cellFolderGroupImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "folder_group"), width: 600, height: 600, color: NCBrandColor.sharedInstance.brandElement)
-        NCMainCommonImages.cellFolderExternalImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "folder_external"), width: 600, height: 600, color: NCBrandColor.sharedInstance.brandElement)
-        NCMainCommonImages.cellFolderAutomaticUploadImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "folderAutomaticUpload"), width: 600, height: 600, color: NCBrandColor.sharedInstance.brandElement)
-        NCMainCommonImages.cellFolderImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "folder"), width: 600, height: 600, color: NCBrandColor.sharedInstance.brandElement)
-        
-        NCMainCommonImages.cellPlayImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "play"), width: 100, height: 100, color: .white)
-    }
-    
-    //MARK: -
-    
-    @objc func triggerProgressTask(_ notification: Notification, sectionDataSourceocIdIndexPath: NSDictionary, tableView: UITableView, viewController: UIViewController, serverUrlViewController: String?) {
-
-        let appDelegate = UIApplication.shared.delegate as! AppDelegate
-        if viewController.viewIfLoaded?.window == nil {
-            return
-        }
-        
-        guard let dic = notification.userInfo else {
-            return
-        }
-        
-        let _ = dic["account"] as? NSString ?? ""
-        let ocId = dic["ocId"] as? NSString ?? ""
-        let serverUrl = dic["serverUrl"] as? String ?? ""
-        let status = dic["status"] as? Int ?? Int(k_metadataStatusNormal)
-        let progress = dic["progress"] as? CGFloat ?? 0
-        let totalBytes = dic["totalBytes"] as? Double ?? 0
-        let totalBytesExpected = dic["totalBytesExpected"] as? Double ?? 0
-        
-        if serverUrlViewController != nil && serverUrlViewController! != serverUrl {
-            return
-        }
-        
-        appDelegate.listProgressMetadata.setObject([progress as NSNumber, totalBytes as NSNumber, totalBytesExpected as NSNumber], forKey: ocId)
-        
-        guard let indexPath = sectionDataSourceocIdIndexPath.object(forKey: ocId) else {
-            return
-        }
-        
-        if isValidIndexPath(indexPath as! IndexPath, view: tableView) {
-            
-            if let cell = tableView.cellForRow(at: indexPath as! IndexPath) as? CCCellMainTransfer {
-                
-                var image = ""
-                
-                if status == k_metadataStatusInDownload {
-                    image = "↓"
-                } else if status == k_metadataStatusInUpload {
-                    image = "↑"
-                }
-                
-                cell.labelInfoFile?.text = CCUtility.transformedSize(totalBytesExpected) + " - " + image + CCUtility.transformedSize(totalBytes)
-                cell.transferButton?.progress = progress
-            }
-        }
-    }
-    
-    
-    
-    //MARK: -
-    
-    @objc func cellForRowAtIndexPath(_ indexPath: IndexPath, tableView: UITableView ,metadata: tableMetadata, metadataFolder: tableMetadata?, serverUrl: String, autoUploadFileName: String, autoUploadDirectory: String, tableShare: tableShare?, livePhoto: Bool) -> UITableViewCell {
-        
-        let appDelegate = UIApplication.shared.delegate as! AppDelegate
-
-        // Create File System
-        if metadata.directory {
-            CCUtility.getDirectoryProviderStorageOcId(metadata.ocId)
-        } else {
-            CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)
-        }
-        
-        // CCCell
-        if metadata.status == k_metadataStatusNormal || metadata.status == k_metadataStatusDownloadError {
-            
-            // NORMAL
-            
-            let cell = tableView.dequeueReusableCell(withIdentifier: "CellMain", for: indexPath) as! CCCellMain
-            cell.labelTitle.text = metadata.fileNameView
-            cell.filePreviewImageView.image = nil
-            cell.filePreviewImageView.backgroundColor = UIColor.lightGray
-            
-            // Download preview
-            if !(metadataFolder?.e2eEncrypted ?? false) {
-                NCOperationQueue.shared.downloadThumbnail(metadata: metadata, urlBase: appDelegate.urlBase, view: tableView, indexPath: indexPath)
-            }
-            
-            // Share
-            var isShare = false
-            var isMounted = false
-            
-            if metadataFolder != nil {
-                isShare = metadata.permissions.contains(k_permission_shared) && !metadataFolder!.permissions.contains(k_permission_shared)
-                isMounted = metadata.permissions.contains(k_permission_mounted) && !metadataFolder!.permissions.contains(k_permission_mounted)
-            }
-            
-            if metadata.directory {
-                
-                // lable Info
-                cell.labelInfoFile.text = CCUtility.dateDiff(metadata.date as Date)
-                cell.file.backgroundColor = nil
-                // File Image & Image Title Segue
-                if metadata.e2eEncrypted {
-                    cell.file.image = NCMainCommonImages.cellFolderEncryptedImage
-                } else if isShare {
-                    cell.file.image = NCMainCommonImages.cellFolderSharedWithMeImage
-                } else if (tableShare != nil && tableShare!.shareType != 3) {
-                    cell.file.image = NCMainCommonImages.cellFolderSharedWithMeImage
-                } else if (tableShare != nil && tableShare!.shareType == 3) {
-                    cell.file.image = NCMainCommonImages.cellFolderPublicImage
-                } else if metadata.mountType == "group" {
-                    cell.file.image = NCMainCommonImages.cellFolderGroupImage
-                } else if isMounted {
-                    cell.file.image = NCMainCommonImages.cellFolderExternalImage
-                } else if metadata.fileName == autoUploadFileName && serverUrl == autoUploadDirectory {
-                    cell.file.image = NCMainCommonImages.cellFolderAutomaticUploadImage
-                } else {
-                    cell.file.image = NCMainCommonImages.cellFolderImage
-                }
-                
-                let lockServerUrl = CCUtility.stringAppendServerUrl(serverUrl, addFileName: metadata.fileName)!
-                let tableDirectory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, lockServerUrl))
-                // Local image: offline
-                if tableDirectory != nil && tableDirectory!.offline {
-                    cell.local.image = UIImage.init(named: "offlineFlag")
-                }
-                
-            } else {
-                
-                let iconFileExists = FileManager.default.fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
-                
-                // Lable Info
-                cell.labelInfoFile.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
-                
-                // File Image
-                if iconFileExists {
-                    cell.file.backgroundColor = nil
-                    cell.file.image =  UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
-                } else if(!metadata.hasPreview){
-                    cell.file.backgroundColor = nil
-                    if metadata.iconName.count > 0 {
-                        cell.file.image = UIImage.init(named: metadata.iconName)
-                    } else {
-                        cell.file.image = UIImage.init(named: "file")
-                    }
-                }
-                
-                // Local Image - Offline
-                let size = CCUtility.fileProviderStorageSize(metadata.ocId, fileNameView: metadata.fileNameView)
-                if size > 0 {
-                    let tableLocalFile = NCManageDatabase.sharedInstance.getTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
-                    if tableLocalFile == nil && size == metadata.size {
-                        NCManageDatabase.sharedInstance.addLocalFile(metadata: metadata)
-                    }
-                    if tableLocalFile != nil && tableLocalFile!.offline { cell.local.image = UIImage.init(named: "offlineFlag") }
-                    else { cell.local.image = UIImage.init(named: "local") }
-                }
-                
-                // Status image: encrypted
-                let tableE2eEncryption = NCManageDatabase.sharedInstance.getE2eEncryption(predicate: NSPredicate(format: "account == %@ AND fileNameIdentifier == %@", appDelegate.account, metadata.fileName))
-                if tableE2eEncryption != nil &&  NCUtility.shared.isEncryptedMetadata(metadata) {
-                    cell.status.image = UIImage.init(named: "encrypted")
-                }
-                
-                // Live Photo
-                if metadata.livePhoto && livePhoto {
-                    cell.status.image = NCMainCommonImages.cellLivePhotoImage
-                }
-            }
-            
-            //
-            // File & Directory
-            //
-            
-            // Favorite
-            if metadata.favorite {
-                cell.favorite.image = NCMainCommonImages.cellFavouriteImage
-            }
-            
-            // Share image
-            if !(metadataFolder?.e2eEncrypted ?? false) && !metadata.e2eEncrypted {
-                if (isShare) {
-                    cell.shared.image = NCMainCommonImages.cellSharedImage
-                } else if (tableShare != nil && tableShare!.shareType == 3) {
-                    cell.shared.image = NCMainCommonImages.cellShareByLinkImage
-                } else if (tableShare != nil && tableShare!.shareType != 3) {
-                    cell.shared.image = NCMainCommonImages.cellSharedImage
-                } else {
-                    cell.shared.image = NCMainCommonImages.cellCanShareImage
-                }
-                if metadata.ownerId != appDelegate.userID {
-                    // Load avatar
-                    let fileNameSource = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase) + "-" + metadata.ownerId + ".png"
-                    let fileNameSourceAvatar = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase) + "-avatar-" + metadata.ownerId + ".png"
-                    if FileManager.default.fileExists(atPath: fileNameSourceAvatar) {
-                        if let avatar = UIImage(contentsOfFile: fileNameSourceAvatar) {
-                            cell.shared.image = avatar
-                        }
-                    } else if FileManager.default.fileExists(atPath: fileNameSource) {
-                        if let avatar = NCUtility.shared.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar) {
-                            cell.shared.image = avatar
-                        }
-                    } else {
-                        NCCommunication.shared.downloadAvatar(userID: metadata.ownerId, fileNameLocalPath: fileNameSource, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
-                            if errorCode == 0 && account == appDelegate.account {
-                                cell.shared.image = NCUtility.shared.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar)
-                            }
-                        }
-                    }
-                }
-            }
-            
-            // Comment
-            if metadata.commentsUnread {
-                cell.comment.image = NCMainCommonImages.cellCommentImage
-                cell.labelTitleTrailingConstraint.constant = 160
-            } else {
-                cell.labelTitleTrailingConstraint.constant = 110
-            }
-            
-            // More Image
-            cell.more.image = NCMainCommonImages.cellMoreImage
-            
-            // downloadFile Error
-            if metadata.status == k_metadataStatusDownloadError {
-                
-                cell.status.image = UIImage.init(named: "statuserror")
-                
-                if metadata.sessionError.count == 0 {
-                    cell.labelInfoFile.text = NSLocalizedString("_error_", comment: "") + ", " + NSLocalizedString("_file_not_downloaded_", comment: "")
-                } else {
-                    cell.labelInfoFile.text = metadata.sessionError
-                }
-            }
-            
-            return cell
-            
-        } else {
-         
-            // TRASNFER
-            
-            let cell = tableView.dequeueReusableCell(withIdentifier: "CellMainTransfer", for: indexPath) as! CCCellMainTransfer
-            cell.labelTitle.text = metadata.fileNameView
-            var progress: CGFloat = 0.0
-            var totalBytes: Double = 0.0
-            let progressArray = appDelegate.listProgressMetadata.object(forKey: metadata.ocId) as? NSArray
-            if progressArray != nil && progressArray?.count == 3 {
-                progress = progressArray?.object(at: 0) as? CGFloat ?? 0
-                totalBytes = progressArray?.object(at: 1) as? Double ?? 0
-            }
-            
-            // Write status on Label Info
-            switch metadata.status {
-            case Int(k_metadataStatusWaitDownload):
-                cell.labelInfoFile.text = CCUtility.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_wait_download_", comment: "")
-                progress = 0.0
-                break
-            case Int(k_metadataStatusInDownload):
-                cell.labelInfoFile.text = CCUtility.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_in_download_", comment: "")
-                progress = 0.0
-                break
-            case Int(k_metadataStatusDownloading):
-                cell.labelInfoFile.text = CCUtility.transformedSize(metadata.size) + " - ↓" + CCUtility.transformedSize(totalBytes)
-                break
-            case Int(k_metadataStatusWaitUpload):
-                cell.labelInfoFile.text = CCUtility.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_wait_upload_", comment: "")
-                progress = 0.0
-                break
-            case Int(k_metadataStatusInUpload):
-                cell.labelInfoFile.text = CCUtility.transformedSize(metadata.size) + " - " + NSLocalizedString("_status_in_upload_", comment: "")
-                progress = 0.0
-                break
-            case Int(k_metadataStatusUploading):
-                cell.labelInfoFile.text = CCUtility.transformedSize(metadata.size) + " - ↑" + CCUtility.transformedSize(totalBytes)
-                break
-            default:
-                cell.labelInfoFile.text = CCUtility.transformedSize(metadata.size)
-                progress = 0.0
-            }
-            
-            let iconFileExists = FileManager.default.fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
-
-            if iconFileExists {
-                cell.file.image =  UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
-            } else {
-                if metadata.status == k_metadataStatusWaitUpload || metadata.status == k_metadataStatusInUpload || metadata.status == k_metadataStatusUploading || metadata.status == k_metadataStatusUploadError {
-                
-                    cell.file.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "cloudUpload"), width: 100, height: 100, color: NCBrandColor.sharedInstance.brandElement)
-                
-                } else {
-                
-                    cell.file.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "cloudDownload"), width: 100, height: 100, color: NCBrandColor.sharedInstance.brandElement)
-                }
-            }
-            
-            // uploadFileError
-            if metadata.status == k_metadataStatusUploadError {
-                
-                cell.status.image = UIImage.init(named: "statuserror")
-                
-                if metadata.sessionError.count == 0 {
-                    cell.labelInfoFile.text = NSLocalizedString("_error_", comment: "") + ", " + NSLocalizedString("_file_not_uploaded_", comment: "")
-                } else {
-                    cell.labelInfoFile.text = metadata.sessionError
-                }
-            }
-            
-            // Progress
-            cell.transferButton.progress = progress
-            
-            // User
-            if metadata.account != appDelegate.account {
-                let tableAccount = NCManageDatabase.sharedInstance.getAccount(predicate: NSPredicate(format: "account == %@", metadata.account))
-                if tableAccount != nil {
-                    let fileNamePath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase) + "-" + appDelegate.user + ".png"
-                    var avatar = UIImage.init(contentsOfFile: fileNamePath)
-                    if avatar != nil {
-                        let avatarImageView = CCAvatar.init(image: avatar, borderColor: UIColor.black, borderWidth: 0.5)
-                        let imageSize = avatarImageView?.bounds.size
-                        UIGraphicsBeginImageContext(imageSize!)
-                        let context = UIGraphicsGetCurrentContext()
-                        avatarImageView?.layer.render(in: context!)
-                        avatar = UIGraphicsGetImageFromCurrentImageContext()
-                        UIGraphicsEndImageContext()
-                        cell.user.image = avatar
-                    }
-                }
-            }
-            
-            return cell
-        }
-    }
-    
-    @objc func getMetadataFromSectionDataSourceIndexPath(_ indexPath: IndexPath?, sectionDataSource: CCSectionDataSourceMetadata?) -> tableMetadata? {
-        
-        guard let indexPath = indexPath else {
-            return nil
-        }
-        
-        guard let sectionDataSource = sectionDataSource else {
-            return nil
-        }
-        
-        let section = indexPath.section + 1
-        let row = indexPath.row + 1
-        let totSections = sectionDataSource.sections.count
-        
-        if totSections < section || section > totSections {
-            return nil
-        }
-        
-        let valueSection = sectionDataSource.sections.object(at: indexPath.section)
-        guard let filesID = sectionDataSource.sectionArrayRow.object(forKey: valueSection) as? NSArray else {
-            return nil
-        }
-        
-        let totRows = filesID.count
-        if totRows < row || row > totRows {
-            return nil
-        }
-        
-        let ocId = filesID.object(at: indexPath.row)
-        let metadata = sectionDataSource.allRecordsDataSource.object(forKey: ocId) as? tableMetadata
-      
-        return metadata
-    }
-
-    @objc func isValidIndexPath(_ indexPath: IndexPath, view: Any) -> Bool {
-        
-        if view is UICollectionView {
-            return indexPath.section < (view as! UICollectionView).numberOfSections && indexPath.row < (view as! UICollectionView).numberOfItems(inSection: indexPath.section)
-        }
-        
-        if view is UITableView {
-            return indexPath.section < (view as! UITableView).numberOfSections && indexPath.row < (view as! UITableView).numberOfRows(inSection: indexPath.section)
-        }
-        
-        return true
-    }
-   
-}
-    
-

+ 3 - 7
iOSClient/Networking/NCNetworkingNotificationCenter.swift

@@ -57,7 +57,7 @@ import Foundation
                         CCUtility.copyFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView), toPath: fileNamePath)
 
                         viewerQuickLook = NCViewerQuickLook.init()
-                        viewerQuickLook?.quickLook(url: URL(fileURLWithPath: fileNamePath), viewController: appDelegate.activeMain)
+                        viewerQuickLook?.quickLook(url: URL(fileURLWithPath: fileNamePath))
                         
                     case selectorLoadFileView:
                         
@@ -77,8 +77,8 @@ import Foundation
                                 
                             } else {
                                 
-                                if self.appDelegate.activeViewController is CCMain {
-                                    (self.appDelegate.activeViewController as! CCMain).shouldPerformSegue(metadata, selector: "")
+                                if self.appDelegate.activeViewController is NCFiles {
+                                    (self.appDelegate.activeViewController as! NCFiles).segue(metadata: metadata)
                                 } else if self.appDelegate.activeViewController is NCFavorite {
                                     (self.appDelegate.activeViewController as! NCFavorite).segue(metadata: metadata)
                                 } else if self.appDelegate.activeViewController is NCOffline {
@@ -94,10 +94,6 @@ import Foundation
                             openIn(fileURL: fileURL, selector: selector)
                         }
                         
-                    case selectorSaveAlbum:
-                        
-                        appDelegate.activeMain.save(toPhotoAlbum: metadata)
-                        
                     case selectorLoadCopy:
                         
                         var items = UIPasteboard.general.items

+ 1 - 1
iOSClient/Networking/NCService.swift

@@ -160,7 +160,7 @@ class NCService: NSObject {
             
                 // File Sharing
                 let isFilesSharingEnabled = NCManageDatabase.sharedInstance.getCapabilitiesServerBool(account: account, elements: NCElementsJSON.shared.capabilitiesFileSharingApiEnabled, exists: false)
-                if (isFilesSharingEnabled && self.appDelegate.activeMain != nil) {
+                if (isFilesSharingEnabled && self.appDelegate.activeFiles != nil) {
                     NCCommunication.shared.readShares { (account, shares, errorCode, ErrorDescription) in
                         if errorCode == 0 {
                             NCManageDatabase.sharedInstance.deleteTableShare(account: account)

+ 2 - 0
iOSClient/Nextcloud-Bridging-Header.h

@@ -9,3 +9,5 @@
 #import "NCEndToEndEncryption.h"
 #import "NYMnemonic.h"
 #import "PKStopDownloadButton.h"
+#import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h>
+#import "CCPeekPop.h"

+ 1 - 1
iOSClient/PeekPop/CCPeekPop.m

@@ -87,7 +87,7 @@
     
     if (self.showShare) {
         UIPreviewAction *item = [UIPreviewAction actionWithTitle:NSLocalizedString(@"_share_", nil) style:UIPreviewActionStyleDefault handler:^(UIPreviewAction *action,  UIViewController *previewViewController) {
-            [[NCNetworkingNotificationCenter shared] openShareWithViewController:appDelegate.activeMain metadata:self.metadata indexPage:2];
+            [[NCNetworkingNotificationCenter shared] openShareWithViewController:appDelegate.activeFiles metadata:self.metadata indexPage:2];
         }];
         [items addObject:item];
     }

+ 1 - 1
iOSClient/RichWorkspace/NCViewerRichWorkspace.swift

@@ -61,7 +61,7 @@ import MarkdownKit
                 guard let metadata = metadata else { return }
                 NCManageDatabase.sharedInstance.setDirectory(richWorkspace: metadata.richWorkspace, serverUrl: self.serverUrl, account: account)
                 if self.richWorkspaceText != metadata.richWorkspace && metadata.richWorkspace != nil {
-                    self.appDelegate.activeMain.richWorkspaceText = self.richWorkspaceText
+                    //self.appDelegate.activeMain.richWorkspaceText = self.richWorkspaceText
                     self.richWorkspaceText = metadata.richWorkspace!
                     self.textView.attributedText = self.markdownParser.parse(metadata.richWorkspace!)
                 }

+ 1 - 1
iOSClient/Settings/CCAdvanced.m

@@ -147,7 +147,7 @@
             [self deselectFormRow:sender];
             
             NCViewerQuickLook *viewerQuickLook = [NCViewerQuickLook new];
-            [viewerQuickLook quickLookWithUrl:[NSURL fileURLWithPath:fileNameLog] viewController:self];
+            [viewerQuickLook quickLookWithUrl:[NSURL fileURLWithPath:fileNameLog]];
         };
         [section addFormRow:row];
         

+ 0 - 1
iOSClient/Settings/CCManageAutoUpload.h

@@ -22,7 +22,6 @@
 //
 
 #import <XLForm/XLForm.h>
-#import "CCMain.h"
 #import "CCManageLocation.h"
 
 @interface CCManageAutoUpload : XLFormViewController

+ 0 - 1
iOSClient/Settings/CCSettings.m

@@ -23,7 +23,6 @@
 
 #import "CCSettings.h"
 #import "AppDelegate.h"
-#import "CCMain.h"
 #import "CCAdvanced.h"
 #import "CCManageAccount.h"
 #import "NCManageEndToEndEncryption.h"

+ 1 - 1
iOSClient/Viewer/NCViewerNextcloudText.swift

@@ -98,7 +98,7 @@ class NCViewerNextcloudText: WKWebView, WKNavigationDelegate, WKScriptMessageHan
             if message.body as? String == "close" {
                                 
                 appDelegate.activeDetail.viewUnload()
-                appDelegate.activeMain.readFileReloadFolder()
+                appDelegate.activeFiles.reloadDataSourceNetwork()
             }
             
             if message.body as? String == "share" {

+ 3 - 2
iOSClient/Viewer/NCViewerQuickLook.swift

@@ -26,13 +26,14 @@ import QuickLook
 
 @objc class NCViewerQuickLook: NSObject, QLPreviewControllerDelegate, QLPreviewControllerDataSource {
 
+    let appDelegate = UIApplication.shared.delegate as! AppDelegate
     let previewController = QLPreviewController()
     var previewItems: [PreviewItem] = []
     var viewController: UIViewController?
         
-    @objc func quickLook(url: URL, viewController: UIViewController) {
+    @objc func quickLook(url: URL) {
         
-        self.viewController = viewController
+        self.viewController = appDelegate.window.rootViewController
         
         URLSession.shared.dataTask(with: url) { data, response, error in
             

+ 1 - 1
iOSClient/Viewer/NCViewerRichdocument.swift

@@ -97,7 +97,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
             if message.body as? String == "close" {
                 
                 appDelegate.activeDetail.viewUnload()                                
-                appDelegate.activeMain.readFileReloadFolder()
+                appDelegate.activeFiles.reloadDataSourceNetwork()
             }
             
             if message.body as? String == "insertGraphic" {