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

fix loading of the default style from QML file (fix #21691) #14660

Merged
merged 2 commits into from May 27, 2019

Conversation

@alexbruy
Copy link
Contributor

commented May 24, 2019

Description

When loading a layer QGIS tries also to apply default style to it and one of the options for default style is a QML file with the same name as layer file. This works fine for simple layers like shapefiles, but fails when layer URI is not a canonical file path, e.g. for GeoPackages (/path/to/layer|layername=name) or delimited text or SpatiaLite.

This PR is an attempt to partially fix the issue and allows loading default style from the QML file with the same name as GeoPackage/SpatiaLite/CSV layer file has. Note that it will work only for GeoPackage/SpatiaLite files containing single layer and when QML file has the same name as GeoPackage/SpatiaLite, not with the name of the layer inside it.

Fixes https://issues.qgis.org/issues/21691. With tests

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and contain sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit
@luipir
luipir approved these changes May 24, 2019

@nyalldawson nyalldawson merged commit 5ef63df into qgis:master May 27, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@alexbruy alexbruy deleted the alexbruy:default-style branch May 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.