Skip to content

Instantly share code, notes, and snippets.

View t-book's full-sized avatar
💭
reading

Toni t-book

💭
reading
View GitHub Profile
tonischonbuchner@MacBook-Pro-von-Toni ~/dev/github/csgis/QFieldCloud $% git diff
diff --git a/docker-app/qfieldcloud/filestorage/backend.py b/docker-app/qfieldcloud/filestorage/backend.py
index 7854ddcb..0b5aab18 100644
--- a/docker-app/qfieldcloud/filestorage/backend.py
+++ b/docker-app/qfieldcloud/filestorage/backend.py
@@ -25,12 +25,17 @@ class QfcBackendStorageMixin(ABC):
"Subclassing QFC specific storages must implement this method."
)
- def patch_nginx_download_redirect(self, response: HttpResponse) -> None:
#!/usr/bin/env bash
#
# migrate_minio_to_webdav.sh
# ---------------------------------------------------------------------------
# rclone copy of an entire minio (S3) bucket to a WebDAV server. No DB changes.
#
# With django-storages (QFC_IS_LEGACY: false) every object path is already the
# path the WebDAV backend expects, so it's a 1:1 object copy. Covers all
# prefixes (projects/, account/, ...). rclone creates parent collections.
# Idempotent: copy never deletes and skips same-size objects, so it's re-runnable.
@t-book
t-book / test.yml
Created April 30, 2026 14:38
test.yml
services:
nextcloud:
image: nextcloud:30
ports:
- "8088:80"
environment:
NEXTCLOUD_ADMIN_USER: admin
NEXTCLOUD_ADMIN_PASSWORD: admin
SQLITE_DATABASE: nextcloud
volumes:
@t-book
t-book / qfieldCloud improvements.md
Last active April 10, 2026 09:00
qfieldCloud improvements.md

1. Mutable default argument in permission_check

https://docs.quantifiedcode.com/python-anti-patterns/correctness/mutable_default_value_as_argument.html

File: docker-app/qfieldcloud/core/permission_check.py, line 9

The check_args parameter uses a mutable list [] as its default value. While it doesn't seem to be mutated in the current code, this is a common Python footgun — if anyone ever adds an in-place modification down the line, the shared list would cause hard-to-trace bugs across decorated views.

Current code:

/*
================================================================================
MATERIALISIERTE VIEW: Grabstellen mit intelligenter Punktplatzierung
================================================================================
ZWECK:
Diese materialisierte View erstellt für jede Grabstelle (Polygon) einen
optimalen Textplatzierungspunkt samt Rotation für die Kartendarstellung.
HAUPTPROBLEM:
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import org.qfield
import org.qgis
import Theme
Item {
id: plugin
SECTION("ReadFileContent")
{
// Create a temporary file with known content
QTemporaryFile tempFile;
REQUIRE(tempFile.open());
const QString testContent = "This is test content for file reading";
tempFile.write(testContent.toUtf8());
tempFile.flush();
// ===> In fileutils.h
/**
* Reads the entire content of a file and returns it as a byte array.
* @param filePath The path to the file to be read
* @return The file content as a QByteArray
*/
Q_INVOKABLE static QByteArray readFileContent(const QString &filePath);
/**
* Writes content to a file.