Revision: 24077
http://sourceforge.net/p/bibdesk/svn/24077
Author: hofman
Date: 2019-07-23 22:02:28 +0000 (Tue, 23 Jul 2019)
Log Message:
-----------
don't call didEndSelector when there is nothing to do
Modified Paths:
--------------
trunk/bibdesk/NSAlert_BDSKExtensions.m
trunk/bibdesk/NSWindowController_BDSKExtensions.m
Modified: trunk/bibdesk/NSAlert_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSAlert_BDSKExtensions.m 2019-07-23 21:17:22 UTC (rev
24076)
+++ trunk/bibdesk/NSAlert_BDSKExtensions.m 2019-07-23 22:02:28 UTC (rev
24077)
@@ -41,7 +41,7 @@
@implementation NSAlert (BDSKExtensions)
-- (void)bdsk_didEndAlert:(NSAlert *)alert returnCode:(NSInteger)returnCode
contextInfo:(void *)contextInfo {
+- (void)didEndAlert:(NSAlert *)alert returnCode:(NSInteger)returnCode
completionHandler:(void *)contextInfo {
if (contextInfo != NULL) {
void (^handler)(NSInteger) = (void(^)(NSInteger))contextInfo;
handler(returnCode);
@@ -52,7 +52,7 @@
- (void)fallback_beginSheetModalForWindow:(NSWindow *)window
completionHandler:(void (^)(NSInteger result))handler {
[self beginSheetModalForWindow:window
modalDelegate:handler ? self : nil
- didEndSelector:handler ?
@selector(bdsk_didEndAlert:returnCode:contextInfo:) : NULL
+ didEndSelector:handler ?
@selector(didEndAlert:returnCode:completionHandler:) : NULL
contextInfo:handler ? Block_copy(handler) : NULL];
}
Modified: trunk/bibdesk/NSWindowController_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSWindowController_BDSKExtensions.m 2019-07-23 21:17:22 UTC
(rev 24076)
+++ trunk/bibdesk/NSWindowController_BDSKExtensions.m 2019-07-23 22:02:28 UTC
(rev 24077)
@@ -93,7 +93,7 @@
#pragma mark Sheet methods
-- (void)didEndSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode
contextInfo:(void *)contextInfo {
+- (void)didEndSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode
completionHandler:(void *)contextInfo {
if (contextInfo != NULL) {
void (^handler)(NSInteger) = (void(^)(NSInteger))contextInfo;
handler(returnCode);
@@ -106,8 +106,8 @@
[NSApp beginSheet:[self window]
modalForWindow:window
- modalDelegate:self
- didEndSelector:@selector(didEndSheet:returnCode:contextInfo:)
+ modalDelegate:handler ? self : nil
+ didEndSelector:handler ?
@selector(didEndSheet:returnCode:completionHandler:) : NULL
contextInfo:handler ? Block_copy(handler) : NULL];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit