Browse Source

remove old code

Marino Faggiana 6 years ago
parent
commit
9f40932a40

+ 0 - 14
Nextcloud.xcodeproj/project.pbxproj

@@ -441,7 +441,6 @@
 		F7BAADCC1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */; };
 		F7BB14961D5B62C000ECEE68 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63061D5B3467004E2AA5 /* libcrypto.a */; };
 		F7BB14971D5B62C000ECEE68 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63071D5B3467004E2AA5 /* libssl.a */; };
-		F7BE6E2F1D2D5C3B00106933 /* CCQuickActions.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BE6E2C1D2D5C3B00106933 /* CCQuickActions.m */; };
 		F7BF1B431D51E893000854F6 /* CCLogin.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BF1B401D51E893000854F6 /* CCLogin.m */; };
 		F7C40BE321998C060004137E /* PDFGenerator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7C40BE221998C050004137E /* PDFGenerator.framework */; };
 		F7C40BE521998D5B0004137E /* MGSwipeTableCell.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7C40BE421998D5A0004137E /* MGSwipeTableCell.framework */; };
@@ -1218,8 +1217,6 @@
 		F7BAADB41ED5A87C00B7EAD4 /* NCDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCDatabase.swift; sourceTree = "<group>"; };
 		F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCManageDatabase.swift; sourceTree = "<group>"; };
 		F7BB04851FD58ACB00BBFD2A /* cs-CZ */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "cs-CZ"; path = "cs-CZ.lproj/Localizable.strings"; sourceTree = "<group>"; };
-		F7BE6E2B1D2D5C3B00106933 /* CCQuickActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCQuickActions.h; sourceTree = "<group>"; };
-		F7BE6E2C1D2D5C3B00106933 /* CCQuickActions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCQuickActions.m; sourceTree = "<group>"; };
 		F7BF1B3F1D51E893000854F6 /* CCLogin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLogin.h; sourceTree = "<group>"; };
 		F7BF1B401D51E893000854F6 /* CCLogin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLogin.m; sourceTree = "<group>"; };
 		F7BFCCC01B68C21900548E76 /* CCManageLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCManageLocation.h; sourceTree = "<group>"; };
@@ -2577,15 +2574,6 @@
 			path = Database;
 			sourceTree = "<group>";
 		};
-		F7BE6E2A1D2D5C3B00106933 /* QuickActions */ = {
-			isa = PBXGroup;
-			children = (
-				F7BE6E2B1D2D5C3B00106933 /* CCQuickActions.h */,
-				F7BE6E2C1D2D5C3B00106933 /* CCQuickActions.m */,
-			);
-			path = QuickActions;
-			sourceTree = "<group>";
-		};
 		F7BFCCBD1B68C21900548E76 /* ManageLocation+ManageAsset */ = {
 			isa = PBXGroup;
 			children = (
@@ -2948,7 +2936,6 @@
 				F7C5259A1E3B441D00FFE02C /* Notification */,
 				F7381ED9218218A4000B1560 /* Offline */,
 				F7FCFFD51D70798C000E6E29 /* PeekPop */,
-				F7BE6E2A1D2D5C3B00106933 /* QuickActions */,
 				F7FE125B1BAC03FB0041924B /* Security */,
 				F79A65C12191D8DC00FF6DCC /* Select */,
 				F7ACE4281BAC0268006C0017 /* Settings */,
@@ -3772,7 +3759,6 @@
 				F758B445212C516300515F55 /* CGPoint+Utils.swift in Sources */,
 				F73B4EFA1F470D9100BBEE4B /* LangFrenchModel.cpp in Sources */,
 				F762CAF91EACB66200B38484 /* XLFormCheckCell.m in Sources */,
-				F7BE6E2F1D2D5C3B00106933 /* CCQuickActions.m in Sources */,
 				F762CB101EACB66200B38484 /* NSPredicate+XLFormAdditions.m in Sources */,
 				F7D4237E1F0596C6009C9782 /* ReaderDocument.m in Sources */,
 				F7D4237C1F0596C6009C9782 /* ReaderContentTile.m in Sources */,

+ 0 - 1
iOSClient/AppDelegate.h

@@ -32,7 +32,6 @@
 #import "CCUtility.h"
 #import "CCActivity.h"
 #import "CCDetail.h"
-#import "CCQuickActions.h"
 #import "CCMain.h"
 #import "CCMedia.h"
 #import "CCSettings.h"

+ 1 - 87
iOSClient/AppDelegate.m

@@ -288,8 +288,6 @@
 - (void)applicationDidEnterBackground:(UIApplication *)application
 {
     NSLog(@"[LOG] Enter in Background");
-
-    //[[CCQuickActions quickActionsManager] closeAll];
     
     [[BKPasscodeLockScreenManager sharedManager] showLockScreen:YES];
     
@@ -531,10 +529,7 @@
     NSString *bundleId = [NSBundle mainBundle].bundleIdentifier;
 
     UIApplicationShortcutIcon *shortcutMediaIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"quickActionMedia"];
-    UIApplicationShortcutIcon *shortcutUploadIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"quickActionUpload"];
-    
     UIApplicationShortcutItem *shortcutMedia = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.media", bundleId] localizedTitle:NSLocalizedString(@"_media_", nil) localizedSubtitle:nil icon:shortcutMediaIcon userInfo:nil];
-    UIApplicationShortcutItem *shortcutUpload = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.upload", bundleId] localizedTitle:NSLocalizedString(@"_upload_file_", nil) localizedSubtitle:nil icon:shortcutUploadIcon userInfo:nil];
    
     // add the array to our app
     if (shortcutMedia)
@@ -553,90 +548,9 @@
     BOOL handled = NO;
     
     NSString *bundleId = [NSBundle mainBundle].bundleIdentifier;
-    
     NSString *shortcutMedia = [NSString stringWithFormat:@"%@.media", bundleId];
-    NSString *shortcutUpload = [NSString stringWithFormat:@"%@.upload", bundleId];
-    NSString *shortcutUploadEncrypted = [NSString stringWithFormat:@"%@.uploadEncrypted", bundleId];
-        
-    if ([shortcutItem.type isEqualToString:shortcutUpload] && self.activeAccount) {
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            
-            if (_activeMain) {
-                
-                UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
-                
-                if (splitViewController.isCollapsed) {
-                    
-                    UITabBarController *tbc = splitViewController.viewControllers.firstObject;
-                    for (UINavigationController *nvc in tbc.viewControllers) {
-                        
-                        if ([nvc.topViewController isKindOfClass:[CCDetail class]])
-                            [nvc popToRootViewControllerAnimated:NO];
-                    }
-                    
-                    [tbc setSelectedIndex: k_tabBarApplicationIndexFile];
-                    
-                } else {
-                    
-                    UINavigationController *nvcDetail = splitViewController.viewControllers.lastObject;
-                    [nvcDetail popToRootViewControllerAnimated:NO];
-                    
-                    UITabBarController *tbc = splitViewController.viewControllers.firstObject;
-                    [tbc setSelectedIndex: k_tabBarApplicationIndexFile];
-                }
-
-                [_activeMain.navigationController popToRootViewControllerAnimated:NO];
-
-                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-                    [[CCQuickActions quickActionsManager] startQuickActionsViewController:_activeMain];
-                });
-            }
-        });
-        
-        handled = YES;
-    }
-    
-    else if ([shortcutItem.type isEqualToString:shortcutUploadEncrypted] && self.activeAccount) {
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-
-            if (_activeMain) {
-                
-                UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
-                
-                if (splitViewController.isCollapsed) {
-                    
-                    UITabBarController *tbc = splitViewController.viewControllers.firstObject;
-                    for (UINavigationController *nvc in tbc.viewControllers) {
-                        
-                        if ([nvc.topViewController isKindOfClass:[CCDetail class]])
-                            [nvc popToRootViewControllerAnimated:NO];
-                    }
-                    
-                    [tbc setSelectedIndex: k_tabBarApplicationIndexFile];
-                    
-                } else {
-                    
-                    UINavigationController *nvcDetail = splitViewController.viewControllers.lastObject;
-                    [nvcDetail popToRootViewControllerAnimated:NO];
-                    
-                    UITabBarController *tbc = splitViewController.viewControllers.firstObject;
-                    [tbc setSelectedIndex: k_tabBarApplicationIndexFile];
-                }
-                
-                [_activeMain.navigationController popToRootViewControllerAnimated:NO];
-                
-                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-                    [[CCQuickActions quickActionsManager] startQuickActionsViewController:_activeMain];
-                });
-            }
-        });
-        
-        handled = YES;
-    }
     
-    else if ([shortcutItem.type isEqualToString:shortcutMedia] && self.activeAccount) {
+    if ([shortcutItem.type isEqualToString:shortcutMedia] && self.activeAccount) {
         
         dispatch_async(dispatch_get_main_queue(), ^{
 

+ 0 - 43
iOSClient/Main/NCMainCommon.swift

@@ -890,49 +890,6 @@ class NCMainCommon: NSObject {
         self.reloadDatasource(ServerUrl: serverUrl, fileID: nil, action: k_action_NULL)
         self.appDelegate.activeMedia.reloadDatasource(nil, action: Int(k_action_NULL))
     }
-    
-    @objc func openPhotosPickerViewController(_ sourceViewController: UIViewController, phAssets: @escaping ([PHAsset]) -> ()) {
-     
-        var selectedPhAssets = [PHAsset]()
-        var configure = TLPhotosPickerConfigure()
-        
-        configure.cancelTitle = NSLocalizedString("_cancel_", comment: "")
-        configure.defaultCameraRollTitle = NSLocalizedString("_camera_roll_", comment: "")
-        configure.doneTitle = NSLocalizedString("_done_", comment: "")
-        configure.emptyMessage = NSLocalizedString("_no_albums_", comment: "")
-        configure.tapHereToChange = NSLocalizedString("_tap_here_to_change_", comment: "")
-        
-        configure.maxSelectedAssets = Int(k_pickerControllerMax)
-        configure.selectedColor = NCBrandColor.sharedInstance.brand
-        
-        let viewController = TLPhotosPickerViewController(withTLPHAssets: { (assets) in
-            
-            for asset: TLPHAsset in assets {
-                if asset.phAsset != nil {
-                    selectedPhAssets.append(asset.phAsset!)
-                }
-            }
-            
-            phAssets(selectedPhAssets)
-            
-            }, didCancel: nil)
-        
-        viewController.didExceedMaximumNumberOfSelection = { (picker) in
-            self.appDelegate.messageNotification("_info_", description: "_limited_dimension_", visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.error, errorCode: Int(k_CCErrorInternalError))
-        }
-        
-        viewController.handleNoAlbumPermissions = { (picker) in
-            self.appDelegate.messageNotification("_info_", description: "_denied_album_", visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.error, errorCode: Int(k_CCErrorInternalError))
-        }
-        
-        viewController.handleNoCameraPermissions = { (picker) in
-            self.appDelegate.messageNotification("_info_", description: "_denied_camera_", visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.error, errorCode: Int(k_CCErrorInternalError))
-        }
-
-        viewController.configure = configure
-
-        sourceViewController.present(viewController, animated: true, completion: nil)
-    }
 }
     
 //MARK: -

+ 0 - 37
iOSClient/QuickActions/CCQuickActions.h

@@ -1,37 +0,0 @@
-//
-//  CCQuickActions.h
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 30/06/16.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  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>
-#import <UIKit/UIKit.h>
-
-#import "CCMove.h"
-
-@interface CCQuickActions : NSObject <CCMoveDelegate>
-
-+ (instancetype) quickActionsManager;
-
-- (void)startQuickActionsViewController:(UIViewController *)viewController;
-
-- (void)closeAll;
-
-@end

+ 0 - 160
iOSClient/QuickActions/CCQuickActions.m

@@ -1,160 +0,0 @@
-//
-//  CCQuickActions.m
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 30/06/16.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  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 "CCQuickActions.h"
-#import "CCHud.h"
-#import "AppDelegate.h"
-#import "CCMain.h"
-#import "NCBridgeSwift.h"
-
-@interface CCQuickActions ()
-{
-    AppDelegate *appDelegate;
-
-    CCMove *_move;
-    CCMain *_mainVC;
-    NSMutableArray *_assets;
-}
-@end
-
-@implementation CCQuickActions
-
-+ (instancetype)quickActionsManager
-{
-    static dispatch_once_t once;
-    static CCQuickActions *__quickActionsManager;
-    
-    dispatch_once(&once, ^{
-        __quickActionsManager = [[CCQuickActions alloc] init];
-        __quickActionsManager->appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    });
-    
-    return __quickActionsManager;
-}
-
-- (instancetype)init
-{
-    if (self = [super init]) {
-        
-    }
-    
-    return self;
-}
-
-- (void)startQuickActionsViewController:(UIViewController *)viewController
-{
-    _mainVC = (CCMain *)viewController;
-    
-    [self openAssetsPickerController];
-}
-
-- (void)closeAll
-{
-    if (_move)
-        [_move dismissViewControllerAnimated:NO completion:nil];
-    
-    _move = nil;
-    _assets = nil;
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Assets Picker =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)openAssetsPickerController
-{
-    [[NCMainCommon sharedInstance] openPhotosPickerViewController:_mainVC phAssets:^(NSArray<PHAsset *> * _Nonnull assets) {
-        if (assets.count > 0) {
-            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-                _assets = [[NSMutableArray alloc] initWithArray:assets];
-                
-                if ([assets count] > 0)
-                    [self moveOpenWindow:nil];
-            });
-        }
-    }];
-}
-
-/*
-- (void)openAssetsPickerController
-{
-    CTAssetCheckmark *checkmark = [CTAssetCheckmark appearance];
-    checkmark.tintColor = [NCBrandColor sharedInstance].brandElement;
-    [checkmark setMargin:0.0 forVerticalEdge:NSLayoutAttributeRight horizontalEdge:NSLayoutAttributeTop];
-    
-    UINavigationBar *navBar = [UINavigationBar appearanceWhenContainedIn:[CTAssetsPickerController class], nil];
-    [appDelegate aspectNavigationControllerBar:navBar online:YES hidden:NO];
-    
-    [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            
-            CTAssetCheckmark *checkmark = [CTAssetCheckmark appearance];
-            [checkmark setMargin:0.0 forVerticalEdge:NSLayoutAttributeRight horizontalEdge:NSLayoutAttributeBottom];
-            
-            // init picker
-            _picker = [CTAssetsPickerController new];
-            
-            // set delegate
-            _picker.delegate = self;
-            
-            // to present picker as a form sheet in iPad
-            if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-                _picker.modalPresentationStyle = UIModalPresentationFormSheet;
-            
-            // present picker
-            [_mainVC presentViewController:_picker animated:YES completion:nil];
-        });
-    }];
-}
-*/
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Move =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)moveServerUrlTo:(NSString *)serverUrlTo title:(NSString *)title type:(NSString *)type
-{    
-    [_mainVC uploadFileAsset:_assets serverUrl:serverUrlTo useSubFolder:NO session:k_upload_session];
-}
-
-- (void)moveOpenWindow:(NSArray *)indexPaths
-{
-    UINavigationController* navigationController = [[UIStoryboard storyboardWithName:@"CCMove" bundle:nil] instantiateViewControllerWithIdentifier:@"CCMove"];
-    
-    _move = (CCMove *)navigationController.topViewController;
-    
-    _move.move.title = NSLocalizedString(@"_upload_file_", nil);
-    _move.delegate = self;
-    _move.tintColor = [NCBrandColor sharedInstance].brandText;
-    _move.barTintColor = [NCBrandColor sharedInstance].brand;
-    _move.tintColorTitle = [NCBrandColor sharedInstance].brandText;
-    _move.networkingOperationQueue = appDelegate.netQueue;
-    // E2EE
-    _move.includeDirectoryE2EEncryption = NO;
-    
-    [navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
-    
-    [_mainVC presentViewController:navigationController animated:YES completion:nil];
-}
-
-@end