Revise to use NO_ARGS when needed. Add current to total progress

This commit is contained in:
Gregory John Casamento 2019-08-06 09:24:21 -04:00
parent a983e7222d
commit fce4e2e30c
2 changed files with 5 additions and 3 deletions

View file

@ -63,8 +63,9 @@ GS_NSProgress_IVARS;
}
DEFINE_BLOCK_TYPE(NSProgressPublishingHandler, void, NSProgress*);
DEFINE_BLOCK_TYPE(NSProgressUnpublishingHandler, void, void);
DEFINE_BLOCK_TYPE(GSProgressPendingUnitCountBlock, void, void);
DEFINE_BLOCK_NO_ARGS(NSProgressUnpublishingHandler);
DEFINE_BLOCK_NO_ARGS(GSProgressPendingUnitCountBlock);
DEFINE_BLOCK_NO_ARGS(GSProgressResumingHandler);
// Creating progress objects...
- (instancetype)initWithParent: (NSProgress *)parent
@ -106,7 +107,6 @@ DEFINE_BLOCK_TYPE(GSProgressPendingUnitCountBlock, void, void);
- (void) setPausingHandler: (GSProgressPausingHandler) handler;
- (void) resume;
DEFINE_BLOCK_TYPE(GSProgressResumingHandler, void, void);
- (void) setResumingHandler: (GSProgressResumingHandler) handler;
// Progress Information

View file

@ -169,6 +169,8 @@ static NSProgress *__currentProgress = nil;
- (void)resignCurrent
{
int64_t completed = [__currentProgress completedUnitCount];
[__currentProgress setCompletedUnitCount: completed + [self totalUnitCount]];
__currentProgress = nil;
}