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

Always track file-based layers in QFieldCloud #5118

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

Conversation

suricactus
Copy link
Collaborator

If the layer is configured as "NO_ACTION" for QFieldCloud, then this layer is never tracked for changes in QFieldCloud. This means any changes on this layer will never reach QFieldCloud.

This development ignores whatever is configured as cloud action. When the layer is file-based and it is not configured as "REMOVE", then the layer will be tracked by QFielCloud.

If the layer is configured as "NO_ACTION" for QFieldCloud, then this
layer is never tracked for changes in QFieldCloud. This means any 
changes on this layer will never reach QFieldCloud.

This development ignores whatever is configured as cloud action. When
the layer is file-based and it is not configured as "REMOVE", then the
layer will be tracked by QFielCloud.
@duke-nyuki
Copy link

@qfield-fairy
Copy link
Collaborator

qfield-fairy commented Mar 22, 2024

Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

}

if ( !layer->dataProvider() )
{
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: implicit conversion 'const QgsDataProvider *' -> bool [readability-implicit-bool-conversion]

Suggested change
{
if ( layer->dataProvider() == nullptr )


QgsProviderMetadata *providerMetadata = QgsProviderRegistry::instance()->providerMetadata( layer->dataProvider()->name() );
QVariantMap metadata = providerMetadata->decodeUri( layer->source() );

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'metadata' of type 'QVariantMap' (aka 'QMap<QString, QVariant>') can be declared 'const' [misc-const-correctness]

Suggested change
QVariantMap const metadata = providerMetadata->decodeUri( layer->source() );

if ( resolvedFilename.startsWith( QStringLiteral( "localized:" ) ) )
{
return QFile::exists( resolvedFilename.mid( 10 ) );
}
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]

    return QFile::exists( resolvedFilename.mid( 10 ) );
                                                ^

/**
* Returns if the \a layer is a file-based or a remote layer.
*
* @param layer to be checked
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: member variable 'username' has public visibility [misc-non-private-member-variables-in-classes]

    QString username;
            ^

* Returns if the \a layer is a file-based or a remote layer.
*
* @param layer to be checked
* @return const bool true if the layer is file-based
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: member variable 'email' has public visibility [misc-non-private-member-variables-in-classes]

    QString email;
            ^

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

Successfully merging this pull request may close these issues.

None yet

4 participants