1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-21 23:32:35 +00:00

feat: clear the badge when quitting app (#7088)

This commit is contained in:
Cœur 2024-10-22 16:34:55 +02:00 committed by GitHub
parent 4e25c038a6
commit 9513cdaebb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1068,7 +1068,7 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
//remove all torrent downloads
[self.fSession invalidateAndCancel];
//remember window states and close all windows
//remember window states
[self.fDefaults setBool:self.fInfoController.window.visible forKey:@"InfoVisible"];
if ([QLPreviewPanel sharedPreviewPanelExists] && [QLPreviewPanel sharedPreviewPanel].visible)
@ -1076,18 +1076,22 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
[[QLPreviewPanel sharedPreviewPanel] updateController];
}
// close all windows
for (NSWindow* window in NSApp.windows)
{
[window close];
}
// clear the badge
[self.fBadger updateBadgeWithDownload:0 upload:0];
//save history
[self updateTorrentHistory];
[self.fTableView saveCollapsedGroups];
_fileWatcherQueue = nil;
//complete cleanup
//complete cleanup: this can take many seconds
tr_sessionClose(self.fLib);
}