Browse Source

Smaller fixes

- whitespaces
- AC
- Copyright

Signed-off-by: Henrik Storch <henrik.storch@nextcloud.com>
Henrik Storch 3 years ago
parent
commit
e0262a7eb8

+ 0 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -424,7 +424,6 @@
 		371B5A2D23D0B04500FAFAE9 /* NCMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMenu.swift; sourceTree = "<group>"; };
 		371B5A3223D0BD5500FAFAE9 /* FloatingPanel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FloatingPanel.framework; path = Carthage/Build/iOS/FloatingPanel.framework; sourceTree = "<group>"; };
 		3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Menu.swift"; sourceTree = "<group>"; };
-		8491B1C8273BB3D6001C8C5B /* ios-communication-library */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "ios-communication-library"; path = "../ios-communication-library"; sourceTree = "<group>"; };
 		8491B1CC273BBA82001C8C5B /* UIViewController+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Menu.swift"; sourceTree = "<group>"; };
 		D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = "<group>"; };
 		F700222B1EC479840080073F /* Custom.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Custom.xcassets; sourceTree = "<group>"; };
@@ -1481,7 +1480,6 @@
 		F7F67B9F1A24D27800EE80DA = {
 			isa = PBXGroup;
 			children = (
-				8491B1C8273BB3D6001C8C5B /* ios-communication-library */,
 				F7F67BAA1A24D27800EE80DA /* iOSClient */,
 				F7F67BAB1A24D27800EE80DA /* Supporting Files */,
 				F771E3D120E2392D00AFB62D /* File Provider Extension */,

+ 3 - 3
iOSClient/Menu/NCCollectionViewCommon+Menu.swift

@@ -29,11 +29,11 @@ import NCCommunication
 import Queuer
 
 extension NCCollectionViewCommon {
-    
+
     func toggleMenu(metadata: tableMetadata, imageIcon: UIImage?) {
-        
+
         var actions = [NCMenuAction]()
-        
+
         guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(metadata.ocId) else { return }
         let serverUrl = metadata.serverUrl + "/" + metadata.fileName
         let isFolderEncrypted = CCUtility.isFolderEncrypted(metadata.serverUrl, e2eEncrypted: metadata.e2eEncrypted, account: metadata.account, urlBase: metadata.urlBase)

+ 6 - 14
iOSClient/Menu/NCTrash+Menu.swift

@@ -28,9 +28,9 @@ import NCCommunication
 extension NCTrash {
 
     func toggleMenuMoreHeader() {
-        
+
         var actions: [NCMenuAction] = []
-                
+
         if isEditMode {
             actions.append(
                 NCMenuAction(
@@ -69,12 +69,12 @@ extension NCTrash {
                 )
             )
         }
-        
+
         presentMenu(with: actions)
     }
-    
+
     func toggleMenuMoreList(with objectId: String, image: UIImage?) {
-        
+
         var actions: [NCMenuAction] = []
 
         guard let tableTrash = NCManageDatabase.shared.getTrashItem(fileId: objectId, account: appDelegate.account) else {
@@ -110,15 +110,7 @@ extension NCTrash {
             )
         )
 
-        menuViewController.actions = actions
-
-        let menuPanelController = NCMenuPanelController()
-        menuPanelController.parentPresenter = self
-        menuPanelController.delegate = menuViewController
-        menuPanelController.set(contentViewController: menuViewController)
-        menuPanelController.track(scrollView: menuViewController.tableView)
-
-        self.present(menuPanelController, animated: true, completion: nil)
+        self.presentMenu(with: actions)
     }
     
     func toggleMenuMoreGrid(with objectId: String, namedButtonMore: String, image: UIImage?) {

+ 20 - 5
iOSClient/Menu/UIViewController+Menu.swift

@@ -1,17 +1,32 @@
 //
-//  NCHovercard+Menu.swift
+//  UIViewController+Menu.swift
 //  Nextcloud
 //
-//  Created by admin on 10.11.21.
-//  Copyright © 2021 Marino Faggiana. All rights reserved.
+//  Created by Henrik Storch on 10.11.21.
+//  Copyright © 2021 Henrik Storch All rights reserved.
+//
+//  Author Henrik Storch <henrik.storch@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 SVGKit
+import NCCommunication
 
 extension UIViewController {
-    func handleProfileAction(_ action: NCHovercard.Action, for userId: String) {
-        
+    fileprivate func handleProfileAction(_ action: NCHovercard.Action, for userId: String) {
         switch action.appId {
         case "email":
             guard let url = action.hyperlinkUrl,