Skip to content

Commit

Permalink
#3213: Switch to using SPMainQSync.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuconnolly committed Oct 11, 2018
1 parent 61c3aa1 commit 6bc8cd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Source/SPAlertSheets.m
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@


#import "SPAlertSheets.h" #import "SPAlertSheets.h"
#import "SPMainThreadTrampoline.h" #import "SPMainThreadTrampoline.h"
#import "SPFunctions.h"


@implementation SPAlertSheets @implementation SPAlertSheets


Expand Down Expand Up @@ -207,7 +208,7 @@ void SPBeginAlertSheet(
void *contextInfo, void *contextInfo,
NSString *msg) NSString *msg)
{ {
void (^alertBlock)(void) = ^{ SPMainQSync(^{
// Set up an NSAlert with the supplied details // Set up an NSAlert with the supplied details
NSAlert *alert = [[[NSAlert alloc] init] autorelease]; NSAlert *alert = [[[NSAlert alloc] init] autorelease];


Expand Down Expand Up @@ -236,12 +237,5 @@ void SPBeginAlertSheet(


// Ensure the alerting window is frontmost // Ensure the alerting window is frontmost
[docWindow makeKeyWindow]; [docWindow makeKeyWindow];
}; });

if (dispatch_get_current_queue() == dispatch_get_main_queue()) {
alertBlock();
}
else {
dispatch_sync(dispatch_get_main_queue(), alertBlock);
}
} }
2 changes: 2 additions & 0 deletions sequel-pro.xcodeproj/project.pbxproj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
17D3C66E128AD4710047709F /* SPFavoritesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D3C66D128AD4710047709F /* SPFavoritesController.m */; }; 17D3C66E128AD4710047709F /* SPFavoritesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D3C66D128AD4710047709F /* SPFavoritesController.m */; };
17D3C671128AD8160047709F /* SPSingleton.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D3C670128AD8160047709F /* SPSingleton.m */; }; 17D3C671128AD8160047709F /* SPSingleton.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D3C670128AD8160047709F /* SPSingleton.m */; };
17D3C6D3128B1C900047709F /* SPFavoritesOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D3C6D2128B1C900047709F /* SPFavoritesOutlineView.m */; }; 17D3C6D3128B1C900047709F /* SPFavoritesOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D3C6D2128B1C900047709F /* SPFavoritesOutlineView.m */; };
17D41A8221700F8200B1888D /* SPFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 507FF1111BBCC57600104523 /* SPFunctions.m */; };
17D5B49E1553059F00EF3BB3 /* SPViewCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D5B49D1553059F00EF3BB3 /* SPViewCopy.m */; }; 17D5B49E1553059F00EF3BB3 /* SPViewCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D5B49D1553059F00EF3BB3 /* SPViewCopy.m */; };
17DB5F441555CA300046834B /* SPMutableArrayAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1798F19715501838004B0AB8 /* SPMutableArrayAdditions.m */; }; 17DB5F441555CA300046834B /* SPMutableArrayAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1798F19715501838004B0AB8 /* SPMutableArrayAdditions.m */; };
17DD52B7115071D0007D8950 /* SPPrintTemplate.html in Resources */ = {isa = PBXBuildFile; fileRef = 17DD52B6115071D0007D8950 /* SPPrintTemplate.html */; }; 17DD52B7115071D0007D8950 /* SPPrintTemplate.html in Resources */ = {isa = PBXBuildFile; fileRef = 17DD52B6115071D0007D8950 /* SPPrintTemplate.html */; };
Expand Down Expand Up @@ -3157,6 +3158,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
17D41A8221700F8200B1888D /* SPFunctions.m in Sources */,
507FF2421BC33BBC00104523 /* SPOSInfo.m in Sources */, 507FF2421BC33BBC00104523 /* SPOSInfo.m in Sources */,
586F457B0FDB269E00B428D7 /* RegexKitLite.m in Sources */, 586F457B0FDB269E00B428D7 /* RegexKitLite.m in Sources */,
58CDB3410FCE141900F8ACA3 /* SequelProTunnelAssistant.m in Sources */, 58CDB3410FCE141900F8ACA3 /* SequelProTunnelAssistant.m in Sources */,
Expand Down

0 comments on commit 6bc8cd3

Please sign in to comment.