diff --git a/Classes/PropertyView/English.lproj/ChapterView.xib b/Classes/PropertyView/English.lproj/ChapterView.xib
index 05e8530..7cde9f3 100755
--- a/Classes/PropertyView/English.lproj/ChapterView.xib
+++ b/Classes/PropertyView/English.lproj/ChapterView.xib
@@ -398,6 +398,7 @@
+
diff --git a/Classes/PropertyView/English.lproj/MovieView.xib b/Classes/PropertyView/English.lproj/MovieView.xib
index 3ca026c..5d5383f 100755
--- a/Classes/PropertyView/English.lproj/MovieView.xib
+++ b/Classes/PropertyView/English.lproj/MovieView.xib
@@ -39,18 +39,18 @@
-
+
-
+
-
+
-
+
diff --git a/Classes/PropertyView/SBMovieViewController.h b/Classes/PropertyView/SBMovieViewController.h
index 88cb1c1..2bc87c0 100755
--- a/Classes/PropertyView/SBMovieViewController.h
+++ b/Classes/PropertyView/SBMovieViewController.h
@@ -40,7 +40,6 @@ NS_ASSUME_NONNULL_BEGIN
NSDictionary *tags;
NSArray *_tagsArray;
- NSArray *tagsMenu;
NSDictionary *detailBoldAttr;
NSMutableDictionary *dct;
diff --git a/Classes/PropertyView/SBMovieViewController.m b/Classes/PropertyView/SBMovieViewController.m
index d935a00..046928f 100755
--- a/Classes/PropertyView/SBMovieViewController.m
+++ b/Classes/PropertyView/SBMovieViewController.m
@@ -40,8 +40,8 @@ NSString *MetadataPBoardType = @"SublerMetadataPBoardType";
selector:@selector(updateSetsMenu:)
name:@"SBPresetManagerUpdatedNotification" object:nil];
- tagsMenu = [[metadata writableMetadata] retain];
- for (id tag in tagsMenu) {
+ NSArray *tagsMenu = [metadata writableMetadata];
+ for (NSString *tag in tagsMenu) {
[tagList addItemWithTitle:tag];
}
@@ -94,13 +94,13 @@ NSString *MetadataPBoardType = @"SublerMetadataPBoardType";
[imageBrowser reloadData];
}
-- (void) setFile: (MP42File *)file
+- (void)setFile:(MP42File *)file
{
metadata = [file.metadata retain];
tags = metadata.tagsDict;
}
-- (void) setMetadata: (MP42Metadata *)data
+- (void)setMetadata:(MP42Metadata *)data
{
metadata = [data retain];
tags = data.tagsDict;
@@ -820,13 +820,12 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
- [imageBrowser setDataSource:nil];
[imageBrowser setDelegate:nil];
- [tagsTableView setDataSource:nil];
+ [imageBrowser setDataSource:nil];
[tagsTableView setDelegate:nil];
+ [tagsTableView setDataSource:nil];
[_tagsArray release];
- [tagsMenu release];
[tabCol release];
[ratingCell release];
[genreCell release];
diff --git a/Classes/SBApplication.h b/Classes/SBApplication.h
index 6b82f49..1b72628 100644
--- a/Classes/SBApplication.h
+++ b/Classes/SBApplication.h
@@ -1,8 +1,8 @@
-/* HBApplication.h $
-
- This file is part of the HandBrake source code.
- Homepage: .
- It may be used under the terms of the GNU General Public License. */
+//
+// SBLogger.m
+// Subler
+//
+//
#import
diff --git a/Classes/SBApplication.m b/Classes/SBApplication.m
index 91c21f7..18041e4 100644
--- a/Classes/SBApplication.m
+++ b/Classes/SBApplication.m
@@ -1,8 +1,7 @@
-/* HBApplication.m $
-
- This file is part of the HandBrake source code.
- Homepage: .
- It may be used under the terms of the GNU General Public License. */
+//
+// SBLogger.m
+// Subler
+//
#import "SBApplication.h"
#import "SBExceptionAlertController.h"
@@ -17,14 +16,15 @@ static void CrashMyApplication()
- (NSAttributedString *)_formattedExceptionBacktrace:(NSArray *)backtrace
{
NSMutableAttributedString *result = [[NSMutableAttributedString alloc] init];
- for (__strong NSString *s in backtrace)
+ for (NSString *s in backtrace)
{
s = [s stringByAppendingString:@"\n"];
NSAttributedString *attrS = [[NSAttributedString alloc] initWithString:s];
[result appendAttributedString:attrS];
+ [attrS release];
}
[result addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Monaco" size:10] range:NSMakeRange(0, result.length)];
- return result;
+ return [result autorelease];
}
- (void)reportException:(NSException *)exception
@@ -37,11 +37,7 @@ static void CrashMyApplication()
{
// Create a string based on the exception
NSString *exceptionMessage = [NSString stringWithFormat:@"%@\nReason: %@\nUser Info: %@", exception.name, exception.reason, exception.userInfo];
- // Always log to console for history
-
- //[HBUtilities writeToActivityLog:"Exception raised:\n%s", exceptionMessage.UTF8String];
- //[HBUtilities writeToActivityLog:"Backtrace:\n%s", exception.callStackSymbols.description.UTF8String];
-
+
SBExceptionAlertController *alertController = [[SBExceptionAlertController alloc] init];
alertController.exceptionMessage = exceptionMessage;
alertController.exceptionBacktrace = [self _formattedExceptionBacktrace:exception.callStackSymbols];
diff --git a/Classes/SBDocument.m b/Classes/SBDocument.m
index 1c5cb8d..b9c0684 100755
--- a/Classes/SBDocument.m
+++ b/Classes/SBDocument.m
@@ -133,7 +133,9 @@
- (BOOL)writeSafelyToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError * _Nullable *)outError
{
- dispatch_async(dispatch_get_main_queue(), ^{
+ [self unblockUserInteraction];
+
+ dispatch_sync(dispatch_get_main_queue(), ^{
[optBar setIndeterminate:YES];
[optBar startAnimation:self];
[saveOperationName setStringValue:@"Saving…"];
@@ -141,8 +143,6 @@
modalDelegate:nil didEndSelector:NULL contextInfo:nil];
});
- [self unblockUserInteraction];
-
IOPMAssertionID assertionID;
// Enable sleep assertion
CFStringRef reasonForActivity= CFSTR("Subler Save Operation");
@@ -192,18 +192,17 @@
IOPMAssertionRelease(assertionID);
}
-
NSError *error = *outError;
MP42File *reloadedFile = nil;
if (result == YES) {
- reloadedFile = [[[MP42File alloc] initWithURL:url delegate:self] autorelease];
+ reloadedFile = [[MP42File alloc] initWithURL:url delegate:self];
}
- dispatch_async(dispatch_get_main_queue(), ^{
- [NSApp endSheet:savingWindow];
- [savingWindow orderOut:self];
+ dispatch_sync(dispatch_get_main_queue(), ^{
[optBar stopAnimation:self];
+ [savingWindow orderOut:self];
+ [NSApp endSheet:savingWindow];
if (result == YES && error) {
[self presentError:error
@@ -215,6 +214,7 @@
if (reloadedFile) {
self.mp4 = reloadedFile;
+ [reloadedFile release];
}
});
@@ -469,15 +469,13 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
- (void)reloadPropertyView
{
- if ([propertyView view] != nil) {
+ if (propertyView.view != nil) {
+ // remove the undo items from the dealloced view
+ [[self undoManager] removeAllActionsWithTarget:propertyView];
+
// remove the current view
- [[propertyView view] removeFromSuperview];
- }
+ [propertyView.view removeFromSuperview];
- // remove the undo items from the dealloced view
- [[self undoManager] removeAllActionsWithTarget:propertyView];
-
- if (propertyView != nil) {
// remove the current view controller
[propertyView release];
}
@@ -508,7 +506,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
propertyView = controller;
// embed the current view to our host view
- [targetView addSubview: [propertyView view]];
+ [targetView addSubview:propertyView.view];
[documentWindow recalculateKeyViewLoop];
// make sure we automatically resize the controller's view to the current window size
@@ -519,8 +517,9 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
- (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
{
// Copy the row numbers to the pasteboard.
- if ([[self.mp4 trackAtIndex:[rowIndexes firstIndex]] muxed])
+ if ([[self.mp4 trackAtIndex:[rowIndexes firstIndex]] muxed]) {
return NO;
+ }
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes];
[pboard declareTypes:@[SublerTableViewDataType] owner:self];
@@ -652,8 +651,9 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
MP42VideoTrack *videoTrack = (MP42VideoTrack *)track;
int hdVideo = isHdVideo((uint64_t)videoTrack.trackWidth, (uint64_t)videoTrack.trackHeight);
- if (hdVideo)
- [self.mp4.metadata setTag:@(hdVideo) forKey:@"HD Video"];
+ if (hdVideo) {
+ self.mp4.metadata[@"HD Video"] = @(hdVideo);
+ }
}
[self updateChangeCount:NSChangeDone];
}
@@ -955,6 +955,9 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
- (void)dealloc
{
+ [fileTracksTable setDelegate:nil];
+ [fileTracksTable setDataSource:nil];
+
[propertyView release];
propertyView = nil;
diff --git a/Classes/SBExceptionAlertController.h b/Classes/SBExceptionAlertController.h
index 1b215ea..5ad8a8f 100644
--- a/Classes/SBExceptionAlertController.h
+++ b/Classes/SBExceptionAlertController.h
@@ -1,8 +1,7 @@
-/* HBExceptionAlertController.h $
-
- This file is part of the HandBrake source code.
- Homepage: .
- It may be used under the terms of the GNU General Public License. */
+//
+// SBLogger.m
+// Subler
+//
#import
@@ -11,11 +10,14 @@ typedef NS_ENUM(NSUInteger, SBExceptionAlertControllerResult) {
SBExceptionAlertControllerResultContinue,
};
-@interface SBExceptionAlertController : NSWindowController
+@interface SBExceptionAlertController : NSWindowController {
+ NSString *_exceptionMessage;
+ NSAttributedString *_exceptionBacktrace;
+}
// Properties are used by bindings
-@property (copy) NSString *exceptionMessage;
-@property (copy) NSAttributedString *exceptionBacktrace;
+@property (nonatomic, copy) NSString *exceptionMessage;
+@property (nonatomic, copy) NSAttributedString *exceptionBacktrace;
- (IBAction)btnCrashClicked:(id)sender;
- (IBAction)btnContinueClicked:(id)sender;
diff --git a/Classes/SBExceptionAlertController.m b/Classes/SBExceptionAlertController.m
index 4e550a8..409ec6c 100644
--- a/Classes/SBExceptionAlertController.m
+++ b/Classes/SBExceptionAlertController.m
@@ -1,8 +1,7 @@
-/* HBExceptionAlertController.m $
-
- This file is part of the HandBrake source code.
- Homepage: .
- It may be used under the terms of the GNU General Public License. */
+//
+// SBLogger.m
+// Subler
+//
#import "SBExceptionAlertController.h"
@@ -13,6 +12,9 @@
return [self initWithWindowNibName:@"ExceptionAlert"];
}
+@synthesize exceptionBacktrace = _exceptionBacktrace;
+@synthesize exceptionMessage = _exceptionMessage;
+
- (NSInteger)runModal
{
return [NSApp runModalForWindow:self.window];
diff --git a/Classes/SBImageBrowserView.m b/Classes/SBImageBrowserView.m
index 7a07bea..0199de9 100755
--- a/Classes/SBImageBrowserView.m
+++ b/Classes/SBImageBrowserView.m
@@ -16,7 +16,7 @@
{
self = [super initWithFrame:frame];
if (self) {
- _pasteboardTypes = @[];
+ _pasteboardTypes = [@[] retain];
}
return self;
}
@@ -25,7 +25,7 @@
{
self = [super initWithCoder:coder];
if (self) {
- _pasteboardTypes = @[];
+ _pasteboardTypes = [@[] retain];
}
return self;
}
@@ -62,6 +62,8 @@
- (void)dealloc
{
[_pasteboardTypes release];
+ _pasteboardTypes = nil;
+
[super dealloc];
}
diff --git a/Classes/SBLogWindowController.h b/Classes/SBLogWindowController.h
index 7df9c72..c5d71f4 100644
--- a/Classes/SBLogWindowController.h
+++ b/Classes/SBLogWindowController.h
@@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@class SBLogger;
@interface SBLogWindowController : NSWindowController {
+ @private
NSTextView *_logView;
SBLogger *_logger;
}
diff --git a/Classes/SBMetadataSearchController.m b/Classes/SBMetadataSearchController.m
index 4af28f5..3c1971a 100755
--- a/Classes/SBMetadataSearchController.m
+++ b/Classes/SBMetadataSearchController.m
@@ -420,10 +420,10 @@
}
[delegate metadataImportDone:self.selectedResult];
- [metadataTable setDataSource:nil];
[metadataTable setDelegate:nil];
- [resultsTable setDataSource:nil];
+ [metadataTable setDataSource:nil];
[resultsTable setDelegate:nil];
+ [resultsTable setDataSource:nil];
[NSApp endSheet:[self window] returnCode:1];
}
@@ -433,10 +433,10 @@
[self.currentSearcher cancel];
self.currentSearcher = nil;
- [metadataTable setDataSource:nil];
[metadataTable setDelegate:nil];
- [resultsTable setDataSource:nil];
+ [metadataTable setDataSource:nil];
[resultsTable setDelegate:nil];
+ [resultsTable setDataSource:nil];
[NSApp endSheet:[self window] returnCode:0];
}
@@ -593,10 +593,12 @@ static NSInteger sortFunction (id ldict, id rdict, void *context) {
NSInteger right = [(NSArray*) context indexOfObject:rdict];
NSInteger left = [(NSArray*) context indexOfObject:ldict];
- if (right < left)
+ if (right < left) {
rc = NSOrderedDescending;
- else
+ }
+ else {
rc = NSOrderedAscending;
+ }
return rc;
}
diff --git a/Classes/SBQueueAction.m b/Classes/SBQueueAction.m
index 25b2813..9018e80 100644
--- a/Classes/SBQueueAction.m
+++ b/Classes/SBQueueAction.m
@@ -167,8 +167,9 @@
MP42Image *artwork = [self loadArtwork:artworkURL];
- if (artwork)
+ if (artwork) {
[metadata.artworks addObject:artwork];
+ }
}
return metadata;
@@ -183,11 +184,12 @@
MP42VideoTrack *videoTrack = (MP42VideoTrack *)track;
int hdVideo = isHdVideo((uint64_t)videoTrack.trackWidth, (uint64_t)videoTrack.trackHeight);
- if (hdVideo)
- [metadata setTag:@(hdVideo) forKey:@"HD Video"];
+ if (hdVideo) {
+ metadata[@"HD Video"] = @(hdVideo);
+ }
}
- [[item.mp4File metadata] mergeMetadata:metadata];
+ [item.mp4File.metadata mergeMetadata:metadata];
}
- (NSString *)description {
diff --git a/Classes/SBTableView.h b/Classes/SBTableView.h
index 74c6c67..9a6775a 100755
--- a/Classes/SBTableView.h
+++ b/Classes/SBTableView.h
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
NSArray *_pasteboardTypes;
NSInteger _defaultEditingColumn;
}
-@property(nonatomic, readwrite, retain) NSArray *pasteboardTypes;
+@property(nonatomic, readwrite, copy) NSArray *pasteboardTypes;
@property(nonatomic, readwrite) NSInteger defaultEditingColumn;
@end
diff --git a/Classes/SBTableView.m b/Classes/SBTableView.m
index 4a17ab7..9addb8a 100755
--- a/Classes/SBTableView.m
+++ b/Classes/SBTableView.m
@@ -18,7 +18,7 @@
{
self = [super initWithFrame:frame];
if (self) {
- _pasteboardTypes = @[];
+ _pasteboardTypes = [@[] retain];
}
return self;
}
@@ -27,7 +27,7 @@
{
self = [super initWithCoder:coder];
if (self) {
- _pasteboardTypes = @[];
+ _pasteboardTypes = [@[] retain];
}
return self;
}
@@ -170,9 +170,11 @@
[super drawRow:inRow clipRect:newClipRect];
}
-- (void) dealloc
+- (void)dealloc
{
[_pasteboardTypes release];
+ _pasteboardTypes = nil;
+
[super dealloc];
}
diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib
index 1bead7c..f08b274 100755
--- a/English.lproj/MainMenu.xib
+++ b/English.lproj/MainMenu.xib
@@ -11,7 +11,7 @@
-
+