From c66bbbcc8a718c1d53d2df344313d8c422a1598d Mon Sep 17 00:00:00 2001 From: Sveinbjorn Thordarson Date: Sun, 19 Nov 2023 18:51:04 +0000 Subject: [PATCH] Bumped deployment target to 10.13 (2017), silenced or refactored deprecation warnings --- Sloth.xcodeproj/project.pbxproj | 4 ++-- TODO.md | 1 + resources/Info.plist | 2 +- resources/InfoPanel.xib | 42 ++++++++++++++++----------------- source/SlothController.m | 8 +++---- source/Util/Alerts.m | 6 ++--- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/Sloth.xcodeproj/project.pbxproj b/Sloth.xcodeproj/project.pbxproj index b2404ae..e8eb217 100644 --- a/Sloth.xcodeproj/project.pbxproj +++ b/Sloth.xcodeproj/project.pbxproj @@ -411,7 +411,7 @@ INFOPLIST_KEY_CFBundleDisplayName = Sloth; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INSTALL_PATH = ""; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 3.3; OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = org.sveinbjorn.Sloth; @@ -447,7 +447,7 @@ INFOPLIST_KEY_CFBundleDisplayName = Sloth; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INSTALL_PATH = ""; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 3.3; OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = org.sveinbjorn.Sloth; diff --git a/TODO.md b/TODO.md index 82a53c4..8483303 100644 --- a/TODO.md +++ b/TODO.md @@ -13,6 +13,7 @@ * "Copy" on app/process should copy filesystem representation if possible * Update antiquated screenshots in README * Upgrade Sparkle version +* Get contextual menu working properly in path bar (like in KatSearch) DONE * Always (re)select "General" tab when Preferences are shown DONE Show Path Control w. selected path at bottom of table view when item selected DONE * SIGTERM vs. SIGKILL diff --git a/resources/Info.plist b/resources/Info.plist index f493e79..5cd9de3 100644 --- a/resources/Info.plist +++ b/resources/Info.plist @@ -27,7 +27,7 @@ LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion - 10.11 + 10.13 NSHumanReadableCopyright © 2004-2023 Sveinbjorn Thordarson. NSMainNibFile diff --git a/resources/InfoPanel.xib b/resources/InfoPanel.xib index 4bff019..699bfa5 100644 --- a/resources/InfoPanel.xib +++ b/resources/InfoPanel.xib @@ -1,8 +1,8 @@ - + - + @@ -46,7 +46,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -118,7 +118,7 @@ - + @@ -127,7 +127,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -187,7 +187,7 @@ - + @@ -201,7 +201,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -219,7 +219,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -269,6 +269,6 @@ - + diff --git a/source/SlothController.m b/source/SlothController.m index 1f1eb2b..0cab6c5 100644 --- a/source/SlothController.m +++ b/source/SlothController.m @@ -646,8 +646,8 @@ - (IBAction)kill:(id)sender { int pid = [item[@"pid"] intValue]; // Confirm - BOOL optionKeyDown = (([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) == NSAlternateKeyMask); - BOOL ctrlKeyDown = (([[NSApp currentEvent] modifierFlags] & NSControlKeyMask) == NSControlKeyMask); + BOOL optionKeyDown = (([[NSApp currentEvent] modifierFlags] & NSEventModifierFlagOption) == NSEventModifierFlagOption); + BOOL ctrlKeyDown = (([[NSApp currentEvent] modifierFlags] & NSEventModifierFlagControl) == NSEventModifierFlagControl); BOOL useSigKill = (ctrlKeyDown || [DEFAULTS boolForKey:@"alwaysUseSigkill"]); if (optionKeyDown == NO) { NSString *p = [NSString stringWithFormat:@"Are you sure you want to kill “%@” (%d)?", item[@"pname"], pid]; @@ -699,7 +699,7 @@ - (IBAction)moveToTrash:(id)sender { NSDictionary *item = [[outlineView itemAtRow:selectedRow] representedObject]; NSString *path = item[@"path"] ? item[@"path"] : item[@"name"]; - BOOL optionKeyDown = (([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) == NSAlternateKeyMask); + BOOL optionKeyDown = (([[NSApp currentEvent] modifierFlags] & NSEventModifierFlagOption) == NSEventModifierFlagOption); if (!optionKeyDown) { // Ask user to confirm NSString *prompt = @"This will tell the Finder to move the specified file into your Trash folder. \ @@ -776,7 +776,7 @@ - (void)rowDoubleClicked:(id)object { NSInteger rowNumber = [outlineView clickedRow]; Item *item = [[outlineView itemAtRow:rowNumber] representedObject]; - BOOL cmdKeyDown = (([[NSApp currentEvent] modifierFlags] & NSCommandKeyMask) == NSCommandKeyMask); + BOOL cmdKeyDown = (([[NSApp currentEvent] modifierFlags] & NSEventModifierFlagCommand) == NSEventModifierFlagCommand); if (cmdKeyDown) { [self revealItemInFinder:item]; } else { diff --git a/source/Util/Alerts.m b/source/Util/Alerts.m index a462c94..7adf23f 100644 --- a/source/Util/Alerts.m +++ b/source/Util/Alerts.m @@ -51,11 +51,11 @@ + (void)alert:(NSString *)message subTextFormat:(NSString *)formatString, ... { } + (void)alert:(NSString *)message subText:(NSString *)subtext { - [self alert:message subText:subtext style:NSWarningAlertStyle]; + [self alert:message subText:subtext style:NSAlertStyleWarning]; } + (void)fatalAlert:(NSString *)message subText:(NSString *)subtext { - [self alert:message subText:subtext style:NSCriticalAlertStyle]; + [self alert:message subText:subtext style:NSAlertStyleCritical]; [[NSApplication sharedApplication] terminate:self]; } @@ -75,7 +75,7 @@ + (BOOL)proceedAlert:(NSString *)message subText:(NSString *)subtext withActionN [alert addButtonWithTitle:@"Cancel"]; [alert setMessageText:message]; [alert setInformativeText:subtext]; - [alert setAlertStyle:NSWarningAlertStyle]; + [alert setAlertStyle:NSAlertStyleWarning]; return ([alert runModal] == NSAlertFirstButtonReturn); }