Browse Source

Fix some deprecation warnings update submodules

master
Andrew Senetar 3 months ago
parent
commit
2eada16210
No known key found for this signature in database GPG Key ID: FEB896EB6CF6254B
13 changed files with 67 additions and 47 deletions
  1. +3
    -3
      cocoa/AppDelegate.m
  2. +8
    -8
      cocoa/DeletionOptions.m
  3. +1
    -1
      cocoa/DirectoryPanel.m
  4. +2
    -2
      cocoa/ResultTable.m
  5. +15
    -15
      cocoa/ResultWindow.m
  6. +0
    -1
      cocoa/main.m
  7. +2
    -2
      cocoalib/NSEventAdditions.m
  8. +2
    -2
      cocoalib/NSImageAdditions.m
  9. +1
    -1
      cocoalib/ProgressController.m
  10. +2
    -2
      cocoalib/views/HSOutlineView.m
  11. +29
    -8
      dupeGuru.xcodeproj/project.pbxproj
  12. +1
    -1
      dupeguru
  13. +1
    -1
      hscommon

+ 3
- 3
cocoa/AppDelegate.m View File

@@ -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 {


+ 8
- 8
cocoa/DeletionOptions.m View File

@@ -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
@end

+ 1
- 1
cocoa/DirectoryPanel.m View File

@@ -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]];
}


+ 2
- 2
cocoa/ResultTable.m View File

@@ -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
@end

+ 15
- 15
cocoa/ResultWindow.m View File

@@ -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


+ 0
- 1
cocoa/main.m View File

@@ -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]);


+ 2
- 2
cocoalib/NSEventAdditions.m View File

@@ -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


+ 2
- 2
cocoalib/NSImageAdditions.m View File

@@ -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
@end

+ 1
- 1
cocoalib/ProgressController.m View File

@@ -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,


+ 2
- 2
cocoalib/views/HSOutlineView.m View File

@@ -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];
}
}



+ 29
- 8
dupeGuru.xcodeproj/project.pbxproj View File

@@ -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;
};


+ 1
- 1
dupeguru

@@ -1 +1 @@
Subproject commit 245ed0ddecd0fad4a8e8dab3be07d319c14b1514
Subproject commit ec628751afa71b8c7da26e667d855d3176bb5c31

+ 1
- 1
hscommon

@@ -1 +1 @@
Subproject commit 73e3a0716d397c85701fd15510ef755d3a2f3be8
Subproject commit a56aee2f08becba9b968ff96caa3a7f6651a4c74

Loading…
Cancel
Save