Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Analyze
run: |
/usr/bin/git config --global --add safe.directory "$GITHUB_WORKSPACE"
/usr/bin/git diff -U0 HEAD^ | clang-tidy-diff-21.py -checks='-*,modernize-use-auto,modernize-use-using,modernize-use-nodiscard,modernize-use-nullptr,modernize-use-override,cppcoreguidelines-pro-type-static-cast-downcast' -p1 -path build -export-fixes clang-tidy-result/fixes.yml
/usr/bin/git diff -U0 HEAD^ | clang-tidy-diff-21.py -checks='-*,modernize-use-auto,modernize-use-using,modernize-use-nodiscard,modernize-use-nullptr,modernize-use-override,cppcoreguidelines-pro-type-static-cast-downcast' -p1 -path build -regex '^(?!.*/macOS/)(?!.*/MacOSX/).*\.(cpp|cc|cxx|c|h|hpp|hxx)$' -export-fixes clang-tidy-result/fixes.yml
- name: Run clang-tidy-pr-comments action
uses: platisd/clang-tidy-pr-comments@28cfb84edafa771c044bde7e4a2a3fae57463818 # v1.6.1 # >1.4.3 switches to composite method w/ a forced python version and breaks things: https://github.com/actions/setup-python/issues/871
with:
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ The following details are important and only relevant when working on the deskto
- The PIMPL pattern is an established convention in the Objective-C++ source code files under `src/gui/macOS`.
- To abstract macOS and Objective-C specific APIs, prefer to use Qt and C++ types in public identifiers declared in headers. Use and prefer Objective-C or native macOS features only internally in implementations. This rule applies only to the code in `src/gui/macOS`, though.
- When writing code in Swift, respect strict concurrency rules and Swift 6 compatibility.
- Manage memory explicitly and manually when writing or updating code located under `./src`. For example, do not use features like `__weak` from automatic reference counting in Objective-C because ARC is not used in this project.

### Tests

Expand Down
6 changes: 6 additions & 0 deletions admin/osx/mac-crafter/Sources/Utils/Signer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ enum Signer: Signing {
.appendingPathComponent("Frameworks")

Log.info("Looking for frameworks in \(frameworksLocation.path)")

guard FileManager.default.fileExists(atPath: frameworksLocation.path) else {
Log.info("No Frameworks directory found, skipping")
return []
}

var items = try FileManager.default.contentsOfDirectory(at: frameworksLocation, includingPropertiesForKeys: nil)

items.removeAll { item in
Expand Down
4 changes: 4 additions & 0 deletions admin/osx/macosx.entitlements.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<array>
<string>@DEVELOPMENT_TEAM@.@APPLICATION_REV_DOMAIN@</string>
</array>
<key>com.apple.security.temporary-exception.mach-register.global-name</key>
<array>
<string>@APPLICATION_REV_DOMAIN@.FinderSyncService</string>
</array>
@DEBUG_ENTITLEMENTS@
</dict>
</plist>
4 changes: 4 additions & 0 deletions shell_integration/MacOSX/FinderSyncExt.entitlements.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<array>
<string>@DEVELOPMENT_TEAM@.@APPLICATION_REV_DOMAIN@</string>
</array>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<array>
<string>@APPLICATION_REV_DOMAIN@.FinderSyncService</string>
</array>
@DEBUG_ENTITLEMENTS@
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import FileProvider
import Foundation
import NCDesktopClientSocketKit
import NextcloudKit
import NextcloudFileProviderKit
import OSLog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ extension FileProviderExtension: NSXPCListenerDelegate {
if let appService = remoteObjectProxy as? AppProtocol {
logger.info("Succeeded to cast remote object proxy, adopting it!")
self.app = appService

// Initial status report as soon as the app service is available.
updatedSyncStateReporting(oldActions: Set<UUID>())
} else {
logger.error("Failed to cast remote object proxy to AppProtocol!")
self.app = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later

import FileProvider
import NCDesktopClientSocketKit
import NextcloudKit
import NextcloudFileProviderKit
import OSLog
Expand Down Expand Up @@ -54,18 +53,6 @@ import OSLog
var ignoredFiles: IgnoredFilesMatcher?
lazy var ncKitBackground = NKBackground(nkCommonInstance: ncKit.nkCommonInstance)

lazy var socketClient: LocalSocketClient? = {
guard let containerUrl = FileManager.default.applicationGroupContainer() else {
logger.fault("Won't start socket client, no container URL available!")
return nil;
}

let socketPath = containerUrl.appendingPathComponent("fps", conformingTo: .archive)
let lineProcessor = FileProviderSocketLineProcessor(delegate: self, log: log)

return LocalSocketClient(socketPath: socketPath.path, lineProcessor: lineProcessor)
}()

var syncActions = Set<UUID>()
var errorActions = Set<UUID>()
var actionsLock = NSLock()
Expand Down Expand Up @@ -110,7 +97,6 @@ import OSLog
self.keychain = Keychain(log: log)

super.init()
socketClient?.start()
}

func invalidate() {
Expand Down Expand Up @@ -524,13 +510,6 @@ import OSLog
manager.signalEnumerator(for: .workingSet, completionHandler: completionHandler)
}

@objc func sendFileProviderDomainIdentifier() {
let command = "FILE_PROVIDER_DOMAIN_IDENTIFIER_REQUEST_REPLY"
let argument = domain.identifier.rawValue
let message = command + ":" + argument + "\n"
socketClient?.sendMessage(message)
}

private func signalEnumeratorAfterAccountSetup() {
guard let manager = manager else {
logger.error("Could not get file provider manager for domain \(self.domain.displayName), cannot notify after account setup")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#import <Cocoa/Cocoa.h>

Check failure on line 7 in shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.h

View workflow job for this annotation

GitHub Actions / build

shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.h:7:9 [clang-diagnostic-error]

'Cocoa/Cocoa.h' file not found
#import <FinderSync/FinderSync.h>
#import <NCDesktopClientSocketKit/LocalSocketClient.h>

#import "SyncClient.h"
#import "FinderSyncSocketLineProcessor.h"

@class FinderSyncXPCManager;

@interface FinderSync : FIFinderSync <SyncClientDelegate>

@property FinderSyncSocketLineProcessor *lineProcessor;
@property LocalSocketClient *localSocketClient;
@property FinderSyncXPCManager *xpcManager;

@end
Loading
Loading