-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Instead of reloading a whole project, reset data sources #5343
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
🎉 Ta-daaa, freshly created APKs are available for a6ee8c9: arm64-android |
@@ -83,7 +85,15 @@ bool QFieldAppAuthRequestHandler::handleLayerLogins() | |||
} | |||
else | |||
{ | |||
emit reloadEverything(); | |||
const QList<QgsMapLayer *> mapLayers = QgsProject::instance()->mapLayers().values(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we inject the QgsProject
instead (as a property)?
It's already here: https://github.com/opengisch/QField/blob/master/src/core/qgismobileapp.cpp#L264 and the appauthrequesthandler is created in the same source file, so could easily be injected.
{ | ||
if ( !mapLayer->isValid() && mapLayer->dataProvider() ) | ||
{ | ||
mapLayer->setDataSource( mapLayer->source(), mapLayer->name(), mapLayer->dataProvider()->name() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, that forces a reload of the datasource?
If that's the goal of this line, a comment would be justified, that's not immediately clear for a reader.
A good thing 👍 |
ATM, we force reload a whole project to apply credentials for as few as a single layer. Let's be more surgical about things :)
@m-kuhn , keen to hear what you think of this alternative approach.