-
Notifications
You must be signed in to change notification settings - Fork 816
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6461 from nextcloud/feature/file-provider-fast-in…
…it-sync Add option to perform fast synchronisation runs in File Provider sync engine
- Loading branch information
Showing
17 changed files
with
312 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderConfig.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// FileProviderConfig.swift | ||
// FileProviderExt | ||
// | ||
// Created by Claudio Cambra on 5/2/24. | ||
// | ||
|
||
import FileProvider | ||
import Foundation | ||
|
||
struct FileProviderConfig { | ||
private enum ConfigKey: String { | ||
case fastEnumerationEnabled = "fastEnumerationEnabled" | ||
} | ||
|
||
let domainIdentifier: NSFileProviderDomainIdentifier | ||
|
||
private var internalConfig: [String: Any] { | ||
get { | ||
let defaults = UserDefaults.standard | ||
if let settings = defaults.dictionary(forKey: domainIdentifier.rawValue) { | ||
return settings | ||
} | ||
let dictionary: [String: Any] = [:] | ||
defaults.setValue(dictionary, forKey: domainIdentifier.rawValue) | ||
return dictionary | ||
} | ||
set { | ||
let defaults = UserDefaults.standard | ||
defaults.setValue(newValue, forKey: domainIdentifier.rawValue) | ||
} | ||
} | ||
|
||
var fastEnumerationEnabled: Bool { | ||
get { internalConfig[ConfigKey.fastEnumerationEnabled.rawValue] as? Bool ?? true } | ||
set { internalConfig[ConfigKey.fastEnumerationEnabled.rawValue] = newValue } | ||
} | ||
|
||
lazy var fastEnumerationSet = internalConfig[ConfigKey.fastEnumerationEnabled.rawValue] != nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.