Revision: 22486
          http://sourceforge.net/p/bibdesk/svn/22486
Author:   hofman
Date:     2018-08-07 22:49:07 +0000 (Tue, 07 Aug 2018)
Log Message:
-----------
time in dispatch_after is not the delay in seconds

Modified Paths:
--------------
    trunk/bibdesk/BDSKAddressTextFieldCell.m
    trunk/bibdesk/NSAnimationContext_BDSKExtensions.m

Modified: trunk/bibdesk/BDSKAddressTextFieldCell.m
===================================================================
--- trunk/bibdesk/BDSKAddressTextFieldCell.m    2018-08-07 15:17:13 UTC (rev 
22485)
+++ trunk/bibdesk/BDSKAddressTextFieldCell.m    2018-08-07 22:49:07 UTC (rev 
22486)
@@ -111,15 +111,13 @@
     [super editWithFrame:[self adjustedFrame:aRect inView:controlView] 
inView:controlView editor:textObj delegate:anObject event:theEvent];
 }
 
-- (void)selectAllTextWithEditor:(NSText *)textObj {
-    if ([textObj selectedRange].length == 0)
-        [textObj setSelectedRange:NSMakeRange(0, [[textObj string] length])];
-}
-
 - (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView 
editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart 
length:(NSInteger)selLength {
     [super selectWithFrame:[self adjustedFrame:aRect inView:controlView] 
inView:controlView editor:textObj delegate:anObject start:selStart 
length:selLength];
     if ([[self stringValue] length])
-        [self performSelector:@selector(selectAllTextWithEditor:) 
withObject:textObj afterDelay:0];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            if ([textObj selectedRange].length == 0)
+                [textObj setSelectedRange:NSMakeRange(0, [[textObj string] 
length])];
+        });
 }
 
 @end

Modified: trunk/bibdesk/NSAnimationContext_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSAnimationContext_BDSKExtensions.m   2018-08-07 15:17:13 UTC 
(rev 22485)
+++ trunk/bibdesk/NSAnimationContext_BDSKExtensions.m   2018-08-07 22:49:07 UTC 
(rev 22486)
@@ -52,10 +52,6 @@
     return defaultAnimationTimeInterval;
 }
 
-+ (void)performCompletionHandler:(void (^)(void))completionHandler {
-    completionHandler();
-}
-
 + (void)fallback_runAnimationGroup:(void (^)(NSAnimationContext 
*context))changes completionHandler:(void (^)(void))completionHandler {
     [self beginGrouping];
     NSAnimationContext *context = [self currentContext];
@@ -63,7 +59,7 @@
     NSTimeInterval duration = [context duration];
     [self endGrouping];
     if (completionHandler)
-        [self performSelector:@selector(performCompletionHandler:) 
withObject:[[completionHandler copy] autorelease] afterDelay:duration];
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * 
NSEC_PER_SEC)), dispatch_get_main_queue(), completionHandler);
 }
 
 + (void)load {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to