From: ritsuka Date: Sun, 2 Nov 2014 15:12:15 +0000 (+0000) Subject: MacGui: fixed a issue that happened on 10.8 when reloading a job from the queue:... X-Git-Tag: 0.10.0~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2857c1fd3d6762d787a90474440b1def74223232;p=handbrake MacGui: fixed a issue that happened on 10.8 when reloading a job from the queue: we tried to add an object to an immutable NSArray that for some reason known to the Cocoa framework was a NSMutableArray on 10.9+ , but not on 10.8. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6496 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/macosx/HBSubtitlesController.h b/macosx/HBSubtitlesController.h index 013074cf0..dd41d1d81 100644 --- a/macosx/HBSubtitlesController.h +++ b/macosx/HBSubtitlesController.h @@ -29,7 +29,7 @@ extern NSString *keySubTrackSrtCharCode; */ @interface HBSubtitlesController : NSViewController -- (void)addTracksFromQueue:(NSMutableArray *)newSubtitleArray; +- (void)addTracksFromQueue:(NSArray *)queueSubtitleArray; - (void)applySettingsFromPreset:(NSDictionary *)preset; diff --git a/macosx/HBSubtitlesController.m b/macosx/HBSubtitlesController.m index 91ed94c8d..4882cc84b 100644 --- a/macosx/HBSubtitlesController.m +++ b/macosx/HBSubtitlesController.m @@ -192,13 +192,13 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex"; return [ret autorelease]; } -- (void)addTracksFromQueue:(NSMutableArray *)newSubtitleArray +- (void)addTracksFromQueue:(NSArray *)queueSubtitleArray { /* Note: we need to look for external subtitles so it can be added to the source array track. * Remember the source container subs are already loaded with resetTitle which is already called * so any external sub sources need to be added to our source subs here */ - for (id tempObject in newSubtitleArray) + for (id tempObject in queueSubtitleArray) { /* We have an srt track */ if ([tempObject[keySubTrackType] intValue] == SRTSUB) @@ -212,10 +212,9 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex"; } } - [newSubtitleArray addObject:[self createSubtitleTrack]]; - // Set the subtitleArray to the newSubtitleArray - [self.subtitleArray setArray:newSubtitleArray]; + [self.subtitleArray setArray:queueSubtitleArray]; + [self.subtitleArray addObject:[self createSubtitleTrack]]; [self.fTableView reloadData]; }