From 9513cdaebb737ee386e13c5dd5d64b1e1eb3f0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C5=93ur?= Date: Tue, 22 Oct 2024 16:34:55 +0200 Subject: [PATCH] feat: clear the badge when quitting app (#7088) --- macosx/Controller.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/macosx/Controller.mm b/macosx/Controller.mm index e28b98679..6df0bb1da 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -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); }