Commit ff257c40 authored by Carola Nitz's avatar Carola Nitz

GDrive:removed unneeded code and fixed typos

parent 90b3225c
......@@ -32,7 +32,6 @@
@property (nonatomic, retain) id delegate;
@property (nonatomic, readonly) NSArray *currentListFiles;
@property (nonatomic, readwrite) BOOL isAuthorized;
@property (nonatomic, readonly) NSInteger numberOfFilesWaitingToBeDownloaded;
@property (nonatomic, retain) GTLServiceDrive *driveService;
+ (VLCGoogleDriveController *)sharedInstance;
......
......@@ -14,7 +14,6 @@
#import "VLCGoogleDriveController.h"
#import "NSString+SupportedMedia.h"
#import "VLCAppDelegate.h"
#import "HTTPMessage.h"
@interface VLCGoogleDriveController ()
{
......@@ -225,11 +224,6 @@
NSString *exportURLStr = file.downloadUrl;
if ([exportURLStr length] > 0) {
NSString *suggestedName = file.originalFilename;
if ([suggestedName length] == 0) {
suggestedName = file.title;
}
NSURL *url = [NSURL URLWithString:exportURLStr];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
GTMHTTPFetcher *fetcher = [GTMHTTPFetcher fetcherWithRequest:request];
......@@ -255,7 +249,7 @@
[fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) {
if (error == nil) {
[self showAlert:NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL_TITLE",nil) message:NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL",nil)];
[self downloadSucessfull];
[self downloadSuccessful];
} else {
[self showAlert:NSLocalizedString(@"GDRIVE_ERROR_DOWNLOADING_FILE_TITLE",nil) message:NSLocalizedString(@"GDRIVE_ERROR_DOWNLOADING_FILE",nil)];
[self downloadFailedWithError:error];
......@@ -277,16 +271,16 @@
[formatter setDateFormat:@"HH:mm:ss"];
[formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
NSString *remaingTime = [formatter stringFromDate:date];
NSString *remainingTime = [formatter stringFromDate:date];
if ([self.delegate respondsToSelector:@selector(updateRemainingTime:)])
[self.delegate updateRemainingTime:remaingTime];
[self.delegate updateRemainingTime:remainingTime];
}
- (void)downloadSucessfull
- (void)downloadSuccessful
{
/* update library now that we got a file */
APLog(@"DriveFile download was successful");
VLCAppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
VLCAppDelegate *appDelegate = (VLCAppDelegate *) [UIApplication sharedApplication].delegate;
[appDelegate performSelectorOnMainThread:@selector(updateMediaList) withObject:nil waitUntilDone:NO];
if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
......
......@@ -15,11 +15,7 @@
#import "VLCCloudStorageTableViewCell.h"
#import "VLCGoogleDriveController.h"
#import "VLCAppDelegate.h"
#import "VLCPlaylistViewController.h"
#import "UIBarButtonItem+Theme.h"
#import "VLCGoogleDriveConstants.h"
#import "GTMOAuth2ViewControllerTouch.h"
#import "VLCGoogleDriveController.h"
@interface VLCGoogleDriveTableViewController () <VLCCloudStorageTableViewCell>
{
......@@ -33,7 +29,6 @@
UIBarButtonItem *_numberOfFilesBarButtonItem;
UIBarButtonItem *_progressBarButtonItem;
UIBarButtonItem *_downloadingBarLabel;
UIProgressView *_progressBar;
UILabel *_progressLabel;
......@@ -134,17 +129,6 @@
[self updateViewAfterSessionChange];
}
- (void)showAlert:(NSString *)title message:(NSString *)message
{
UIAlertView *alert;
alert = [[UIAlertView alloc] initWithTitle: title
message: message
delegate: nil
cancelButtonTitle: @"OK"
otherButtonTitles: nil];
[alert show];
}
- (void)viewWillAppear:(BOOL)animated
{
self.navigationController.toolbarHidden = NO;
......@@ -256,7 +240,6 @@
_currentFolderId = [_currentFolderId stringByAppendingString:_selectedFile.identifier];
[self _requestInformationForCurrentFolderId];
}
_selectedFile = nil;
[self.tableView deselectRowAtIndexPath:indexPath animated:NO];
}
......@@ -276,7 +259,6 @@
{
if (buttonIndex == 1)
[_googleDriveController downloadFileToDocumentFolder:_selectedFile];
_selectedFile = nil;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment