mirror of
https://github.com/transmission/transmission
synced 2024-12-21 23:32:35 +00:00
refactor: rename "UpdateQueue" to "UpdateTorrentsState" (#6613)
This commit is contained in:
parent
bf0119dd3f
commit
92478ec849
5 changed files with 10 additions and 17 deletions
|
@ -381,14 +381,14 @@ static void removeKeRangerRansomware()
|
|||
[NSValueTransformer setValueTransformer:iconTransformer forName:@"ExpandedPathToIconTransformer"];
|
||||
}
|
||||
|
||||
void onStartQueue(tr_session* /*session*/, tr_torrent* tor, void* vself)
|
||||
void onStartQueue(tr_session* /*session*/, tr_torrent* /*tor*/, void* /*vself*/)
|
||||
{
|
||||
auto* controller = (__bridge Controller*)(vself);
|
||||
auto const hashstr = @(tr_torrentView(tor).hash_string);
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
auto* const torrent = [controller torrentForHash:hashstr];
|
||||
[torrent startQueue];
|
||||
//posting asynchronously with coalescing to prevent stack overflow on lots of torrents changing state at the same time
|
||||
[NSNotificationQueue.defaultQueue enqueueNotification:[NSNotification notificationWithName:@"UpdateTorrentsState" object:nil]
|
||||
postingStyle:NSPostASAP
|
||||
coalesceMask:NSNotificationCoalescingOnName
|
||||
forModes:nil];
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -812,8 +812,7 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
|
|||
|
||||
[nc addObserver:self.fWindow selector:@selector(makeKeyWindow) name:@"MakeWindowKey" object:nil];
|
||||
|
||||
#warning rename
|
||||
[nc addObserver:self selector:@selector(fullUpdateUI) name:@"UpdateQueue" object:nil];
|
||||
[nc addObserver:self selector:@selector(fullUpdateUI) name:@"UpdateTorrentsState" object:nil];
|
||||
|
||||
[nc addObserver:self selector:@selector(applyFilter) name:@"ApplyFilter" object:nil];
|
||||
|
||||
|
|
|
@ -463,7 +463,7 @@ typedef NS_ENUM(NSUInteger, FilePriorityMenuTag) { //
|
|||
[FileRenameSheetController presentSheetForTorrent:torrent modalForWindow:self.fOutline.window completionHandler:^(BOOL didRename) {
|
||||
if (didRename)
|
||||
{
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"UpdateQueue" object:self];
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"UpdateTorrentsState" object:nil];
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"ResetInspector" object:self
|
||||
userInfo:@{ @"Torrent" : torrent }];
|
||||
}
|
||||
|
|
|
@ -879,7 +879,7 @@ static NSString* const kWebUIURLFormat = @"http://localhost:%ld/";
|
|||
tr_sessionSetQueueEnabled(self.fHandle, TR_UP, [self.fDefaults boolForKey:@"QueueSeed"]);
|
||||
|
||||
//handle if any transfers switch from queued to paused
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"UpdateQueue" object:self];
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"UpdateTorrentsState" object:nil];
|
||||
}
|
||||
|
||||
- (void)setQueueNumber:(id)sender
|
||||
|
|
|
@ -42,7 +42,6 @@ extern NSString* const kTorrentDidChangeGroupNotification;
|
|||
- (void)startTransfer;
|
||||
- (void)startMagnetTransferAfterMetaDownload;
|
||||
- (void)stopTransfer;
|
||||
- (void)startQueue;
|
||||
- (void)sleep;
|
||||
- (void)wakeUp;
|
||||
- (void)idleLimitHit;
|
||||
|
|
|
@ -251,7 +251,7 @@ bool trashDataFile(char const* filename, void* /*user_data*/, tr_error* error)
|
|||
if (wasTransmitting != self.transmitting)
|
||||
{
|
||||
//posting asynchronously with coalescing to prevent stack overflow on lots of torrents changing state at the same time
|
||||
[NSNotificationQueue.defaultQueue enqueueNotification:[NSNotification notificationWithName:@"UpdateQueue" object:self]
|
||||
[NSNotificationQueue.defaultQueue enqueueNotification:[NSNotification notificationWithName:@"UpdateTorrentsState" object:nil]
|
||||
postingStyle:NSPostASAP
|
||||
coalesceMask:NSNotificationCoalescingOnName
|
||||
forModes:nil];
|
||||
|
@ -1982,11 +1982,6 @@ bool trashDataFile(char const* filename, void* /*user_data*/, tr_error* error)
|
|||
}];
|
||||
}
|
||||
|
||||
- (void)startQueue
|
||||
{
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"UpdateQueue" object:self];
|
||||
}
|
||||
|
||||
- (void)completenessChange:(tr_completeness)status wasRunning:(BOOL)wasRunning
|
||||
{
|
||||
self.fStat = tr_torrentStat(self.fHandle); //don't call update yet to avoid auto-stop
|
||||
|
|
Loading…
Reference in a new issue