Fix SBQueue status.

This commit is contained in:
Damiano Galassi committed 2014-03-12 08:17:35 +01:00
1 parent f1dab1fe48
commit d28d792c8d
1 file changed
+5 -3
+5 -3
View File
@@ -357,7 +357,8 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification";
// Check results // Check results
if (_cancelled) { if (_cancelled) {
item.status = SBQueueItemStatusCancelled; item.status = SBQueueItemStatusCancelled;
self.status = SBQueueStatusCancelled; [item release];
[self handleSBStatusCancelled];
break; break;
} else if (noErr) { } else if (noErr) {
if (self.optimize) { if (self.optimize) {
@@ -395,11 +396,9 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification";
// Disable sleep assertion // Disable sleep assertion
[self enableSleep]; [self enableSleep];
[self handleSBStatusCompleted]; [self handleSBStatusCompleted];
}); });
} }
/** /**
* Processes a SBQueueItem. * Processes a SBQueueItem.
*/ */
@@ -477,6 +476,7 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification";
* sends SBQueueCompletedNotification. * sends SBQueueCompletedNotification.
*/ */
- (void)handleSBStatusCompleted { - (void)handleSBStatusCompleted {
self.status = SBQueueStatusCompleted;
[[NSNotificationCenter defaultCenter] postNotificationName:SBQueueCompletedNotification object:self]; [[NSNotificationCenter defaultCenter] postNotificationName:SBQueueCompletedNotification object:self];
} }
@@ -485,6 +485,7 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification";
* sends SBQueueFailedNotification. * sends SBQueueFailedNotification.
*/ */
- (void)handleSBStatusFailed { - (void)handleSBStatusFailed {
self.status = SBQueueStatusFailed;
[[NSNotificationCenter defaultCenter] postNotificationName:SBQueueFailedNotification object:self]; [[NSNotificationCenter defaultCenter] postNotificationName:SBQueueFailedNotification object:self];
} }
@@ -493,6 +494,7 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification";
* sends SBQueueCancelledNotification. * sends SBQueueCancelledNotification.
*/ */
- (void)handleSBStatusCancelled { - (void)handleSBStatusCancelled {
self.status = SBQueueStatusCancelled;
[[NSNotificationCenter defaultCenter] postNotificationName:SBQueueCancelledNotification object:self]; [[NSNotificationCenter defaultCenter] postNotificationName:SBQueueCancelledNotification object:self];
} }