Browse Source

Download Controller: fix download queue action if view was never shown

Felix Paul Kühne 12 years ago
parent
commit
2e1c3cc528
1 changed files with 10 additions and 1 deletions
  1. 10 1
      AspenProject/VLCDownloadViewController.m

+ 10 - 1
AspenProject/VLCDownloadViewController.m

@@ -32,10 +32,18 @@
 
 
 @implementation VLCDownloadViewController
 @implementation VLCDownloadViewController
 
 
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+    if (self)
+        _currentDownloads = [[NSMutableArray alloc] init];
+
+    return self;
+}
+
 - (void)viewDidLoad
 - (void)viewDidLoad
 {
 {
     [self.downloadButton setTitle:NSLocalizedString(@"BUTTON_DOWNLOAD",@"") forState:UIControlStateNormal];
     [self.downloadButton setTitle:NSLocalizedString(@"BUTTON_DOWNLOAD",@"") forState:UIControlStateNormal];
-    _currentDownloads = [[NSMutableArray alloc] init];
     self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
     self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
     self.title = NSLocalizedString(@"DOWNLOAD_FROM_HTTP", @"");
     self.title = NSLocalizedString(@"DOWNLOAD_FROM_HTTP", @"");
     self.whatToDownloadHelpLabel.text = [NSString stringWithFormat:NSLocalizedString(@"DOWNLOAD_FROM_HTTP_HELP", @""), [[UIDevice currentDevice] model]];
     self.whatToDownloadHelpLabel.text = [NSString stringWithFormat:NSLocalizedString(@"DOWNLOAD_FROM_HTTP_HELP", @""), [[UIDevice currentDevice] model]];
@@ -265,6 +273,7 @@
 - (void)addURLToDownloadList:(NSURL *)aURL
 - (void)addURLToDownloadList:(NSURL *)aURL
 {
 {
     [_currentDownloads addObject:aURL];
     [_currentDownloads addObject:aURL];
+    [self.downloadsTable reloadData];
     [self _triggerNextDownload];
     [self _triggerNextDownload];
 }
 }