mirror of
https://github.com/transmission/transmission
synced 2024-12-22 15:54:57 +00:00
feat: clear the badge when quitting app (#7088)
This commit is contained in:
parent
4e25c038a6
commit
9513cdaebb
1 changed files with 6 additions and 2 deletions
|
@ -1068,7 +1068,7 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
|
||||||
//remove all torrent downloads
|
//remove all torrent downloads
|
||||||
[self.fSession invalidateAndCancel];
|
[self.fSession invalidateAndCancel];
|
||||||
|
|
||||||
//remember window states and close all windows
|
//remember window states
|
||||||
[self.fDefaults setBool:self.fInfoController.window.visible forKey:@"InfoVisible"];
|
[self.fDefaults setBool:self.fInfoController.window.visible forKey:@"InfoVisible"];
|
||||||
|
|
||||||
if ([QLPreviewPanel sharedPreviewPanelExists] && [QLPreviewPanel sharedPreviewPanel].visible)
|
if ([QLPreviewPanel sharedPreviewPanelExists] && [QLPreviewPanel sharedPreviewPanel].visible)
|
||||||
|
@ -1076,18 +1076,22 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
|
||||||
[[QLPreviewPanel sharedPreviewPanel] updateController];
|
[[QLPreviewPanel sharedPreviewPanel] updateController];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// close all windows
|
||||||
for (NSWindow* window in NSApp.windows)
|
for (NSWindow* window in NSApp.windows)
|
||||||
{
|
{
|
||||||
[window close];
|
[window close];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear the badge
|
||||||
|
[self.fBadger updateBadgeWithDownload:0 upload:0];
|
||||||
|
|
||||||
//save history
|
//save history
|
||||||
[self updateTorrentHistory];
|
[self updateTorrentHistory];
|
||||||
[self.fTableView saveCollapsedGroups];
|
[self.fTableView saveCollapsedGroups];
|
||||||
|
|
||||||
_fileWatcherQueue = nil;
|
_fileWatcherQueue = nil;
|
||||||
|
|
||||||
//complete cleanup
|
//complete cleanup: this can take many seconds
|
||||||
tr_sessionClose(self.fLib);
|
tr_sessionClose(self.fLib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue