Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
7bdb0d8
fix: Convert full source paths to relative in logs
Aiiaiiio Oct 2, 2025
39daf3b
fix: typo in comment
Aiiaiiio Oct 2, 2025
256430f
fix: omit filenames from the log in release mode
Aiiaiiio Oct 2, 2025
a3f761f
fix: removing unnecessary define from CMakeLists.txt
Aiiaiiio Oct 2, 2025
4a4a717
fix: show account label in tray hover
Rello Oct 1, 2025
33b668f
feat(vfs/folders): enable on demand fetch of folder content
mgallien Jun 6, 2025
1abd860
feat(vfs/folders): enable on demand fetch of folder content
mgallien Jun 6, 2025
9213c25
fix: once a folder has been populated, disable it
mgallien Jul 3, 2025
4e439d7
fix: code style fix
mgallien Jul 3, 2025
37b0454
fix(vfs/folders): track state of folders using a new blacklist type
mgallien Jul 8, 2025
f53af9a
fix: makes sure we do fetch empty folders again
mgallien Jul 9, 2025
7f1661b
fix(vfs/folders-on-demand): do not black list virtual folders
mgallien Jul 9, 2025
8a2d2d1
fix(vfs/folders-on-demand): use proper item type for virtual folders
mgallien Jul 9, 2025
11c460a
fix(vfs/windows): handle virtual directories as virtual directories
mgallien Sep 23, 2025
66a7a08
fix(vfs/windows): update folder type when populated
mgallien Sep 23, 2025
007f778
fix(vfs/windows): virtual folders are folders
mgallien Sep 24, 2025
17866f8
fix(vfs/windows): properly update DB record when folder is not virtual
mgallien Sep 24, 2025
404a09e
chore(vfs/windows): more logs for fetch placeholders callback
mgallien Sep 25, 2025
29239db
fix(vfs/windows): fix creation of items inside virtual folders
mgallien Sep 25, 2025
2e87f45
fix(vfs/xattr): fix compilation of vfs xattr experimental plug-in
mgallien Sep 26, 2025
80965f7
fix(db): assert if we insert a DB record with empty path
mgallien Sep 26, 2025
3bcaf69
fix(tests): ensure we do not access items in empty QList
mgallien Sep 26, 2025
8c3e417
fix(propagator): do not create invalid records when propagating
mgallien Sep 26, 2025
724b668
fix(vfs/discovery): do not recurse inside a virtual folder
mgallien Sep 26, 2025
0f358fe
chore(webdav): makes webdav proprty parsing code into reusable method
mgallien Sep 28, 2025
28a0f89
chore(db): do not create db records with invalid mtime
mgallien Sep 28, 2025
8fde220
fix(vfs/windows): fix issues with folders on-demand DB records
mgallien Sep 28, 2025
6d9409a
fix(vfs): fix regressions with folders on-demand tests
mgallien Sep 30, 2025
88a9d60
chore(ci/linux): update the CI images for linux CI compilation and tests
mgallien Sep 30, 2025
7af9c12
chore(vfs/windows): log items pattern when fetching placeholders
mgallien Sep 30, 2025
eec39be
chore(vfs/windows): expect failed tests on windows VFS
mgallien Sep 30, 2025
80c6c90
chore(vfs/windows): common method for WebDAV proprties list
mgallien Oct 1, 2025
974bd60
chore: fix common issue with one wrong variable name
mgallien Oct 1, 2025
7b2c7fd
chore: simplify code
mgallien Oct 1, 2025
1a277c5
feat: allow usage of public link to shared folders as an account URL
mgallien Jan 13, 2022
b94b47b
fix(proxy): only clean legacy proxy settings after migrating all acco…
camilasan Oct 1, 2025
6844115
fix(accountsettings): do not to initialize e2ee if account is disconn…
camilasan Oct 2, 2025
31fead1
fix: ignore Qt6 WebEngineCore PDB file that is too big for Wix Toolset 3
mgallien Jul 1, 2025
4daa934
fix: fix syntax issues in main dialog to have it work again
mgallien Oct 2, 2025
a0a740a
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 3, 2025
c629037
chore: prepare for 4.1 release
mgallien Oct 3, 2025
e6d4217
fix: allow settings window to enter full screen or be minimized
elsiehupp Oct 3, 2025
bdbe552
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 4, 2025
5e15ee1
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 5, 2025
1f50ffe
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 6, 2025
f801c96
fix(sync/publicShareLinks): fix public share link detection
mgallien Oct 3, 2025
30d4e42
fix: fix typo in log message
mgallien Oct 6, 2025
767e3f4
fix: do not show share ID for sidebar entries of public share links
mgallien Oct 6, 2025
50e53bc
feat: Use upstream extra cmake modules
claucambra Jun 12, 2024
186767a
fix: Mark nextcloudcmd as non gui executable
claucambra Jun 12, 2024
081df19
fix: Fix ecm_add_app_icon calls
claucambra Jun 13, 2024
bc24a9e
fix: Update upstream URL for Extra CMake Modules
claucambra Jun 23, 2024
58aa1c6
fix(reuse): remove no longer needed BSD-2 license
mgallien Jul 9, 2025
1cf0194
fix(test/csync): make sure the test executable can be found to be run
mgallien Jul 9, 2025
b6a6094
fix: proper use of ecm_add_app_icon
mgallien Jul 15, 2025
9995628
chore(ci): use a docker linux image for CI which has extra-cmake-modules
mgallien Oct 6, 2025
4747b7f
feat: Nextcloud Developer Build from Integration Project
i2h3 Oct 2, 2025
1fc59e9
fix: Source mapping for extensions in Xcode debugger.
i2h3 Oct 6, 2025
d9fc94d
fix: Improved one logging call.
i2h3 Oct 6, 2025
6a0db5a
fix: Updated NextcloudFileProviderKit reference.
i2h3 Oct 6, 2025
153c46c
fix: Updated NextcloudFileProviderKit to 3.2.1
i2h3 Oct 6, 2025
db430b9
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 7, 2025
e4c8ba8
chore: fix all occurence of range-loop-detach clazy warning
mgallien Aug 29, 2025
9fc0dc9
fix: folder delete/new conflict will be "delete"
mgallien Aug 26, 2025
49f1cfc
feat(propagation): flexible way to configure special actions on items
mgallien Aug 29, 2025
b5ff078
chore: adjust logs level and clazy warnings for permanent deletions
mgallien Aug 29, 2025
ad82579
feat(conflict): use local device trashbin for delete/new conflicts
mgallien Sep 1, 2025
049ffc5
feat(conflict): use local device trashbin for delete/new conflicts
mgallien Sep 1, 2025
85c5e09
chore(autotests): folders on-demand breaks the new test: skip it
mgallien Oct 6, 2025
5b688de
fix: Added some macOS-specific items to .gitignore
i2h3 Oct 7, 2025
5051b67
feat: Branded file provider extension SF Symbol.
i2h3 Oct 1, 2025
9813702
feat(file-provider): Integrated localizations from Transifex.
i2h3 Oct 7, 2025
0ef6f57
chore(deps): Bump fsfe/reuse-action from 5.0.0 to 6.0.0
dependabot[bot] Oct 6, 2025
e3ec58e
chore(deps): Bump actions/stale from 10.0.0 to 10.1.0
dependabot[bot] Oct 7, 2025
e43077e
chore(deps): Bump cpp-linter/cpp-linter-action from 2.16.4 to 2.16.5
dependabot[bot] Oct 7, 2025
cf44a78
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 8, 2025
32617f1
fix(asyncimageresponse): fetch remote resources in the same thread as…
nilsding Oct 8, 2025
f7a62d1
chore(chunk-upload): always sent the total size header
mgallien Oct 8, 2025
d4c144a
Refactor addAccountButton properties for icon sizing
Rello Oct 8, 2025
1da2fcf
fix: Removing non-existent properties
Aiiaiiio Oct 8, 2025
f7d06b8
fix: Tweaking account dropdown menu style
Aiiaiiio Oct 8, 2025
7d9bb86
fix: handle single quotes in file paths for conflict and case clash d…
Copilot Oct 8, 2025
574e57c
fix: properly HTML-escape URLs to handle both single and double quotes
Copilot Oct 8, 2025
7a4db91
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 9, 2025
2f685c4
fix(filesystembase): log correct ACL errors
nilsding Oct 9, 2025
08fe60d
fix: Adding elide to menuitems
Aiiaiiio Oct 9, 2025
2d1f52b
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 10, 2025
c6ecc77
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 11, 2025
7b4fe33
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 12, 2025
acee80a
fix(i18n): Fixed grammar
rakekniven Oct 13, 2025
a77107c
fix(test): adapt updated error message strings
nilsding Oct 13, 2025
54a8f3a
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 13, 2025
8c05564
fix(file-provider): Updated logging calls in extension implementation.
i2h3 Oct 9, 2025
a1d2b8c
fix(file-provider): Updated NextcloudKit and NextcloudFileProviderKit…
i2h3 Oct 13, 2025
0eeff94
fix(l10n): Update translations from Transifex
nextcloud-bot Oct 14, 2025
6712d31
fix(NextcloudDev): add missing template file.
camilasan Oct 13, 2025
dbde1f5
fix: revert 3cd559f
Aiiaiiio Oct 14, 2025
c15e464
fix: Revert "fix: typo in comment"
Aiiaiiio Oct 14, 2025
587b531
fix: Revert "fix: Convert full source paths to relative in logs"
Aiiaiiio Oct 14, 2025
93c1c84
fix: Adding `-fmacro-prefix-map` compiler option to make paths relative
Aiiaiiio Oct 14, 2025
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-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: cpp-linter/cpp-linter-action@7dacd91f6a008a7c714bba700f4d08468a1eb428 # v2.16.4
- uses: cpp-linter/cpp-linter-action@b7fbdde0f6776f478f4d8867c2b746077fa7ea89 # v2.16.5
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux-clang-compile-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
name: Linux Clang compilation and tests
runs-on: ubuntu-latest
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-6.8.1-2
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-trixie-6.8.2-2
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
Expand All @@ -17,7 +17,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_PREFIX_PATH=/opt/qt -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_BUILD_TYPE=Debug -DQT_MAJOR_VERSION=6 -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror -DOPENSSL_ROOT_DIR=/usr/local/lib64
cmake .. -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DQT_MAJOR_VERSION=6 -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror
ninja
- name: Run tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux-gcc-compile-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
name: Linux GCC compilation and tests
runs-on: ubuntu-latest
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-6.8.1-2
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-trixie-6.8.2-2
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
Expand All @@ -17,7 +17,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_PREFIX_PATH=/opt/qt -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_BUILD_TYPE=Debug -DQT_MAJOR_VERSION=6 -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror -DOPENSSL_ROOT_DIR=/usr/local/lib64
cmake .. -G Ninja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DQT_MAJOR_VERSION=6 -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror
ninja
- name: Run tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
persist-credentials: false

- name: REUSE Compliance Check
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
issues: write

steps:
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
- uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
with:
operations-per-run: 1500
days-before-stale: 28
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,9 @@ convert.exe
*state-*.png
theme.qrc
*.AppImage

# Xcode Build Artifacts
DerivedData

# Swift Package Manager Build Artifacts
.swiftpm
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,20 @@ if (NOT DEFINED PACKAGE)
set(PACKAGE "${LINUX_PACKAGE_SHORTNAME}-client")
endif()

set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
set(APPLE_SUPPRESS_X11_WARNING ON)

find_package(ECM 6.0.0 REQUIRED NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://invent.kde.org/frameworks/extra-cmake-modules")

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})

include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMMarkNonGuiExecutable)
include(ECMSetupVersion)

#include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMEnableSanitizers)

include(ECMCoverageOption)

Expand Down
9 changes: 0 additions & 9 deletions LICENSES/BSD-2-Clause.txt

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ If you find any bugs or have any suggestion for improvement, please
> [!TIP]
> For building the client on macOS we have a tool called `mac-crafter`.
> You will find more information about it in [its dedicated README](admin/osx/mac-crafter/README.md).
> Also, please note the [README in the NextcloudIntegration project](shell_integration/MacOSX/NextcloudIntegration/README.md) which provides an even more convenient way to work on and build the desktop client on macOS by using Xcode.

#### 1. 🚀 Set up your local development environment

Expand Down
22 changes: 20 additions & 2 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ precedence = "aggregate"
SPDX-FileCopyrightText = "2014 ownCloud GmbH"
SPDX-License-Identifier = "GPL-2.0-or-later"

[[annotations]]
path = [
"admin/osx/TransifexStringCatalogSanitizer/Package.swift",
"admin/osx/TransifexStringCatalogSanitizer/Package.resolved",
"admin/osx/TransifexStringCatalogSanitizer/README.md",
]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 Nextcloud GmbH and Nextcloud contributors"
SPDX-License-Identifier = "GPL-2.0-or-later"

[[annotations]]
path = ["admin/osx/mac-crafter/Package.resolved", "shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved"]
precedence = "aggregate"
Expand All @@ -42,13 +52,21 @@ SPDX-FileCopyrightText = "2014 ownCloud GmbH, 2022 Nextcloud GmbH and Nextcloud
SPDX-License-Identifier = "GPL-2.0-or-later"

[[annotations]]
path = ["shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj", "shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/contents.xcworkspacedata", "shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist", "shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/xcshareddata/xcschemes/FinderSyncExt.xcscheme"]
path = [
"shell_integration/MacOSX/NextcloudIntegration/.gitignore",
"shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj",
"shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
"shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/xcshareddata/xcschemes/FinderSyncExt.xcscheme",
"shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/xcshareddata/xcschemes/NextcloudDev.xcscheme",
"shell_integration/MacOSX/NextcloudIntegration/README.md"
]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 Nextcloud GmbH and Nextcloud contributors"
SPDX-License-Identifier = "GPL-2.0-or-later"

[[annotations]]
path = ["shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Localizable.xcstrings", "shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Localizable.xcstrings"]
path = ["shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Localizable.xcstrings", "shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Localizable.xcstrings", "shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Assets.xcassets/*", "shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Assets.xcassets/FileProviderDomainSymbol.symbolset/*", "shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Assets.xcassets/*", "shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Assets.xcassets/FileProviderDomainSymbol.symbolset/*"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2015 ownCloud GmbH, 2022 Nextcloud GmbH and Nextcloud contributors"
SPDX-License-Identifier = "GPL-2.0-or-later"
Expand Down
6 changes: 3 additions & 3 deletions VERSION.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# ------------------------------------
# Version information
# ------------------------------------
set(MIRALL_VERSION_MAJOR 3)
set(MIRALL_VERSION_MINOR 17)
set(MIRALL_VERSION_MAJOR 4)
set(MIRALL_VERSION_MINOR 0)
set(MIRALL_VERSION_PATCH 50)
set(MIRALL_VERSION_YEAR 2025)
set(MIRALL_SOVERSION 0)
set(MIRALL_PREVERSION_HUMAN "3.18.0 alpha") # For preversions where PATCH>=50. Use version + alpha, rc1, rc2, etc.
set(MIRALL_PREVERSION_HUMAN "4.1.0 alpha") # For preversions where PATCH>=50. Use version + alpha, rc1, rc2, etc.
set(NCEXT_BUILD_NUM 47)
set(NCEXT_VERSION 3,0,0,${NCEXT_BUILD_NUM})

Expand Down
10 changes: 10 additions & 0 deletions admin/osx/TransifexStringCatalogSanitizer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: GPL-2.0-or-later

.DS_Store
/.build
/Packages
xcuserdata/
DerivedData/
.swiftpm
.netrc
15 changes: 15 additions & 0 deletions admin/osx/TransifexStringCatalogSanitizer/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions admin/osx/TransifexStringCatalogSanitizer/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "TransifexStringCatalogSanitizer",
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.executableTarget(
name: "TransifexStringCatalogSanitizer",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
]
),
]
)
15 changes: 15 additions & 0 deletions admin/osx/TransifexStringCatalogSanitizer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Transifex String Catalog Sanitizer

Sanitize Xcode string catalogs which were pulled from a Transifex online resource.

## Usage

See the integrated help for up to date reference.

```sh
swift run TransifexStringCatalogSanitizer --help
```

## Development

This Swift command-line utility can be easily run and debugged from Xcode.
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
// SPDX-License-Identifier: GPL-2.0-or-later

import ArgumentParser
import Foundation

@main
struct TransifexStringCatalogSanitizer: ParsableCommand {
@Argument(help: "The string catalog file to sanitize.")
var input: String

mutating func run() throws {
let url = URL(fileURLWithPath: input)
let data = try Data(contentsOf: url)

guard var root = try JSONSerialization.jsonObject(with: data) as? [String: Any] else {
throw TransifexStringCatalogSanitizerError.jsonObject
}

guard var strings = root["strings"] as? [String: Any] else {
throw TransifexStringCatalogSanitizerError.missingStrings
}

try sanitizeStrings(&strings)

// Update the root with modified strings
root["strings"] = strings

// Write the processed data back to the original file
let processedData = try JSONSerialization.data(withJSONObject: root, options: [.prettyPrinted, .sortedKeys])
try processedData.write(to: url)
}

private func sanitizeStrings(_ strings: inout [String: Any]) throws {
for key in strings.keys.sorted() {
print("💬 \"\(key)\"")

guard var string = strings[key] as? [String: Any] else {
throw TransifexStringCatalogSanitizerError.missingString
}

guard var localizations = string["localizations"] as? [String: Any] else {
throw TransifexStringCatalogSanitizerError.missingLocalizations
}

try sanitizeLocalizations(&localizations)

// Update the string with modified localizations
string["localizations"] = localizations
strings[key] = string
}
}

private func sanitizeLocalizations(_ localizations: inout [String: Any]) throws {
var localizationsToRemove: [String] = []

for localeCode in localizations.keys.sorted() {
guard let localization = localizations[localeCode] as? [String: Any] else {
throw TransifexStringCatalogSanitizerError.missingLocalization
}

guard let stringUnit = localization["stringUnit"] as? [String: Any] else {
throw TransifexStringCatalogSanitizerError.missingStringUnit
}

guard let value = stringUnit["value"] as? String else {
throw TransifexStringCatalogSanitizerError.missingValue
}

if value.isEmpty {
print("\t❌ \(localeCode): empty, will be removed")
localizationsToRemove.append(localeCode)
} else {
print("\t✅ \(localeCode): \"\(value)\"")
}
}

// Remove empty localizations
for localeCode in localizationsToRemove {
localizations.removeValue(forKey: localeCode)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
// SPDX-License-Identifier: GPL-2.0-or-later

enum TransifexStringCatalogSanitizerError: Error {
case jsonObject
case missingLocalization
case missingLocalizations
case missingString
case missingStrings
case missingStringUnit
case missingValue
}
6 changes: 5 additions & 1 deletion admin/win/msi/collect-transform.xsl.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@
<xsl:key name="vc-redist-64-search" match="wix:Component[contains(wix:File/@Source, 'vc_redist.x64.exe')]" use="@Id" />
<xsl:template match="wix:Component[key('vc-redist-64-search', @Id)]" />
<xsl:template match="wix:ComponentRef[key('vc-redist-64-search', @Id)]" />
</xsl:stylesheet>

<xsl:key name="qt6-webengine-core-pdb" match="wix:Component[contains(wix:File/@Source, 'Qt6WebEngineCore.pdb')]" use="@Id" />
<xsl:template match="wix:Component[key('qt6-webengine-core-pdb', @Id)]" />
<xsl:template match="wix:ComponentRef[key('qt6-webengine-core-pdb', @Id)]" />
</xsl:stylesheet>
3 changes: 2 additions & 1 deletion cmake/modules/AddCMockaTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ endif(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW)

function (ADD_CMOCKA_TEST _testName _testSource)
add_executable(${_testName} ${_testSource})
set_target_properties(${_testName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY})
target_link_libraries(${_testName} ${ARGN})
add_test(${_testName} ${CMAKE_CURRENT_BINARY_DIR}/${_testName})
add_test(${_testName} ${BIN_OUTPUT_DIRECTORY}/${_testName})
endfunction (ADD_CMOCKA_TEST)
Empty file removed cmake/modules/DBusMacros.cmake
Empty file.
Loading
Loading