From b21fd013da3a37814de41d8895e17a567451c064 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Thu, 9 Jan 2025 09:13:32 -0700 Subject: [PATCH 01/12] macos-12 runner is deprecated Follow `macos-latest`; if issues come up, can always temporarily pin to the latest working version --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c73d3e25..6ac5dc6d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ on: jobs: build: - runs-on: macos-12 + runs-on: macos-latest env: QS_DONT_SIGN: 1 steps: @@ -52,7 +52,7 @@ jobs: sign: needs: build - runs-on: macos-12 + runs-on: macos-latest if: startsWith(github.ref, 'refs/tags/v') env: MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} From a0acd728c6a9478700dd78e898adb0e8776e61f9 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Mon, 18 Nov 2024 07:05:47 -0700 Subject: [PATCH 02/12] Remove complex macros, which break compilation with Swift https://developer.apple.com/documentation/swift/using-imported-c-macros-in-swift#Use-Functions-and-Generics-Instead-of-Complex-Macros > C macros that are more complex than simple constant definitions have > no counterpart in Swift. You use complex macros in C and Objective-C > to avoid type-checking constraints or to avoid retyping large amounts > of boilerplate code. However, macros can make debugging and refactoring > difficult. In Swift, you can use functions and generics to achieve the > same results without any compromises. --- Quicksilver/Code-QuickStepCore/QSCatalogEntry.m | 2 +- Quicksilver/Code-QuickStepCore/QSCatalogEntry_Private.h | 2 +- Quicksilver/Code-QuickStepCore/QSLibrarian.h | 4 ++-- Quicksilver/Code-QuickStepCore/QSObject.h | 4 ++-- Quicksilver/Code-QuickStepCore/QSObjectHandler.h | 2 +- Quicksilver/Code-QuickStepCore/QSObjectRanker.h | 2 +- Quicksilver/Code-QuickStepCore/QSObjectSource.h | 6 +++--- Quicksilver/Code-QuickStepCore/QSProcessMonitor.h | 4 ++-- .../Code-QuickStepFoundation/NSString_BLTRExtensions.h | 2 +- .../Code-QuickStepFoundation/NSWorkspace_BLTRExtensions.h | 2 +- Quicksilver/Code-QuickStepFoundation/QSGCD.h | 4 ++-- Quicksilver/Code-QuickStepInterface/QSDockingWindow.h | 6 +++--- .../QSResizingInterfaceController.h | 2 +- Quicksilver/Code-QuickStepInterface/QSTableView.h | 8 ++++---- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m b/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m index b544a6b5f..8f0d6fee9 100644 --- a/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m +++ b/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m @@ -792,7 +792,7 @@ - (NSMutableDictionary *)sourceSettings { // Backward-compatibility -- (BOOL)deletable QS_DEPRECATED { return self.canBeDeleted; } +- (BOOL)deletable __attribute__((deprecated)) { return self.canBeDeleted; } @end diff --git a/Quicksilver/Code-QuickStepCore/QSCatalogEntry_Private.h b/Quicksilver/Code-QuickStepCore/QSCatalogEntry_Private.h index 3c9404cf8..9ea7cf51e 100644 --- a/Quicksilver/Code-QuickStepCore/QSCatalogEntry_Private.h +++ b/Quicksilver/Code-QuickStepCore/QSCatalogEntry_Private.h @@ -37,5 +37,5 @@ @end @interface QSCatalogEntry (OldStyleSourceSupport) -- (id)objectForKey:(NSString *)key QS_DEPRECATED_MSG("Sources now get QSCatalogEntry objects. Please use those"); +- (id)objectForKey:(NSString *)key __attribute__((deprecated("Sources now get QSCatalogEntry objects. Please use those"))); @end diff --git a/Quicksilver/Code-QuickStepCore/QSLibrarian.h b/Quicksilver/Code-QuickStepCore/QSLibrarian.h index 7fcbf1765..b980e273b 100644 --- a/Quicksilver/Code-QuickStepCore/QSLibrarian.h +++ b/Quicksilver/Code-QuickStepCore/QSLibrarian.h @@ -85,7 +85,7 @@ extern QSLibrarian *QSLib; // Shared Instance - (void)startThreadedAndForcedScan; - (IBAction)forceScanCatalog:(id)sender; - (IBAction)scanCatalog:(id)sender; -- (void)scanCatalogWithDelay:(id)sender QS_DEPRECATED; +- (void)scanCatalogWithDelay:(id)sender __attribute__((deprecated)); - (BOOL)itemIsOmitted:(QSBasicObject *)item; - (void)setItem:(QSBasicObject *)item isOmitted:(BOOL)omit; #ifdef DEBUG @@ -93,7 +93,7 @@ extern QSLibrarian *QSLib; // Shared Instance - (NSMutableArray *)scoreTest:(id)sender; #endif - (NSMutableArray *)scoredArrayForString:(NSString *)string; -- (NSMutableArray *)scoredArrayForString:(NSString *)string inNamedSet:(NSString *)setName QS_DEPRECATED; +- (NSMutableArray *)scoredArrayForString:(NSString *)string inNamedSet:(NSString *)setName __attribute__((deprecated)); - (NSMutableArray *)scoredArrayForString:(NSString *)searchString inSet:(id)set; - (NSMutableArray *)scoredArrayForString:(NSString *)searchString inSet:(NSArray *)set mnemonicsOnly:(BOOL)mnemonicsOnly; - (NSMutableArray *)shelfNamed:(NSString *)shelfName; diff --git a/Quicksilver/Code-QuickStepCore/QSObject.h b/Quicksilver/Code-QuickStepCore/QSObject.h index d8ae0dc97..c1ba6d298 100644 --- a/Quicksilver/Code-QuickStepCore/QSObject.h +++ b/Quicksilver/Code-QuickStepCore/QSObject.h @@ -73,7 +73,7 @@ typedef struct _QSObjectFlags { + (void)interfaceChanged; + (id)objectWithName:(NSString *)aName; -+ (id)objectWithIdentifier:(NSString *)anIdentifier QS_DEPRECATED; ++ (id)objectWithIdentifier:(NSString *)anIdentifier __attribute__((deprecated)); + (id)makeObjectWithIdentifier:(NSString *)anIdentifier; + (id)objectByMergingObjects:(NSArray *)objects; + (id)objectByMergingObjects:(NSArray *)objects withObject:(QSObject *)object; @@ -119,7 +119,7 @@ typedef struct _QSObjectFlags { - (BOOL)unloadIcon; - (NSImage *)icon; - (void)setIcon:(NSImage *)newIcon; -- (void)updateIcon:(NSImage *)newIcon QS_DEPRECATED_MSG("Use -setIcon:"); +- (void)updateIcon:(NSImage *)newIcon __attribute__((deprecated("Use -setIcon:"))); @end @interface QSObject (Hierarchy) diff --git a/Quicksilver/Code-QuickStepCore/QSObjectHandler.h b/Quicksilver/Code-QuickStepCore/QSObjectHandler.h index 072ffd744..5c269eb95 100644 --- a/Quicksilver/Code-QuickStepCore/QSObjectHandler.h +++ b/Quicksilver/Code-QuickStepCore/QSObjectHandler.h @@ -38,7 +38,7 @@ - (NSAppleEventDescriptor *)AEDescriptorForObject:(QSObject *)object; -- (QSObject *)initFileObject:(QSObject *)object ofType:(NSString *)type QS_DEPRECATED NS_RETURNS_NOT_RETAINED; +- (QSObject *)initFileObject:(QSObject *)object ofType:(NSString *)type __attribute__((deprecated)) NS_RETURNS_NOT_RETAINED; @end diff --git a/Quicksilver/Code-QuickStepCore/QSObjectRanker.h b/Quicksilver/Code-QuickStepCore/QSObjectRanker.h index 4ae894789..14ae05a0d 100644 --- a/Quicksilver/Code-QuickStepCore/QSObjectRanker.h +++ b/Quicksilver/Code-QuickStepCore/QSObjectRanker.h @@ -26,7 +26,7 @@ extern NSString *QSRankingIncludeOmitted; // BOOL. Specifies whether the ranke - (NSString*)matchedStringForAbbreviation:(NSString*)anAbbreviation hitmask:(NSIndexSet **)hitmask inContext:(NSString *)context; @optional -- (QSRankedObject *)rankedObject:(QSBasicObject *)object forAbbreviation:(NSString*)anAbbreviation inContext:(NSString *)context withMnemonics:(NSArray *)mnemonics mnemonicsOnly:(BOOL)mnemonicsOnly QS_DEPRECATED; +- (QSRankedObject *)rankedObject:(QSBasicObject *)object forAbbreviation:(NSString*)anAbbreviation inContext:(NSString *)context withMnemonics:(NSArray *)mnemonics mnemonicsOnly:(BOOL)mnemonicsOnly __attribute__((deprecated)); @end diff --git a/Quicksilver/Code-QuickStepCore/QSObjectSource.h b/Quicksilver/Code-QuickStepCore/QSObjectSource.h index 7e8aa4644..0d78907cf 100644 --- a/Quicksilver/Code-QuickStepCore/QSObjectSource.h +++ b/Quicksilver/Code-QuickStepCore/QSObjectSource.h @@ -79,7 +79,7 @@ /* The following is deprecated because it duplicates -selection. * But it can't be removed because dyld will notice and plugins will fail to load */ - NSMutableDictionary *currentEntry QS_DEPRECATED; + NSMutableDictionary *currentEntry __attribute__((deprecated)); } - (void)invalidateSelf; @@ -102,7 +102,7 @@ // Please use -selectedEntry instead of those // The rational being that between -currentEntry, -selection and direct Ivar // everything can go wrong. -@property (retain) NSMutableDictionary *currentEntry QS_DEPRECATED; -@property (retain) QSCatalogEntry *selection QS_DEPRECATED; +@property (retain) NSMutableDictionary *currentEntry __attribute__((deprecated)); +@property (retain) QSCatalogEntry *selection __attribute__((deprecated)); @end diff --git a/Quicksilver/Code-QuickStepCore/QSProcessMonitor.h b/Quicksilver/Code-QuickStepCore/QSProcessMonitor.h index d9099c646..87819524d 100644 --- a/Quicksilver/Code-QuickStepCore/QSProcessMonitor.h +++ b/Quicksilver/Code-QuickStepCore/QSProcessMonitor.h @@ -24,8 +24,8 @@ - (NSArray *)backgroundProcesses; /* QSObjects */ /* Deprecated, equivalent to the above without KVO */ -- (NSArray *)getAllProcesses QS_DEPRECATED_MSG("Use -allProcesses"); -- (NSArray *)getVisibleProcesses QS_DEPRECATED_MSG("Use -visibleProcesses"); +- (NSArray *)getAllProcesses __attribute__((deprecated("Use -allProcesses"))); +- (NSArray *)getVisibleProcesses __attribute__((deprecated("Use -visibleProcesses"))); - (QSObject *)imbuedFileProcessForDict:(NSDictionary *)dict; - (BOOL)handleProcessEvent:(NSEvent *)theEvent; diff --git a/Quicksilver/Code-QuickStepFoundation/NSString_BLTRExtensions.h b/Quicksilver/Code-QuickStepFoundation/NSString_BLTRExtensions.h index 2edfdaa69..911dff19d 100644 --- a/Quicksilver/Code-QuickStepFoundation/NSString_BLTRExtensions.h +++ b/Quicksilver/Code-QuickStepFoundation/NSString_BLTRExtensions.h @@ -52,7 +52,7 @@ NSComparisonResult prefixCompare(NSString *aString, NSString *bString); @interface NSString (Replacement) - (NSArray *)lines; -- (NSString *)stringByReplacing:(NSString *)search with:(NSString *)replacement QS_DEPRECATED; +- (NSString *)stringByReplacing:(NSString *)search with:(NSString *)replacement __attribute__((deprecated)); @end diff --git a/Quicksilver/Code-QuickStepFoundation/NSWorkspace_BLTRExtensions.h b/Quicksilver/Code-QuickStepFoundation/NSWorkspace_BLTRExtensions.h index b6f905548..68593aa2b 100644 --- a/Quicksilver/Code-QuickStepFoundation/NSWorkspace_BLTRExtensions.h +++ b/Quicksilver/Code-QuickStepFoundation/NSWorkspace_BLTRExtensions.h @@ -25,7 +25,7 @@ - (void)reopenApplication:(NSDictionary *)theApp; - (void)quitApplication:(NSDictionary *)theApp; - (void)quitOtherApplications:(NSArray *)theApps; -- (NSDictionary *)dictForApplicationIdentifier:(NSString *)ident QS_DEPRECATED; +- (NSDictionary *)dictForApplicationIdentifier:(NSString *)ident __attribute__((deprecated)); - (NSString *)commentForFile:(NSString *)path; - (BOOL)setComment:(NSString*)comment forFile:(NSString *)path; - (BOOL)openFileInBackground:(NSString *)fullPath; diff --git a/Quicksilver/Code-QuickStepFoundation/QSGCD.h b/Quicksilver/Code-QuickStepFoundation/QSGCD.h index 795c238bc..3f22a7be6 100644 --- a/Quicksilver/Code-QuickStepFoundation/QSGCD.h +++ b/Quicksilver/Code-QuickStepFoundation/QSGCD.h @@ -66,7 +66,7 @@ inline void QSGCDDelayed(NSTimeInterval delay, void (^block)(void)) // Remove those when the plugins are call-free // Don't forget to remove definitions in .m file -void runOnMainQueueSync(void (^block)(void)) QS_DEPRECATED_MSG("Use QSGCDMainSync"); -void runOnQueueSync(dispatch_queue_t queue, void (^block)(void)) QS_DEPRECATED_MSG("Use QSGCDQueueSync"); +void runOnMainQueueSync(void (^block)(void)) __attribute__((deprecated("Use QSGCDMainSync"))); +void runOnQueueSync(dispatch_queue_t queue, void (^block)(void)) __attribute__((deprecated("Use QSGCDQueueSync"))); #endif // __QSGCD__ diff --git a/Quicksilver/Code-QuickStepInterface/QSDockingWindow.h b/Quicksilver/Code-QuickStepInterface/QSDockingWindow.h index e772d37e6..549bb80f3 100644 --- a/Quicksilver/Code-QuickStepInterface/QSDockingWindow.h +++ b/Quicksilver/Code-QuickStepInterface/QSDockingWindow.h @@ -45,10 +45,10 @@ @result YES if window is hidden into the screen edge, otherwise NO */ - (BOOL)isDocked; -- (BOOL)canFade QS_DEPRECATED_MSG("Use -isDockedInstead"); +- (BOOL)canFade __attribute__((deprecated("Use -isDockedInstead"))); -- (NSString *)autosaveName QS_DEPRECATED_MSG("Use -NSWindow frameAutosaveName or -NSWindowController windowFrameAutosaveName"); -- (void)setAutosaveName:(NSString *)newAutosaveName QS_DEPRECATED_MSG("Use -NSWindow frameAutosaveName or -NSWindowController windowFrameAutosaveName");; +- (NSString *)autosaveName __attribute__((deprecated("Use -NSWindow frameAutosaveName or -NSWindowController windowFrameAutosaveName"))); +- (void)setAutosaveName:(NSString *)newAutosaveName __attribute__((deprecated("Use -NSWindow frameAutosaveName or -NSWindowController windowFrameAutosaveName")));; - (void)resignKeyWindowNow; - (IBAction)orderFrontHidden:(id)sender; - (void)saveFrame; diff --git a/Quicksilver/Code-QuickStepInterface/QSResizingInterfaceController.h b/Quicksilver/Code-QuickStepInterface/QSResizingInterfaceController.h index 2767fedb8..b3e07a7da 100644 --- a/Quicksilver/Code-QuickStepInterface/QSResizingInterfaceController.h +++ b/Quicksilver/Code-QuickStepInterface/QSResizingInterfaceController.h @@ -7,7 +7,7 @@ BOOL expanded; } - (void)firstResponderChanged:(NSResponder *)aResponder; -- (void)resetAdjustTimer QS_DEPRECATED_MSG("Use -adjustWindow:"); +- (void)resetAdjustTimer __attribute__((deprecated("Use -adjustWindow:"))); - (void)expandWindow:(id)sender; - (void)contractWindow:(id)sender; diff --git a/Quicksilver/Code-QuickStepInterface/QSTableView.h b/Quicksilver/Code-QuickStepInterface/QSTableView.h index cc7386b36..cd7d2fb2e 100644 --- a/Quicksilver/Code-QuickStepInterface/QSTableView.h +++ b/Quicksilver/Code-QuickStepInterface/QSTableView.h @@ -9,14 +9,14 @@ - (BOOL)tableView:(QSTableView *)aTableView shouldDrawRow:(NSInteger)rowIndex inClipRect:(NSRect)clipRect; - (BOOL)tableView:(QSTableView *)aTableView rowIsSeparator:(NSInteger)rowIndex; - (NSMenu *)tableView:(QSTableView*)tableView menuForTableColumn:(NSTableColumn *)column row:(NSInteger)row; -- (void)tableView:(QSTableView *)tv dropEndedWithOperation:(NSDragOperation)operation QS_DEPRECATED_MSG("It has neved been called on the delegate"); +- (void)tableView:(QSTableView *)tv dropEndedWithOperation:(NSDragOperation)operation __attribute__((deprecated("It has neved been called on the delegate"))); - (void)drawSeparatorForRow:(NSInteger)rowIndex clipRect:(NSRect)clipRect; @end @protocol QSTableViewDataSource @optional -- (void)tableView:(QSTableView *)aTableView dropEndedWithOperation:(NSDragOperation)operation QS_DEPRECATED_MSG("Use -tableView:draggingSession:... and friends"); +- (void)tableView:(QSTableView *)aTableView dropEndedWithOperation:(NSDragOperation)operation __attribute__((deprecated("Use -tableView:draggingSession:... and friends"))); @end @interface QSTableView : NSTableView { @@ -30,8 +30,8 @@ - (NSColor *)highlightColor; - (void)setHighlightColor:(NSColor *)aHighlightColor; -- (id)draggingDelegate QS_DEPRECATED_MSG("Use -tableView:draggingSession:... and friends"); -- (void)setDraggingDelegate:(id)aDraggingDelegate QS_DEPRECATED_MSG("Use -tableView:draggingSession:... and friends");; +- (id)draggingDelegate __attribute__((deprecated("Use -tableView:draggingSession:... and friends"))); +- (void)setDraggingDelegate:(id)aDraggingDelegate __attribute__((deprecated("Use -tableView:draggingSession:... and friends")));; - (void)setOpaque:(BOOL)flag; - (id )delegate; - (id )dataSource; From 43f91d80741b5fcbe642bf090e31e311ff533471 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Tue, 10 Dec 2024 20:18:24 -0700 Subject: [PATCH 03/12] Remove complex macros, which are incompatible with Swift https://developer.apple.com/documentation/swift/using-imported-c-macros-in-swift#Use-Functions-and-Generics-Instead-of-Complex-Macros --- Quicksilver/Code-App/QSController.m | 2 +- Quicksilver/Code-App/QSHelpersPrefPane.m | 6 +++++- Quicksilver/Code-App/QSMainPreferencePanes.m | 5 ++++- Quicksilver/Code-App/QSPreferencesController.m | 2 +- Quicksilver/Code-App/QSSetupAssistant.m | 2 +- Quicksilver/Code-QuickStepCore/QSObject.h | 2 -- Quicksilver/Code-QuickStepCore/QSObject.m | 6 +++--- Quicksilver/Code-QuickStepCore/QSObject_Pasteboard.m | 8 ++++---- Quicksilver/Code-QuickStepCore/QSPlugIn.m | 5 ++++- Quicksilver/Code-QuickStepCore/QSSwiftObj.swift | 8 ++++++++ Quicksilver/Code-QuickStepCore/QSTrigger.m | 3 ++- Quicksilver/Code-QuickStepCore/QSTriggerCenter.m | 5 ++++- Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m | 2 +- .../PrimerInterface/QSPrimerInterfaceController.m | 2 +- 14 files changed, 39 insertions(+), 19 deletions(-) create mode 100644 Quicksilver/Code-QuickStepCore/QSSwiftObj.swift diff --git a/Quicksilver/Code-App/QSController.m b/Quicksilver/Code-App/QSController.m index ad182b89d..32e1adf48 100644 --- a/Quicksilver/Code-App/QSController.m +++ b/Quicksilver/Code-App/QSController.m @@ -86,7 +86,7 @@ + (void)initialize { [QSVoyeur sharedInstance]; #ifdef DEBUG - if (defaultBool(@"verbose") ) + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"verbose"]) setenv("verbose", "1", YES); #endif diff --git a/Quicksilver/Code-App/QSHelpersPrefPane.m b/Quicksilver/Code-App/QSHelpersPrefPane.m index e24cfbb45..bdd6f7ca2 100644 --- a/Quicksilver/Code-App/QSHelpersPrefPane.m +++ b/Quicksilver/Code-App/QSHelpersPrefPane.m @@ -96,7 +96,11 @@ - (NSString *)mainNibName { return @"QSHelpersPrefPane"; } - (void)reloadHelpersList:(id)sender { NSMutableArray *helpers = [NSMutableArray array]; - foreachkey(key, header, [QSReg tableNamed:@"QSRegistryHeaders"]) { + + id header = nil; + NSString *key = nil; + NSEnumerator *kEnum = [[QSReg tableNamed:@"QSRegistryHeaders"] keyEnumerator]; + while((key = [kEnum nextObject]) && (header = [[QSReg tableNamed:@"QSRegistryHeaders"] objectForKey:key]) ) { if ([[header objectForKey:@"type"] isEqual:@"mediator"]) { NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObject:header forKey:INFO]; NSMenu *menu = [self menuForTable:key includeDefault:[[header objectForKey:@"allowDefault"] boolValue]]; diff --git a/Quicksilver/Code-App/QSMainPreferencePanes.m b/Quicksilver/Code-App/QSMainPreferencePanes.m index 3a8381048..d4c64d20a 100644 --- a/Quicksilver/Code-App/QSMainPreferencePanes.m +++ b/Quicksilver/Code-App/QSMainPreferencePanes.m @@ -466,7 +466,10 @@ - (void)updateGroups { break; } case 1: { - foreachkey(pluginId, plugin, [[QSPlugInManager sharedInstance] loadedPlugIns]) { + id plugin = nil; + NSString *pluginId = nil; + NSEnumerator *kEnum = [[[QSPlugInManager sharedInstance] loadedPlugIns] keyEnumerator]; + while((pluginId = [kEnum nextObject]) && (plugin = [[[QSPlugInManager sharedInstance] loadedPlugIns] objectForKey:pluginId]) ) { NSString *name = [plugin shortName]; if (!name) name = [plugin identifier]; NSArray *actionsArray = [QSExec getArrayForSource:[plugin identifier]]; diff --git a/Quicksilver/Code-App/QSPreferencesController.m b/Quicksilver/Code-App/QSPreferencesController.m index 00c27a11e..923d45650 100755 --- a/Quicksilver/Code-App/QSPreferencesController.m +++ b/Quicksilver/Code-App/QSPreferencesController.m @@ -243,7 +243,7 @@ - (void)windowDidLoad { // [toolbar performSelector:@selector(setSelectedItemIdentifier:) withObject:[[toolbarTabView selectedTabViewItem] identifier]]; [win setToolbar:toolbar]; - if (defaultBool(@"QSSkipGuide") ) { + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"QSSkipGuide"] ) { [self selectPaneWithIdentifier:@"QSSettingsPanePlaceholder"]; } else { [toolbar setSelectedItemIdentifier:@"QSMainMenuPrefPane"]; diff --git a/Quicksilver/Code-App/QSSetupAssistant.m b/Quicksilver/Code-App/QSSetupAssistant.m index be1c991be..7dae9c250 100644 --- a/Quicksilver/Code-App/QSSetupAssistant.m +++ b/Quicksilver/Code-App/QSSetupAssistant.m @@ -136,7 +136,7 @@ - (void)run:(id)sender { } - (BOOL)windowShouldClose:(id)sender { - if (!defaultBool(@"QSAgreementAccepted") ) { + if (![[NSUserDefaults standardUserDefaults] boolForKey:@"QSAgreementAccepted"] ) { QSAlertResponse response = [NSAlert runAlertWithTitle:NSLocalizedString(@"Cancel Setup", @"Setup assistant - Cancel alert title") message:NSLocalizedString(@"Would you like to stop setup and quit Quicksilver?", @"Setup assistant - Cancel alert message") buttons:@[NSLocalizedString(@"Quit", nil), NSLocalizedString(@"Cancel", nil)] diff --git a/Quicksilver/Code-QuickStepCore/QSObject.h b/Quicksilver/Code-QuickStepCore/QSObject.h index c1ba6d298..1d70cdd7c 100644 --- a/Quicksilver/Code-QuickStepCore/QSObject.h +++ b/Quicksilver/Code-QuickStepCore/QSObject.h @@ -7,8 +7,6 @@ extern NSSize QSMaxIconSize; -#define itemForKey(k) [data objectForKey:k] - // meta dictionary keys #define kQSObjectPrimaryName @"QSObjectName" #define kQSObjectAlternateName @"QSObjectLabel" diff --git a/Quicksilver/Code-QuickStepCore/QSObject.m b/Quicksilver/Code-QuickStepCore/QSObject.m index 9f345639e..138e4417e 100644 --- a/Quicksilver/Code-QuickStepCore/QSObject.m +++ b/Quicksilver/Code-QuickStepCore/QSObject.m @@ -396,14 +396,14 @@ - (NSString *)details { [self setObject:details forMeta:kQSObjectDetails]; } else if ([self stringValue]) { details = [self stringValue]; - } else if ([itemForKey([self primaryType]) isKindOfClass:[NSString class]]) { - details = itemForKey([self primaryType]); + } else if ([[data objectForKey:[self primaryType]] isKindOfClass:[NSString class]]) { + details = [data objectForKey:[self primaryType]]; } return details; } -- (id)primaryObject {return itemForKey([self primaryType]);} +- (id)primaryObject {return [data objectForKey:[self primaryType]];} //- (id)objectForKey:(id)aKey {return [data objectForKey:aKey];} //- (void)setObject:(id)object forKey:(id)aKey {[data setObject:object forKey:aKey];} diff --git a/Quicksilver/Code-QuickStepCore/QSObject_Pasteboard.m b/Quicksilver/Code-QuickStepCore/QSObject_Pasteboard.m index 1e61b62e5..8ce367074 100644 --- a/Quicksilver/Code-QuickStepCore/QSObject_Pasteboard.m +++ b/Quicksilver/Code-QuickStepCore/QSObject_Pasteboard.m @@ -166,14 +166,14 @@ - (id)initWithClipping:(NSString *)clippingFile { } - (void)guessName { - if (itemForKey(QSFilePathType) ) { + if ([data objectForKey:QSFilePathType]) { [self setPrimaryType:QSFilePathType]; [self getNameFromFiles]; } else { - NSString *textString = itemForKey(QSTextType); + NSString *textString = [data objectForKey:QSTextType]; // some objects (images from the web) don't have a text string but have a URL if (!textString) { - textString = itemForKey(NSURLPboardType); + textString = [data objectForKey:NSURLPboardType]; } textString = [textString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; @@ -206,7 +206,7 @@ - (void)guessName { } for (NSString *key in keys) { - if (itemForKey(key) ) { + if ([data objectForKey:key] ) { if ([key isEqualToString:QSTextType]) { [self setDetails:nil]; } else { diff --git a/Quicksilver/Code-QuickStepCore/QSPlugIn.m b/Quicksilver/Code-QuickStepCore/QSPlugIn.m index f3f982d41..b596c43e2 100644 --- a/Quicksilver/Code-QuickStepCore/QSPlugIn.m +++ b/Quicksilver/Code-QuickStepCore/QSPlugIn.m @@ -730,7 +730,10 @@ - (BOOL)_registerPlugIn { id value; id handler; - foreachkey(key, handlerClass, [QSReg tableNamed:kQSPlugInInfoHandlers]) { + id handlerClass = nil; + NSString *key = nil; + NSEnumerator *kEnum = [[QSReg tableNamed:kQSPlugInInfoHandlers] keyEnumerator]; + while((key = [kEnum nextObject]) && (handlerClass = [[QSReg tableNamed:kQSPlugInInfoHandlers] objectForKey:key]) ) { value = [bundle dictionaryForFileOrPlistKey:key]; if (!value) continue; //NSLog(@"----> Registering %@ for %@", key, [self name]); diff --git a/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift b/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift new file mode 100644 index 000000000..896c784db --- /dev/null +++ b/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift @@ -0,0 +1,8 @@ +// +// QSSwiftObj.swift +// QuickStep Core +// +// Created by Nathan Henrie on 2024-11-08. +// + +// import Foundation diff --git a/Quicksilver/Code-QuickStepCore/QSTrigger.m b/Quicksilver/Code-QuickStepCore/QSTrigger.m index c7ece562d..2cacb949b 100644 --- a/Quicksilver/Code-QuickStepCore/QSTrigger.m +++ b/Quicksilver/Code-QuickStepCore/QSTrigger.m @@ -175,7 +175,8 @@ - (BOOL)execute { [self setEnabled:NO]; } }; - if (defaultBool(kExecuteInThread) && [cmd canThread]) { +// defaultBool(x) [[NSUserDefaults standardUserDefaults] boolForKey:x] + if ([[NSUserDefaults standardUserDefaults] boolForKey:kExecuteInThread] && [cmd canThread]) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), block); } else { block(); diff --git a/Quicksilver/Code-QuickStepCore/QSTriggerCenter.m b/Quicksilver/Code-QuickStepCore/QSTriggerCenter.m index ec55e0a0d..12f7d595b 100644 --- a/Quicksilver/Code-QuickStepCore/QSTriggerCenter.m +++ b/Quicksilver/Code-QuickStepCore/QSTriggerCenter.m @@ -131,7 +131,10 @@ - (NSArray *)triggersWithIDs:(NSArray *)idents { - (NSArray *)triggersWithParentID:(NSString *)ident { NSMutableArray *array = [NSMutableArray array]; - foreachkey(key, trigger, triggersDict) { + id trigger = nil; + NSString *key = nil; + NSEnumerator *kEnum = [triggersDict keyEnumerator]; + while((key = [kEnum nextObject]) && (trigger = [triggersDict objectForKey:key]) ) { if ([[trigger parentID] isEqualToString:ident]) [array addObject:trigger]; } diff --git a/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m b/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m index fb4f96f30..c84953929 100644 --- a/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m +++ b/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m @@ -1485,7 +1485,7 @@ - (IBAction)dropClipboard:(id)sender { #pragma mark NSResponder Key Bindings - (void)deleteBackward:(id)sender { if ([[self partialString] length] > 0 || matchedString) { - if (defaultBool(kDoubleDeleteClearsObject)) { + if ([[NSUserDefaults standardUserDefaults] boolForKey:kDoubleDeleteClearsObject]) { // option to have delete clear the entire search string [self clearSearch]; [self clearTextView]; diff --git a/Quicksilver/PlugIns-Main/PrimerInterface/QSPrimerInterfaceController.m b/Quicksilver/PlugIns-Main/PrimerInterface/QSPrimerInterfaceController.m index 9d9ad4fbf..8a022bb08 100644 --- a/Quicksilver/PlugIns-Main/PrimerInterface/QSPrimerInterfaceController.m +++ b/Quicksilver/PlugIns-Main/PrimerInterface/QSPrimerInterfaceController.m @@ -78,7 +78,7 @@ - (void)showMainWindow:(id)sender { frame = constrainRectToRect(frame, [[[self window] screen] frame]); [[self window] setFrame:frame display:YES]; - if (defaultBool(@"QSAlwaysCenterInterface") ) { + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"QSAlwaysCenterInterface"] ) { NSRect frame = [[self window] frame]; frame = centerRectInRect(frame, [[[self window] screen] frame]); [[self window] setFrame:frame display:YES]; From 1ea9d3d6707e598a50a1b63b1a6b878f31297910 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Tue, 10 Dec 2024 20:20:56 -0700 Subject: [PATCH 04/12] Add missing imports --- Quicksilver/Code-QuickStepCore/QSLibrarian.h | 1 + Quicksilver/Code-QuickStepCore/QSObject.h | 1 + Quicksilver/Code-QuickStepCore/QSProcessMonitor.h | 1 + 3 files changed, 3 insertions(+) diff --git a/Quicksilver/Code-QuickStepCore/QSLibrarian.h b/Quicksilver/Code-QuickStepCore/QSLibrarian.h index b980e273b..787f2e7c7 100644 --- a/Quicksilver/Code-QuickStepCore/QSLibrarian.h +++ b/Quicksilver/Code-QuickStepCore/QSLibrarian.h @@ -1,5 +1,6 @@ #import #import "QSCatalogEntry.h" +#import "QSThreadSafeMutableDictionary.h" #define kCustomCatalogID @"QSCatalogCustom" diff --git a/Quicksilver/Code-QuickStepCore/QSObject.h b/Quicksilver/Code-QuickStepCore/QSObject.h index 1d70cdd7c..db6b61c0d 100644 --- a/Quicksilver/Code-QuickStepCore/QSObject.h +++ b/Quicksilver/Code-QuickStepCore/QSObject.h @@ -2,6 +2,7 @@ #import #import +#import "QSThreadSafeMutableDictionary.h" @class QSObject, QSBasicObject; diff --git a/Quicksilver/Code-QuickStepCore/QSProcessMonitor.h b/Quicksilver/Code-QuickStepCore/QSProcessMonitor.h index 87819524d..1c4b100ab 100644 --- a/Quicksilver/Code-QuickStepCore/QSProcessMonitor.h +++ b/Quicksilver/Code-QuickStepCore/QSProcessMonitor.h @@ -1,6 +1,7 @@ #import +#import #define kQSShowBackgroundProcesses @"QSShowBackgroundProcesses" From c124ce7996c13209dc76d771d068b315f9c05930 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Tue, 10 Dec 2024 20:23:26 -0700 Subject: [PATCH 05/12] Add blank swift file --- Quicksilver/Code-QuickStepCore/QSSwiftObj.swift | 2 +- Quicksilver/Quicksilver.xcodeproj/project.pbxproj | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift b/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift index 896c784db..8670355b2 100644 --- a/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift +++ b/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift @@ -5,4 +5,4 @@ // Created by Nathan Henrie on 2024-11-08. // -// import Foundation + import Foundation diff --git a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj index a95db6c52..be82149d2 100644 --- a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj +++ b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj @@ -174,6 +174,7 @@ 4DFE7DD40E08219C000B9AA3 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97324FDCFA39411CA2CEA /* AppKit.framework */; }; 4DFE7DDA0E0821C0000B9AA3 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 6008C51F2AAF433900512CB2 /* QSPathsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6008C51E2AAF433900512CB2 /* QSPathsTests.m */; }; + 604EAB052CDE5B1E005B3451 /* QSSwiftObj.swift in Sources */ = {isa = PBXBuildFile; fileRef = 604EAB042CDE5B1E005B3451 /* QSSwiftObj.swift */; }; 60FCBED82844C9770091AB6B /* OSAKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 60FCBED02844C9770091AB6B /* OSAKit.framework */; }; 6535A91A1086EF4D009D5C90 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6535A9191086EF4D009D5C90 /* Localizable.strings */; }; 6535A98A1086F627009D5C90 /* About.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6535A9891086F627009D5C90 /* About.strings */; }; @@ -1231,6 +1232,7 @@ 4DFE7DAD0E081BFD000B9AA3 /* QuickLook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickLook.framework; path = /System/Library/Frameworks/QuickLook.framework; sourceTree = ""; }; 6008C51E2AAF433900512CB2 /* QSPathsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QSPathsTests.m; sourceTree = ""; }; 600950BC2ABB76AF00F67DEB /* QSCorePlugIn-Info-Testing.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "QSCorePlugIn-Info-Testing.plist"; sourceTree = ""; }; + 604EAB042CDE5B1E005B3451 /* QSSwiftObj.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QSSwiftObj.swift; sourceTree = ""; }; 60FCBED02844C9770091AB6B /* OSAKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OSAKit.framework; path = System/Library/Frameworks/OSAKit.framework; sourceTree = SDKROOT; }; 6535A8DE1086EF23009D5C90 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = en.lproj/Localizable.strings; sourceTree = ""; }; 6535A91C1086EF5F009D5C90 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = de.lproj/Localizable.strings; sourceTree = ""; }; @@ -3632,6 +3634,7 @@ E1E5FB9407B20DD20044D6EF /* QSObjCMessageSource.m */, E1E5FB9507B20DD20044D6EF /* QSObject.h */, E1E5FB9607B20DD20044D6EF /* QSObject.m */, + 604EAB042CDE5B1E005B3451 /* QSSwiftObj.swift */, 7F24E8B507EDC67D00943D5A /* QSObject_AEConversion.h */, 7F24E8B607EDC67D00943D5A /* QSObject_AEConversion.m */, E1E5FB9707B20DD20044D6EF /* QSObject_Drag.h */, @@ -4399,6 +4402,9 @@ CD61BBB7192B18FA00040609 = { TestTargetID = 8D1107260486CEB800E47090; }; + E103F15F0647200700447FE0 = { + LastSwiftMigration = 1610; + }; }; }; buildConfigurationList = 7F6B3E7C085CE68E000735A8 /* Build configuration list for PBXProject "Quicksilver" */; @@ -5072,6 +5078,7 @@ E1E5FC3807B20DD20044D6EF /* QSTypes.m in Sources */, 7FB37EB5080997EF00A2B2B4 /* QSURLDownloadWrapper.m in Sources */, E1E5FC3A07B20DD20044D6EF /* QSVoyeur.m in Sources */, + 604EAB052CDE5B1E005B3451 /* QSSwiftObj.swift in Sources */, D493990E1350078E00B908C6 /* QSDownloads.m in Sources */, CD1B17D9158A573000E4A030 /* VDKQueue.m in Sources */, D413173015DEE5D90021479B /* LaunchAtLoginController.m in Sources */, From 428afb1000b89f7dc653c33ea584918eaaf79095 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Sun, 15 Dec 2024 08:03:55 -0700 Subject: [PATCH 06/12] Use Swift 6.0 --- Quicksilver/Quicksilver.xcodeproj/project.pbxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj index be82149d2..30b2a9b03 100644 --- a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj +++ b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj @@ -6340,6 +6340,7 @@ GCC_PREFIX_HEADER = "$(SRCROOT)/Configuration/Quicksilver.pch"; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = TESTING; ONLY_ACTIVE_ARCH = YES; + SWIFT_VERSION = 6.0; }; name = Testing; }; @@ -7055,6 +7056,7 @@ GCC_NO_COMMON_BLOCKS = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Configuration/Quicksilver.pch"; ONLY_ACTIVE_ARCH = YES; + SWIFT_VERSION = 6.0; }; name = Debug; }; @@ -7079,6 +7081,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Configuration/Quicksilver.pch"; + SWIFT_VERSION = 6.0; }; name = Release; }; From d2a89d0b162de367fc5f49f5ecdfdd1bdd8b5751 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Sun, 15 Dec 2024 08:29:54 -0700 Subject: [PATCH 07/12] Fix minimum version message and https URL --- Quicksilver/Code-App/QSController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Quicksilver/Code-App/QSController.m b/Quicksilver/Code-App/QSController.m index 32e1adf48..2400484f3 100644 --- a/Quicksilver/Code-App/QSController.m +++ b/Quicksilver/Code-App/QSController.m @@ -49,8 +49,8 @@ + (void)initialize { if (![NSApplication isMavericks]) { NSBundle *appBundle = [NSBundle mainBundle]; - NSString *minimumVersionString = @"macOS 10.9+"; - NSString *oldVersionsString = @"10.3–10.8"; + NSString *minimumVersionString = @"macOS 10.14+"; + NSString *oldVersionsString = @"10.14"; NSAlert *alert = [[NSAlert alloc] init]; alert.messageText = [NSString stringWithFormat: @@ -60,7 +60,7 @@ + (void)initialize { minimumVersionString ]; alert.informativeText = [NSString stringWithFormat: - NSLocalizedString(@"Recent versions of Quicksilver require %@. Older %@ compatible versions are available from the http://qsapp.com/download.php", @"macOS version required alert message"), + NSLocalizedString(@"Recent versions of Quicksilver require %@. Older %@ compatible versions are available from the https://qsapp.com/download.php", @"macOS version required alert message"), minimumVersionString, oldVersionsString]; [alert addButtonWithTitle:NSLocalizedString(@"OK", nil)]; From 4c02f2c6fd28d7c137d5d289d509e134fa878e16 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Sun, 15 Dec 2024 08:30:07 -0700 Subject: [PATCH 08/12] Remove outdated version target --- Quicksilver/Quicksilver.xcodeproj/project.pbxproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj index 30b2a9b03..78b778773 100644 --- a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj +++ b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj @@ -6633,7 +6633,6 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "Quicksilver Tests/Quicksilver Tests-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = "com.qsapp.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; @@ -7225,7 +7224,6 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "Quicksilver Tests/Quicksilver Tests-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = "com.qsapp.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; @@ -7266,7 +7264,6 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "Quicksilver Tests/Quicksilver Tests-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = "com.qsapp.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; From 142dcb42e38a41a66ef96dc66cda5f752684bb43 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Thu, 9 Jan 2025 08:26:56 -0700 Subject: [PATCH 09/12] Add bare minimum to run swift from objc --- Quicksilver/Code-QuickStepCore/QSObject.m | 5 +++++ Quicksilver/Code-QuickStepCore/QSSwiftObj.swift | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/Quicksilver/Code-QuickStepCore/QSObject.m b/Quicksilver/Code-QuickStepCore/QSObject.m index 138e4417e..94b375b8b 100644 --- a/Quicksilver/Code-QuickStepCore/QSObject.m +++ b/Quicksilver/Code-QuickStepCore/QSObject.m @@ -3,6 +3,8 @@ #import "QSDebug.h" #import "QSObjectHandler.h" +#import + static NSMutableSet *iconLoadedSet; static NSMutableSet *childLoadedSet; @@ -13,6 +15,9 @@ @implementation QSObject + (void)initialize { if (!QSObjectInitialized) { + QSSwiftObj *swiftobj = [[QSSwiftObj alloc] init]; + [swiftobj sayHello]; + QSMaxIconSize = QSSizeMax; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(interfaceChanged) name:QSInterfaceChangedNotification object:nil]; diff --git a/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift b/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift index 8670355b2..f5e301c27 100644 --- a/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift +++ b/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift @@ -6,3 +6,10 @@ // import Foundation + +public class QSSwiftObj: NSObject { + @objc public func sayHello() { + print("Hello from Swift") + } +} + From bf3255674d72e400ccd0aebc19a0db9473c48c13 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Thu, 9 Jan 2025 10:46:54 -0700 Subject: [PATCH 10/12] Swift 6.0 not avail in GHA runners at this point (xcode 15), stick to swift 5 for now --- Quicksilver/Quicksilver.xcodeproj/project.pbxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj index 78b778773..c7703ba6c 100644 --- a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj +++ b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj @@ -6434,6 +6434,7 @@ INSTALL_PATH = "@executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.blacktree.QSCore; PRODUCT_NAME = QSCore; + SWIFT_VERSION = 5.0; }; name = Testing; }; @@ -6842,6 +6843,7 @@ INSTALL_PATH = "@executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.blacktree.QSCore; PRODUCT_NAME = QSCore; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -6858,6 +6860,7 @@ INSTALL_PATH = "@executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.blacktree.QSCore; PRODUCT_NAME = QSCore; + SWIFT_VERSION = 5.0; }; name = Release; }; From 362a32fa3ea929aae3f826f390bce70eb2f8f015 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Sat, 25 Jan 2025 18:38:10 -0700 Subject: [PATCH 11/12] Remove dummy Swift code --- Quicksilver/Code-QuickStepCore/QSObject.m | 3 --- Quicksilver/Code-QuickStepCore/QSSwiftObj.swift | 9 +-------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Quicksilver/Code-QuickStepCore/QSObject.m b/Quicksilver/Code-QuickStepCore/QSObject.m index 94b375b8b..3f5cda3ad 100644 --- a/Quicksilver/Code-QuickStepCore/QSObject.m +++ b/Quicksilver/Code-QuickStepCore/QSObject.m @@ -15,9 +15,6 @@ @implementation QSObject + (void)initialize { if (!QSObjectInitialized) { - QSSwiftObj *swiftobj = [[QSSwiftObj alloc] init]; - [swiftobj sayHello]; - QSMaxIconSize = QSSizeMax; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(interfaceChanged) name:QSInterfaceChangedNotification object:nil]; diff --git a/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift b/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift index f5e301c27..0a8611c82 100644 --- a/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift +++ b/Quicksilver/Code-QuickStepCore/QSSwiftObj.swift @@ -5,11 +5,4 @@ // Created by Nathan Henrie on 2024-11-08. // - import Foundation - -public class QSSwiftObj: NSObject { - @objc public func sayHello() { - print("Hello from Swift") - } -} - +import Foundation From 502f0cd3d3fa320d6141600176ea743d5138e48b Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Wed, 29 Jan 2025 11:23:58 -0600 Subject: [PATCH 12/12] Pin to swift 5.0 as swift 6.0 not supported in GitHub Actions runners at this point --- Quicksilver/Quicksilver.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj index c7703ba6c..4afad869a 100644 --- a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj +++ b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj @@ -6340,7 +6340,7 @@ GCC_PREFIX_HEADER = "$(SRCROOT)/Configuration/Quicksilver.pch"; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = TESTING; ONLY_ACTIVE_ARCH = YES; - SWIFT_VERSION = 6.0; + SWIFT_VERSION = 5.0; }; name = Testing; }; @@ -7058,7 +7058,7 @@ GCC_NO_COMMON_BLOCKS = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Configuration/Quicksilver.pch"; ONLY_ACTIVE_ARCH = YES; - SWIFT_VERSION = 6.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -7083,7 +7083,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Configuration/Quicksilver.pch"; - SWIFT_VERSION = 6.0; + SWIFT_VERSION = 5.0; }; name = Release; };