Browse Source

clear code

Marino Faggiana 7 years ago
parent
commit
5deef1f653
3 changed files with 8 additions and 44 deletions
  1. 1 0
      iOSClient/Favorites/CCFavorites.h
  2. 0 38
      iOSClient/Login/CCLogin.m
  3. 7 6
      iOSClient/Main/CCMain.m

+ 1 - 0
iOSClient/Favorites/CCFavorites.h

@@ -46,6 +46,7 @@
 @property (nonatomic, weak) CCDetail *detailViewController;
 @property (nonatomic, strong) UIDocumentInteractionController *docController;
 
+- (void)reloadDatasource;
 - (void)readListingFavorites;
 - (void)addFavoriteFolder:(NSString *)serverUrl;
 

+ 0 - 38
iOSClient/Login/CCLogin.m

@@ -430,44 +430,6 @@
     });
 }
 
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== User Profile  ====
-#pragma --------------------------------------------------------------------------------------------
-/*
-- (void)getUserProfileFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
-{
-    [[NCManageDatabase sharedInstance] deleteAccount:metadataNet.account];
-    
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_", nil) message:message 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)getUserProfileSuccess:(CCMetadataNet *)metadataNet userProfile:(OCUserProfile *)userProfile
-{
-    // Verify if the account already exists
-    if (userProfile.id.length > 0 && self.baseUrl.text.length > 0 && self.user.text.length > 0) {
-    
-        tableAccount *accountAlreadyExists = [[NCManageDatabase sharedInstance] getAccountWithPredicate:[NSPredicate predicateWithFormat:@"url = %@ AND user = %@ AND userID != %@", self.baseUrl.text, userProfile.id, self.user.text]];
-        
-        if (accountAlreadyExists) {
-            
-            [[NCManageDatabase sharedInstance] deleteAccount:metadataNet.account];
-            
-            UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_", nil) message:[NSString stringWithFormat:NSLocalizedString(@"_account_already_exists_", nil), userProfile.id] preferredStyle:UIAlertControllerStyleAlert];
-            UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {}];
-            
-            [alertController addAction:okAction];
-            [self presentViewController:alertController animated:YES completion:nil];
-            
-            return;
-        }
-    }
-}
-*/
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark == TextField ==
 #pragma --------------------------------------------------------------------------------------------

+ 7 - 6
iOSClient/Main/CCMain.m

@@ -378,12 +378,6 @@
         // Setting Theming
         [appDelegate settingThemingColorBrand];
         
-        // Load photo datasorce
-        [appDelegate.activePhotos reloadDatasource];
-        
-        // Read this folder
-        [self readFileReloadFolder];
-
         // remove all of detail
         [appDelegate.activeDetail removeAllView];
         
@@ -400,6 +394,13 @@
         NSLog(@"[LOG] Request Server Capabilities");
         [self requestServerCapabilities];
         
+        // Clear datasorce
+        [appDelegate.activePhotos reloadDatasource];
+        [appDelegate.activeFavorites reloadDatasource];
+        
+        // Read this folder
+        [self readFileReloadFolder];
+        
     } else {
         
         // reload datasource