Skip to content

Commit

Permalink
Merge pull request #7356 from nextcloud/backport/7328/stable-3.14
Browse files Browse the repository at this point in the history
[stable-3.14] Check for availability of Big Sur (under 11.3) before using VFS progress tracking method
  • Loading branch information
claucambra authored Oct 18, 2024
2 parents 5b47d17 + c9667c1 commit 0b97d60
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/gui/macOS/fileproviderdomainsyncstatus_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ explicit MacImplementation(const QString &domainIdentifier, FileProviderDomainSy
return;
}

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);
};
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);
};
}
}

~MacImplementation() = default;
Expand Down

0 comments on commit 0b97d60

Please sign in to comment.