Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch-only support for external storage (WebDAV/AWS 3) within the attachment editor widget #6067

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

nirvn
Copy link
Member

@nirvn nirvn commented Mar 8, 2025

This PR implements a fetch-only (i.e. read-only) support for external storage-driven attachment editor widget, i.e. when a given attribute's editor widget is configured like this in QGIS:

image

This is a nice step towards on-demand content for attachments, and increase our (already quite high) attribute form interoperability between QField and QGIS.

@qfield-fairy
Copy link
Collaborator

qfield-fairy commented Mar 8, 2025

prepareValue("");
if (config["StorageAuthConfigId"] !== "" && !iface.isAuthenticationConfigurationAvailable(config["StorageAuthConfigId"])) {
mainWindow.displayToast(qsTr("The external storage's authentication configuration ID is missing, please insure it is imported into QField"), "error", qsTr("Learn more"), function () {
Qt.openUrlExternally('https://docs.qfield.org/how-to/authentication/');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant PR that improves this page: opengisch/QField-docs#535


Q_PROPERTY( Qgis::ContentStatus status READ status NOTIFY statusChanged )
Q_PROPERTY( QString type READ type WRITE setType NOTIFY typeChanged )
Q_PROPERTY( QString lastError READ lastError NOTIFY lastErrorChanged );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only this Q_PROPERTY have a ; ?

/**
* Sets the current external storage type string. The type string must be tied to an
* external storage object that was added in the QgsApplication::externalStorageRegistry().
*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line, right?

@@ -451,6 +452,7 @@ void QgisMobileapp::initDeclarative( QQmlEngine *engine )
qmlRegisterType<DrawingCanvas>( "org.qfield", 1, 0, "DrawingCanvas" );
qmlRegisterType<SubModel>( "org.qfield", 1, 0, "SubModel" );
qmlRegisterType<ExpressionVariableModel>( "org.qfield", 1, 0, "ExpressionVariableModel" );
qmlRegisterType<ExternalStorage>( "org.qfield", 1, 0, "ExternalStorage" );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we refactor the module identifier and version into variables to improve maintainability and avoid duplication?
Suggested implementation:

const char* QML_MODULE_NAME = "org.qfield";
const int QML_MODULE_MAJOR_VERSION = 1;
const int QML_MODULE_MINOR_VERSION = 0;

This will allow for easier updates to the module identifier and version in the future, ensuring consistency across the codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants