mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-21 20:45:51 +03:00
Wrap use of NSFileProviderManager globalProgress in availability check
This selector was only made available on macOS 11.3 Just to be safe we should check for the availability Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
18fb6dc456
commit
d1e26b27f9
1 changed files with 12 additions and 10 deletions
|
@ -42,17 +42,19 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
NSProgress *const downloadProgress = [_manager globalProgressForKind:NSProgressFileOperationKindDownloading];
|
||||
NSProgress *const uploadProgress = [_manager globalProgressForKind:NSProgressFileOperationKindUploading];
|
||||
_downloadProgressObserver = [[ProgressObserver alloc] initWithProgress:downloadProgress];
|
||||
_uploadProgressObserver = [[ProgressObserver alloc] initWithProgress:uploadProgress];
|
||||
if (@available(macOS 11.3, *)) {
|
||||
NSProgress *const downloadProgress = [_manager globalProgressForKind:NSProgressFileOperationKindDownloading];
|
||||
NSProgress *const uploadProgress = [_manager globalProgressForKind:NSProgressFileOperationKindUploading];
|
||||
_downloadProgressObserver = [[ProgressObserver alloc] initWithProgress:downloadProgress];
|
||||
_uploadProgressObserver = [[ProgressObserver alloc] initWithProgress:uploadProgress];
|
||||
|
||||
_downloadProgressObserver.progressKVOChangeHandler = ^(NSProgress *const progress){
|
||||
updateDownload(progress);
|
||||
};
|
||||
_uploadProgressObserver.progressKVOChangeHandler = ^(NSProgress *const progress){
|
||||
updateUpload(progress);
|
||||
};
|
||||
_downloadProgressObserver.progressKVOChangeHandler = ^(NSProgress *const progress){
|
||||
updateDownload(progress);
|
||||
};
|
||||
_uploadProgressObserver.progressKVOChangeHandler = ^(NSProgress *const progress){
|
||||
updateUpload(progress);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
~MacImplementation() = default;
|
||||
|
|
Loading…
Reference in a new issue