Make open finder automatically an optional setting

This commit is contained in:
Leon Böttger committed 2025-05-18 11:53:02 +02:00
1 parent e710bcab47
commit 3ccb41ae0f
20 files changed
+31 -2

No files matched your search

+1
View File
@@ -26,5 +26,6 @@ public enum UserDefaultsKeys: String, CaseIterable {
case transmissionCount = "reviewRequestCountKey"
case automaticallyAcceptFiles = "automaticallyAcceptFiles"
case saveFolderBookmark = "saveFolderBookmark"
case openFinderAfterReceiving = "openFinderAfterReceiving"
case endpointID = "endpointID"
}
+5 -2
View File
@@ -574,8 +574,11 @@ public class SaveFilesManager {
}
if !filesFinishedDownloadingSinceLastRun.isEmpty && !isFileTransferRestricted() {
log("Opening \(filesFinishedDownloadingSinceLastRun.count) file(s) in Finder.")
NSWorkspace.shared.activateFileViewerSelecting(filesFinishedDownloadingSinceLastRun)
if UserDefaults.standard.bool(forKey: UserDefaultsKeys.openFinderAfterReceiving.rawValue) {
log("Opening \(filesFinishedDownloadingSinceLastRun.count) file(s) in Finder.")
NSWorkspace.shared.activateFileViewerSelecting(filesFinishedDownloadingSinceLastRun)
}
// Clear the list of finished files
filesFinishedDownloadingSinceLastRun.removeAll()