Browse Source

remove unused option

marinofaggiana 4 years ago
parent
commit
e8c0bd04f8

+ 1 - 1
Cartfile.resolved

@@ -16,7 +16,7 @@ github "krzyzanowskim/OpenSSL" "1.0.218"
 github "malcommac/SwiftRichString" "3.7.1"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
-github "marinofaggiana/XLForm" "06580a53244d7eb6cdcffd9fd2efc0ebe58242f0"
+github "marinofaggiana/XLForm" "6abc02c51ee8de1f0d1b165759232b94e199d4b8"
 github "nextcloud/ios-communication-library" "5d6982774262e8257918ebc7e6ef68ba5ecbd59d"
 github "realm/realm-cocoa" "v4.4.1"
 github "rechsteiner/Parchment" "v1.7.0"

+ 1 - 1
iOSClient/CCGlobal.h

@@ -84,7 +84,7 @@
 
 // Database Realm
 #define k_databaseDefault                               @"nextcloud.realm"
-#define k_databaseSchemaVersion                         97
+#define k_databaseSchemaVersion                         98
 
 // Intro selector
 #define k_intro_login                                   0

+ 0 - 1
iOSClient/Database/NCDatabase.swift

@@ -63,7 +63,6 @@ class tableAccount: Object {
     @objc dynamic var quotaTotal: Double = 0
     @objc dynamic var quotaUsed: Double = 0
     @objc dynamic var role = ""
-    @objc dynamic var startDirectoryPhotosTab = ""
     @objc dynamic var storageLocation = ""
     @objc dynamic var subadmin = ""
     @objc dynamic var twitter = ""

+ 0 - 45
iOSClient/Database/NCManageDatabase.swift

@@ -707,51 +707,6 @@ class NCManageDatabase: NSObject {
         }
     }
     
-    @objc func getAccountStartDirectoryMediaTabView(_ homeServerUrl: String) -> String {
-        
-        guard let activeAccount = self.getAccountActive() else {
-            return ""
-        }
-        
-        let realm = try! Realm()
-        realm.refresh()
-
-        guard let result = realm.objects(tableAccount.self).filter("account == %@", activeAccount.account).first else {
-            return ""
-        }
-        
-        if result.startDirectoryPhotosTab == "" {
-            
-            self.setAccountStartDirectoryMediaTabView(homeServerUrl)
-            return homeServerUrl
-            
-        } else {
-            return result.startDirectoryPhotosTab
-        }
-    }
-    
-    @objc func setAccountStartDirectoryMediaTabView(_ directory: String) {
-        
-        guard let activeAccount = self.getAccountActive() else {
-            return
-        }
-        
-        let realm = try! Realm()
-        
-        do {
-            try realm.write {
-                
-                guard let result = realm.objects(tableAccount.self).filter("account == %@", activeAccount.account).first else {
-                    return
-                }
-                
-                result.startDirectoryPhotosTab = directory
-            }
-        } catch let error {
-            print("[LOG] Could not write to database: ", error)
-        }
-    }
-    
     //MARK: -
     //MARK: Table Activity
 

+ 1 - 48
iOSClient/Media/NCMedia.swift

@@ -24,7 +24,7 @@
 import Foundation
 import NCCommunication
 
-class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate, NCSelectDelegate {
+class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate {
     
     @IBOutlet weak var collectionView : UICollectionView!
     
@@ -274,16 +274,6 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
                 )
             )
 
-            actions.append(
-                NCMenuAction(
-                    title: NSLocalizedString("_select_media_folder_", comment: ""),
-                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "folderAutomaticUpload"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                    action: { menuAction in
-                        self.selectStartDirectoryPhotosTab()
-                    }
-                )
-            )
-
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString(filterTypeFileImage ? "_media_viewimage_show_" : "_media_viewimage_hide_", comment: ""),
@@ -343,43 +333,6 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         self.present(menuPanelController, animated: true, completion: nil)
     }
     
-    // MARK: Select Directory
-    
-    func selectStartDirectoryPhotosTab() {
-        
-        let navigationController = UIStoryboard(name: "NCSelect", bundle: nil).instantiateInitialViewController() as! UINavigationController
-        let viewController = navigationController.topViewController as! NCSelect
-        
-        viewController.delegate = self
-        viewController.hideButtonCreateFolder = true
-        viewController.includeDirectoryE2EEncryption = false
-        viewController.includeImages = false
-        viewController.layoutViewSelect = k_layout_view_move
-        viewController.selectFile = false
-        viewController.titleButtonDone = NSLocalizedString("_select_", comment: "")
-        viewController.type = "mediaFolder"
-        
-        navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
-        self.present(navigationController, animated: true, completion: nil)
-        
-    }
-    
-    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
-        
-        let oldStartDirectoryMediaTabView = NCManageDatabase.sharedInstance.getAccountStartDirectoryMediaTabView(CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl))
-        
-        if serverUrl != nil && serverUrl != oldStartDirectoryMediaTabView {
-            
-            // Save Start Directory
-            NCManageDatabase.sharedInstance.setAccountStartDirectoryMediaTabView(serverUrl!)
-            //
-            NCManageDatabase.sharedInstance.clearTable(tableMedia.self, account: appDelegate.activeAccount)
-            self.sectionDatasource = CCSectionDataSourceMetadata()
-            //
-            loadNetworkDatasource()
-        }
-    }
-    
     // MARK: SEGUE
     
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {