diff --git a/cocoa/AppDelegate.m b/cocoa/AppDelegate.m index b386c6c..f6c3fc0 100644 --- a/cocoa/AppDelegate.m +++ b/cocoa/AppDelegate.m @@ -197,7 +197,7 @@ http://www.gnu.org/licenses/gpl-3.0.html [op setAllowsMultipleSelection:NO]; [op setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]]; [op setTitle:NSLocalizedString(@"Select a results file to load", @"")]; - if ([op runModal] == NSOKButton) { + if ([op runModal] == NSModalResponseOK) { NSString *filename = [[[op URLs] objectAtIndex:0] path]; [model loadResultsFrom:filename]; [[self recentResults] addFile:filename]; @@ -354,7 +354,7 @@ http://www.gnu.org/licenses/gpl-3.0.html [op setCanCreateDirectories:YES]; [op setAllowsMultipleSelection:NO]; [op setTitle:prompt]; - if ([op runModal] == NSOKButton) { + if ([op runModal] == NSModalResponseOK) { return [[[op URLs] objectAtIndex:0] path]; } else { @@ -368,7 +368,7 @@ http://www.gnu.org/licenses/gpl-3.0.html [sp setCanCreateDirectories:YES]; [sp setAllowedFileTypes:[NSArray arrayWithObject:extension]]; [sp setTitle:prompt]; - if ([sp runModal] == NSOKButton) { + if ([sp runModal] == NSModalResponseOK) { return [[sp URL] path]; } else { diff --git a/cocoa/DeletionOptions.m b/cocoa/DeletionOptions.m index f384d24..c061ebf 100644 --- a/cocoa/DeletionOptions.m +++ b/cocoa/DeletionOptions.m @@ -33,19 +33,19 @@ http://www.gnu.org/licenses/gpl-3.0.html - (IBAction)updateOptions:(id)sender { - [model setLinkDeleted:[linkButton state] == NSOnState]; + [model setLinkDeleted:[linkButton state] == NSControlStateValueOn]; [model setUseHardlinks:[linkTypeRadio selectedColumn] == 1]; - [model setDirect:[directButton state] == NSOnState]; + [model setDirect:[directButton state] == NSControlStateValueOn]; } - (IBAction)proceed:(id)sender { - [NSApp stopModalWithCode:NSOKButton]; + [NSApp stopModalWithCode:NSModalResponseOK]; } - (IBAction)cancel:(id)sender { - [NSApp stopModalWithCode:NSCancelButton]; + [NSApp stopModalWithCode:NSModalResponseCancel]; } /* model --> view */ @@ -56,16 +56,16 @@ http://www.gnu.org/licenses/gpl-3.0.html - (BOOL)show { - [linkButton setState:NSOffState]; - [directButton setState:NSOffState]; + [linkButton setState:NSControlStateValueOff]; + [directButton setState:NSControlStateValueOff]; [linkTypeRadio selectCellAtRow:0 column:0]; NSInteger r = [NSApp runModalForWindow:[self window]]; [[self window] close]; - return r == NSOKButton; + return r == NSModalResponseOK; } - (void)setHardlinkOptionEnabled:(BOOL)enabled { [linkTypeRadio setEnabled:enabled]; } -@end \ No newline at end of file +@end diff --git a/cocoa/DirectoryPanel.m b/cocoa/DirectoryPanel.m index 9f95db6..92b84f3 100644 --- a/cocoa/DirectoryPanel.m +++ b/cocoa/DirectoryPanel.m @@ -113,7 +113,7 @@ http://www.gnu.org/licenses/gpl-3.0.html [op setAllowsMultipleSelection:YES]; [op setTitle:NSLocalizedString(@"Select a folder to add to the scanning list", @"")]; [op setDelegate:self]; - if ([op runModal] == NSOKButton) { + if ([op runModal] == NSModalResponseOK) { for (NSURL *directoryURL in [op URLs]) { [self addDirectory:[directoryURL path]]; } diff --git a/cocoa/ResultTable.m b/cocoa/ResultTable.m index 82d20f6..be7ef35 100644 --- a/cocoa/ResultTable.m +++ b/cocoa/ResultTable.m @@ -165,7 +165,7 @@ http://www.gnu.org/licenses/gpl-3.0.html - (BOOL)previewPanel:(QLPreviewPanel *)panel handleEvent:(NSEvent *)event { // redirect all key down events to the table view - if ([event type] == NSKeyDown) { + if ([event type] == NSEventTypeKeyDown) { [[self view] keyDown:event]; return YES; } @@ -177,4 +177,4 @@ http://www.gnu.org/licenses/gpl-3.0.html { [[self view] setNeedsDisplay:YES]; } -@end \ No newline at end of file +@end diff --git a/cocoa/ResultWindow.m b/cocoa/ResultWindow.m index 085a78a..0984d03 100644 --- a/cocoa/ResultWindow.m +++ b/cocoa/ResultWindow.m @@ -59,7 +59,7 @@ http://www.gnu.org/licenses/gpl-3.0.html BOOL marked = n2b([pair objectAtIndex:1]); NSMenuItem *mi = [[app columnsMenu] addItemWithTitle:display action:@selector(toggleColumn:) keyEquivalent:@""]; [mi setTarget:self]; - [mi setState:marked ? NSOnState : NSOffState]; + [mi setState:marked ? NSControlStateValueOn : NSControlStateValueOff]; [mi setTag:i]; } [[app columnsMenu] addItem:[NSMenuItem separatorItem]]; @@ -118,10 +118,10 @@ http://www.gnu.org/licenses/gpl-3.0.html }; [[aTable columns] initializeColumns:defs]; NSTableColumn *c = [[aTable view] tableColumnWithIdentifier:@"marked"]; - [[c dataCell] setButtonType:NSSwitchButton]; - [[c dataCell] setControlSize:NSSmallControlSize]; + [[c dataCell] setButtonType:NSButtonTypeSwitch]; + [[c dataCell] setControlSize:NSControlSizeSmall]; c = [[aTable view] tableColumnWithIdentifier:@"size"]; - [[c dataCell] setAlignment:NSRightTextAlignment]; + [[c dataCell] setAlignment:NSTextAlignmentRight]; } else if (appMode == AppModeMusic) { HSColumnDef defs[] = { @@ -148,14 +148,14 @@ http://www.gnu.org/licenses/gpl-3.0.html }; [[aTable columns] initializeColumns:defs]; NSTableColumn *c = [[aTable view] tableColumnWithIdentifier:@"marked"]; - [[c dataCell] setButtonType:NSSwitchButton]; - [[c dataCell] setControlSize:NSSmallControlSize]; + [[c dataCell] setButtonType:NSButtonTypeSwitch]; + [[c dataCell] setControlSize:NSControlSizeSmall]; c = [[aTable view] tableColumnWithIdentifier:@"size"]; - [[c dataCell] setAlignment:NSRightTextAlignment]; + [[c dataCell] setAlignment:NSTextAlignmentRight]; c = [[aTable view] tableColumnWithIdentifier:@"duration"]; - [[c dataCell] setAlignment:NSRightTextAlignment]; + [[c dataCell] setAlignment:NSTextAlignmentRight]; c = [[aTable view] tableColumnWithIdentifier:@"bitrate"]; - [[c dataCell] setAlignment:NSRightTextAlignment]; + [[c dataCell] setAlignment:NSTextAlignmentRight]; } else { HSColumnDef defs[] = { @@ -172,10 +172,10 @@ http://www.gnu.org/licenses/gpl-3.0.html }; [[aTable columns] initializeColumns:defs]; NSTableColumn *c = [[aTable view] tableColumnWithIdentifier:@"marked"]; - [[c dataCell] setButtonType:NSSwitchButton]; - [[c dataCell] setControlSize:NSSmallControlSize]; + [[c dataCell] setButtonType:NSButtonTypeSwitch]; + [[c dataCell] setControlSize:NSControlSizeSmall]; c = [[aTable view] tableColumnWithIdentifier:@"size"]; - [[c dataCell] setAlignment:NSRightTextAlignment]; + [[c dataCell] setAlignment:NSTextAlignmentRight]; } [[aTable columns] restoreColumns]; } @@ -305,7 +305,7 @@ http://www.gnu.org/licenses/gpl-3.0.html { PrioritizeDialog *dlg = [[PrioritizeDialog alloc] initWithApp:model]; NSInteger result = [NSApp runModalForWindow:[dlg window]]; - if (result == NSRunStoppedResponse) { + if (result == NSModalResponseStop ) { [[dlg model] performReprioritization]; } [dlg release]; @@ -329,7 +329,7 @@ http://www.gnu.org/licenses/gpl-3.0.html [sp setCanCreateDirectories:YES]; [sp setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]]; [sp setTitle:NSLocalizedString(@"Select a file to save your results to", @"")]; - if ([sp runModal] == NSOKButton) { + if ([sp runModal] == NSModalResponseOK) { [model saveResultsAs:[[sp URL] path]]; [[app recentResults] addFile:[[sp URL] path]]; } @@ -344,7 +344,7 @@ http://www.gnu.org/licenses/gpl-3.0.html { NSMenuItem *mi = sender; BOOL checked = [[[table columns] model] toggleMenuItem:[mi tag]]; - [mi setState:checked ? NSOnState : NSOffState]; + [mi setState:checked ? NSControlStateValueOn : NSControlStateValueOff]; } - (IBAction)toggleDetailsPanel:(id)sender diff --git a/cocoa/main.m b/cocoa/main.m index 3067e8f..2893e5b 100644 --- a/cocoa/main.m +++ b/cocoa/main.m @@ -23,7 +23,6 @@ int main(int argc, char *argv[]) Py_SetPath(wPythonPath); Py_SetPythonHome(wPythonPath); Py_Initialize(); - PyEval_InitThreads(); PyGILState_STATE gilState = PyGILState_Ensure(); FILE* fp = fopen([mainpy UTF8String], "r"); PyRun_SimpleFile(fp, [mainpy UTF8String]); diff --git a/cocoalib/NSEventAdditions.m b/cocoalib/NSEventAdditions.m index 03f8b00..e17bb8f 100644 --- a/cocoalib/NSEventAdditions.m +++ b/cocoalib/NSEventAdditions.m @@ -24,14 +24,14 @@ http://www.gnu.org/licenses/gpl-3.0.html { // get flags and strip the lower 16 (device dependant) bits // See modifierFlags's doc for details - return [self modifierFlags] & NSDeviceIndependentModifierFlagsMask; + return [self modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask; } - (NSUInteger)modifierKeysFlags { // This is modifierFlags with only Command, Opt, Ctrl and Shift, without the rest of the flags // to pollute. - return [self flags] & (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask); + return [self flags] & (NSEventModifierFlagShift | NSEventModifierFlagControl | NSEventModifierFlagOption | NSEventModifierFlagCommand); } - (BOOL)isDeleteOrBackspace diff --git a/cocoalib/NSImageAdditions.m b/cocoalib/NSImageAdditions.m index ad5fedd..ea7cd1a 100644 --- a/cocoalib/NSImageAdditions.m +++ b/cocoalib/NSImageAdditions.m @@ -101,7 +101,7 @@ [sourceImage drawInRect: thumbnailRect fromRect: NSZeroRect - operation: NSCompositeSourceOver + operation: NSCompositingOperationSourceOver fraction: 1.0]; [newImage unlockFocus]; @@ -111,4 +111,4 @@ return [newImage autorelease]; } -@end \ No newline at end of file +@end diff --git a/cocoalib/ProgressController.m b/cocoalib/ProgressController.m index 922942d..89d9980 100644 --- a/cocoalib/ProgressController.m +++ b/cocoalib/ProgressController.m @@ -49,7 +49,7 @@ static ProgressController *_mainPC = nil; [_worker cancelJob]; [[NSNotificationCenter defaultCenter] postNotificationName:JobCancelledNotification object:self]; _running = NO; - [NSApp endSheet:[self window] returnCode:NSRunAbortedResponse]; + [NSApp endSheet:[self window] returnCode:NSModalResponseAbort]; /* There's this really strange thing where when the app is inactive at the point we want to hide the progress dialog, it becomes impossible to close it. I guess it's due to some strange thread-related crap. Anyway, *DO NOT HIDE THE SHEET WHILE THE APP IS INACTIVE*. Do it later, diff --git a/cocoalib/views/HSOutlineView.m b/cocoalib/views/HSOutlineView.m index 14ab995..bc9f632 100644 --- a/cocoalib/views/HSOutlineView.m +++ b/cocoalib/views/HSOutlineView.m @@ -164,8 +164,8 @@ http://www.gnu.org/licenses/gpl-3.0.html NSString *data = [[self delegate] dataForCopyToPasteboard]; if (data != nil) { NSPasteboard *p = [NSPasteboard generalPasteboard]; - [p declareTypes:[NSArray arrayWithObjects:NSStringPboardType, nil] owner:nil]; - [p setString:data forType:NSStringPboardType]; + [p declareTypes:[NSArray arrayWithObjects:NSPasteboardTypeString, nil] owner:nil]; + [p setString:data forType:NSPasteboardTypeString]; } } diff --git a/dupeGuru.xcodeproj/project.pbxproj b/dupeGuru.xcodeproj/project.pbxproj index ca66a90..92ca63a 100644 --- a/dupeGuru.xcodeproj/project.pbxproj +++ b/dupeGuru.xcodeproj/project.pbxproj @@ -763,7 +763,7 @@ CE9C2E951E74E1640099B9FB /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0820; + LastUpgradeCheck = 1230; ORGANIZATIONNAME = "Virgil Dupras"; TargetAttributes = { CE9C2E9C1E74E1640099B9FB = { @@ -774,7 +774,7 @@ }; buildConfigurationList = CE9C2E981E74E1640099B9FB /* Build configuration list for PBXProject "dupeGuru" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( Base, @@ -793,6 +793,7 @@ uk, "zh-Hans", vi, + en, ); mainGroup = CE9C2E941E74E1640099B9FB; productRefGroup = CE9C2E9E1E74E1640099B9FB /* Products */; @@ -1307,15 +1308,24 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -1338,7 +1348,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 11.1; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -1355,15 +1365,24 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -1380,7 +1399,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 11.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; @@ -1390,7 +1409,8 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = NO; - CODE_SIGN_IDENTITY = ""; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; HEADER_SEARCH_PATHS = build/PythonHeaders; INFOPLIST_FILE = "$(SRCROOT)/build/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; @@ -1398,7 +1418,7 @@ "$(inherited)", "$(PROJECT_DIR)/build", ); - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 11.1; PRODUCT_BUNDLE_IDENTIFIER = "com.hardcoded-software.dupeguru"; PRODUCT_NAME = dupeGuru; }; @@ -1408,7 +1428,8 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = NO; - CODE_SIGN_IDENTITY = ""; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; HEADER_SEARCH_PATHS = build/PythonHeaders; INFOPLIST_FILE = "$(SRCROOT)/build/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; @@ -1416,7 +1437,7 @@ "$(inherited)", "$(PROJECT_DIR)/build", ); - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 11.1; PRODUCT_BUNDLE_IDENTIFIER = "com.hardcoded-software.dupeguru"; PRODUCT_NAME = dupeGuru; }; diff --git a/dupeguru b/dupeguru index 245ed0d..ec62875 160000 --- a/dupeguru +++ b/dupeguru @@ -1 +1 @@ -Subproject commit 245ed0ddecd0fad4a8e8dab3be07d319c14b1514 +Subproject commit ec628751afa71b8c7da26e667d855d3176bb5c31 diff --git a/hscommon b/hscommon index 73e3a07..a56aee2 160000 --- a/hscommon +++ b/hscommon @@ -1 +1 @@ -Subproject commit 73e3a0716d397c85701fd15510ef755d3a2f3be8 +Subproject commit a56aee2f08becba9b968ff96caa3a7f6651a4c74