Browse Source

clouds: cosmetics

(cherry picked from commit 9c09939f016e7c9318a2d272cd964fbb4ad47431)
Felix Paul Kühne 10 years ago
parent
commit
bc43694c3d

+ 3 - 3
Sources/VLCBoxController.m

@@ -155,9 +155,9 @@
      * and pass the final location to libvlc, which does not require a custom HTTP header */
 
     NSURL *baseURL = [[[BoxSDK sharedSDK] filesManager] URLWithResource:@"files"
-                                        ID:file.modelID
-                               subresource:@"content"
-                                     subID:nil];
+                                                                     ID:file.modelID
+                                                            subresource:@"content"
+                                                                  subID:nil];
 
     NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:baseURL
                                                               cachePolicy:NSURLRequestReloadIgnoringLocalCacheData

+ 27 - 27
Sources/VLCBoxTableViewController.m

@@ -43,34 +43,34 @@
     self.cloudStorageLogo.center = self.view.center;
     
     // Handle logged in
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(boxApiTokenDidRefresh)
-                                                 name:BoxOAuth2SessionDidRefreshTokensNotification
-                                               object:[BoxSDK sharedSDK].OAuth2Session];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(boxApiTokenDidRefresh)
-                                                 name:BoxOAuth2SessionDidBecomeAuthenticatedNotification
-                                               object:[BoxSDK sharedSDK].OAuth2Session];
+    NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
+    [defaultCenter addObserver:self
+                      selector:@selector(boxApiTokenDidRefresh)
+                          name:BoxOAuth2SessionDidRefreshTokensNotification
+                        object:[BoxSDK sharedSDK].OAuth2Session];
+
+    [defaultCenter addObserver:self
+                      selector:@selector(boxApiTokenDidRefresh)
+                          name:BoxOAuth2SessionDidBecomeAuthenticatedNotification
+                        object:[BoxSDK sharedSDK].OAuth2Session];
     // Handle logout
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(boxDidGetLoggedOut)
-                                                 name:BoxOAuth2SessionDidReceiveAuthenticationErrorNotification
-                                               object:[BoxSDK sharedSDK].OAuth2Session];
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(boxDidGetLoggedOut)
-                                                 name:BoxOAuth2SessionDidReceiveRefreshErrorNotification
-                                               object:[BoxSDK sharedSDK].OAuth2Session];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(boxAPIAuthenticationDidFail)
-                                                 name:BoxOAuth2SessionDidReceiveAuthenticationErrorNotification
-                                               object:[BoxSDK sharedSDK].OAuth2Session];
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(boxAPIInitiateLogin)
-                                                 name:BoxOAuth2SessionDidReceiveRefreshErrorNotification
-                                               object:[BoxSDK sharedSDK].OAuth2Session];
-
+    [defaultCenter addObserver:self
+                      selector:@selector(boxDidGetLoggedOut)
+                          name:BoxOAuth2SessionDidReceiveAuthenticationErrorNotification
+                        object:[BoxSDK sharedSDK].OAuth2Session];
+    [defaultCenter addObserver:self
+                      selector:@selector(boxDidGetLoggedOut)
+                          name:BoxOAuth2SessionDidReceiveRefreshErrorNotification
+                        object:[BoxSDK sharedSDK].OAuth2Session];
+
+    [defaultCenter addObserver:self
+                      selector:@selector(boxAPIAuthenticationDidFail)
+                          name:BoxOAuth2SessionDidReceiveAuthenticationErrorNotification
+                        object:[BoxSDK sharedSDK].OAuth2Session];
+    [defaultCenter addObserver:self
+                      selector:@selector(boxAPIInitiateLogin)
+                          name:BoxOAuth2SessionDidReceiveRefreshErrorNotification
+                        object:[BoxSDK sharedSDK].OAuth2Session];
 }
 
 - (UIViewController *)createAuthController

+ 2 - 2
Sources/VLCCloudStorageTableViewCell.h

@@ -2,7 +2,7 @@
  * VLCCloudStorageTableViewCell.h
  * VLC for iOS
  *****************************************************************************
- * Copyright (c) 2013 VideoLAN. All rights reserved.
+ * Copyright (c) 2013-2015 VideoLAN. All rights reserved.
  * $Id$
  *
  * Authors: Felix Paul Kühne <fkuehne # videolan.org>
@@ -26,7 +26,7 @@
 @property (nonatomic, strong) IBOutlet UIImageView *thumbnailView;
 @property (nonatomic, strong) IBOutlet UIButton *downloadButton;
 
-@property (nonatomic, retain) DBMetadata *fileMetadata;
+@property (nonatomic, retain) DBMetadata *dropboxFile;
 @property (nonatomic, retain) GTLDriveFile *driveFile;
 @property (nonatomic, retain) BoxItem *boxFile;
 @property (nonatomic, retain) VLCOneDriveObject *oneDriveFile;

+ 11 - 11
Sources/VLCCloudStorageTableViewCell.m

@@ -2,7 +2,7 @@
  * VLCCloudStorageTableViewCell.m
  * VLC for iOS
  *****************************************************************************
- * Copyright (c) 2013 VideoLAN. All rights reserved.
+ * Copyright (c) 2013-2015 VideoLAN. All rights reserved.
  * $Id$
  *
  * Authors: Carola Nitz <nitz.carola # googlemail.com>
@@ -30,10 +30,10 @@
     return cell;
 }
 
-- (void)setFileMetadata:(DBMetadata *)fileMetadata
+- (void)setDropboxFile:(DBMetadata *)dropboxFile
 {
-    if (fileMetadata != _fileMetadata)
-        _fileMetadata = fileMetadata;
+    if (dropboxFile != _dropboxFile)
+        _dropboxFile = dropboxFile;
 
     [self _updatedDisplayedInformation];
 }
@@ -64,19 +64,19 @@
 
 - (void)_updatedDisplayedInformation
 {
-    if (_fileMetadata != nil) {
-        if (self.fileMetadata.isDirectory) {
-            self.folderTitleLabel.text = self.fileMetadata.filename;
+    if (_dropboxFile != nil) {
+        if (self.dropboxFile.isDirectory) {
+            self.folderTitleLabel.text = self.dropboxFile.filename;
             self.titleLabel.hidden = self.subtitleLabel.hidden = YES;
             self.folderTitleLabel.hidden = NO;
         } else {
-            self.titleLabel.text = self.fileMetadata.filename;
-            self.subtitleLabel.text = (self.fileMetadata.totalBytes > 0) ? self.fileMetadata.humanReadableSize : @"";
+            self.titleLabel.text = self.dropboxFile.filename;
+            self.subtitleLabel.text = (self.dropboxFile.totalBytes > 0) ? self.dropboxFile.humanReadableSize : @"";
             self.titleLabel.hidden = self.subtitleLabel.hidden = NO;
             self.folderTitleLabel.hidden = YES;
         }
 
-        NSString *iconName = self.fileMetadata.icon;
+        NSString *iconName = self.dropboxFile.icon;
         if ([iconName isEqualToString:@"folder_user"] || [iconName isEqualToString:@"folder"] || [iconName isEqualToString:@"folder_public"] || [iconName isEqualToString:@"folder_photos"] || [iconName isEqualToString:@"package"]) {
             self.thumbnailView.image = [UIImage imageNamed:@"folder"];
             self.downloadButton.hidden = YES;
@@ -88,7 +88,7 @@
             self.thumbnailView.image = [UIImage imageNamed:@"audio"];
         else {
             self.thumbnailView.image = [UIImage imageNamed:@"blank"];
-            APLog(@"missing icon for type '%@'", self.fileMetadata.icon);
+            APLog(@"missing icon for type '%@'", self.dropboxFile.icon);
         }
 
     } else if(_driveFile != nil){

+ 2 - 1
Sources/VLCDropboxTableViewController.m

@@ -76,7 +76,7 @@
     if (cell == nil)
         cell = [VLCCloudStorageTableViewCell cellWithReuseIdentifier:CellIdentifier];
 
-    cell.fileMetadata = _dropboxController.currentListFiles[indexPath.row];
+    cell.dropboxFile = _dropboxController.currentListFiles[indexPath.row];
     cell.delegate = self;
 
     return cell;
@@ -120,6 +120,7 @@
 
 
 #pragma mark - VLCCloudStorageTableViewCell delegation
+
 - (void)triggerDownloadForCell:(VLCCloudStorageTableViewCell *)cell
 {
     _selectedFile = _dropboxController.currentListFiles[[self.tableView indexPathForCell:cell].row];

+ 0 - 2
Sources/VLCOneDriveController.m

@@ -10,7 +10,6 @@
  * Refer to the COPYING file of the official project for license.
  *****************************************************************************/
 
-
 #import "VLCOneDriveController.h"
 #import "VLCOneDriveConstants.h"
 #import "VLCOneDriveObject.h"
@@ -24,7 +23,6 @@
 @interface VLCOneDriveController () <LiveAuthDelegate, VLCOneDriveObjectDelegate, VLCOneDriveObjectDownloadDelegate>
 {
     LiveConnectClient *_liveClient;
-    //VLCOneDriveObject *_folderiD;
     NSString *_folderId;
     NSArray *_liveScopes;
     BOOL _activeSession;