mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Revise to use NO_ARGS when needed. Add current to total progress
This commit is contained in:
parent
a983e7222d
commit
fce4e2e30c
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -169,6 +169,8 @@ static NSProgress *__currentProgress = nil;
|
|||
|
||||
- (void)resignCurrent
|
||||
{
|
||||
int64_t completed = [__currentProgress completedUnitCount];
|
||||
[__currentProgress setCompletedUnitCount: completed + [self totalUnitCount]];
|
||||
__currentProgress = nil;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue