mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Merge branch 'master' of ssh://github.com/gnustep/libs-base
This commit is contained in:
commit
efabfab3d0
4 changed files with 77 additions and 4 deletions
|
@ -74,7 +74,8 @@
|
|||
#endif
|
||||
|
||||
|
||||
NSString * const NSDefaultRunLoopMode = @"NSDefaultRunLoopMode";
|
||||
NSRunLoopMode const NSDefaultRunLoopMode = @"NSDefaultRunLoopMode";
|
||||
NSRunLoopMode const NSRunLoopCommonModes = @"NSRunLoopCommonModes";
|
||||
|
||||
static NSDate *theFuture = nil;
|
||||
|
||||
|
|
|
@ -157,6 +157,11 @@ typedef struct
|
|||
return AUTORELEASE(o);
|
||||
}
|
||||
|
||||
- (void) start
|
||||
{
|
||||
[this->_protocol startLoading];
|
||||
}
|
||||
|
||||
- (void) cancel
|
||||
{
|
||||
[this->_protocol stopLoading];
|
||||
|
@ -164,6 +169,25 @@ typedef struct
|
|||
DESTROY(this->_delegate);
|
||||
}
|
||||
|
||||
- (void) scheduleInRunLoop: (NSRunLoop *)aRunLoop
|
||||
forMode: (NSRunLoopMode)mode
|
||||
{
|
||||
NSArray *modes = [NSArray arrayWithObject: mode];
|
||||
[aRunLoop performSelector: @selector(start)
|
||||
target: self
|
||||
argument: nil
|
||||
order: 0
|
||||
modes: modes];
|
||||
}
|
||||
|
||||
- (void) unscheduleFromRunLoop: (NSRunLoop *)aRunLoop
|
||||
forMode: (NSRunLoopMode)mode
|
||||
{
|
||||
[aRunLoop cancelPerformSelector: @selector(start)
|
||||
target: self
|
||||
argument: nil];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
if (this != 0)
|
||||
|
@ -185,7 +209,7 @@ typedef struct
|
|||
}
|
||||
}
|
||||
|
||||
- (id) initWithRequest: (NSURLRequest *)request delegate: (id)delegate
|
||||
- (id) initWithRequest: (NSURLRequest *)request delegate: (id)delegate startImmediately: (BOOL)startImmediately
|
||||
{
|
||||
if ((self = [super init]) != nil)
|
||||
{
|
||||
|
@ -226,12 +250,22 @@ typedef struct
|
|||
initWithRequest: this->_request
|
||||
cachedResponse: nil
|
||||
client: (id<NSURLProtocolClient>)self];
|
||||
[this->_protocol startLoading];
|
||||
if (startImmediately == YES)
|
||||
{
|
||||
[this->_protocol startLoading];
|
||||
}
|
||||
this->_debug = GSDebugSet(@"NSURLConnection");
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithRequest: (NSURLRequest *)request delegate: (id)delegate
|
||||
{
|
||||
return [self initWithRequest: request
|
||||
delegate: delegate
|
||||
startImmediately: YES];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue