A new class QgsPathResolver is introduced for conversion between absolute
and relative paths when reading/writing XML.
Cleaned up code in layer definition file support (.qlr) to better handle
relative/absolute path conversion.
This allows users to set a timer interval in layer properties
for individual layers. These layers will be automatically refreshed
at a matching interval.
Canvas updates are deferred in order to avoid refreshing multiple
times if more than one layer has an auto update interval set.
Additionally, logic has been added to skip any auto redraws of
the canvas while the canvas is already being redrawn. This avoids
issues caused by setting a layer auto refresh to a shorter time than
is required to redraw the canvas.
By calling QgsMapLayer::triggerRepaint( true ) any cached
version of the layer will be invalidated, but a map canvas
refresh won't automatically be triggered
This allows invalidation of cached images while deferring
the actual map update until the next canvas refresh.
Motivations:
- consistency - we generally use expanded names, and this also
matches Qt API which uses Database instead of Db
- avoids unpredictable capitalization throughout API (mix of "Db"
and "DB")
This allows pieces of code that depend on map layers to listen directly
to the layer's notification rather than having to listen to project's
layersWillBeRemoved signal (and cycle through the whole list)
This allows to declare data dependencies between layers. A data
dependency occurs when a data modification in a layer, not by direct
user manipulation may modify data of other layers.
This is the case for instance when geometry of a layer is updated by a
database trigger after modification of another layer's geometry.
- rename methods with XML to Xml, CRS to Crs, WMS to Wms, ID to Id
- rename methods with SRS to Crs
- rename methods with abbreviations like "dest" to "destination"
- rename methods with abbreviations like "src" to "source"
The current approach of testing !vl || vl->geometryType() != NoGeometry
is not intuitive and has been the source of 2 recent bugs.
Replacing these tests with the new isSpatial() function makes it
immediately obvious what is being tested. It also allows for
non-spatial plugin layers to be correctly handled by overriding
this method.
A number of elements have both a <Name> and a <Title>. The Name is a text string used for machine-to-machine
communication while the Title is for the benefit of humans. For example, a dataset might have the descriptive Title
“Maximum Atmospheric Temperature” and be requested using the abbreviated Name “ATMAX”.
User can already set title for layers, groups and project. OWS name is based on the name used in layer tree. This name is more a label for humans than a name for machine-to-machine communication.
To add the capability to users to define Name as a text string for machine-to-machine communication, this pull-request adds:
* short name line edits to layers properties
* WMS data dialog to layer tree group (short name, title, abstract)
* short name line edits to project properties
* add a regexp validator "^[A-Za-z][A-Za-z0-9\._-]*" to short name line edit accessible through a static method
* add a TreeName element in the fullProjectSettings
If a short name has been set for layers, groups and project it is used by QGIS Sever as the layer name.
Rationale:
- there was a lot of large objects passed by value, so potentially
there's a speed bump from this
- even for implicitly shared classes like QString/QList there's still
a (small) cost for copying the objects when there's no reason to
- it's the right thing to do!
- style manager is always enabled (client code does not need to distinguish between enabled/disabled state)
- layers currently active style is stored only in QgsMapLayer - in style manager it has entry with no data (avoids duplication of data)
This also solves issues with visibility presets and styles when some presets do not have stored style