project dirtying for the lifetime of an object
Python code can then call:
project = QgsProject.instance()
with QgsProject.blockDirtying(project):
# do something
Use QgsProjectDirtyBlocker to prevent projects being marked as
dirty while creating a new project or while loading an existing
project -- avoids the titlebar temporarily showing the project
state as unsaved while it is being loaded.
This allows the project home path (which is used by the browser
to create the 'Project Home' item) to be set by users for a
project, instead of always matching the location where the project
is saved.
This allows users to set the project home to a folder which contains
data and other content, and is especially useful for organisations
where qgis projects are not stored in the root folder of a organisational
'project'.
Project home paths can also be set to relative paths, in which
case they will be relative to the project saved location.
The path can be set through the Project Properties dialog, or
by right-clicking on the Project Home browser item and
selecting 'set project home'
Sponsored by SMEC/SJ
- Switch to flags instead of boolean argument
- Move logic for layer validity to canRunUsingLayer
- Add unit test
Also remove settings flag to hide duplicate features action
This fixes issues in situations when there are multiple vertices in one location:
1. when clicking a location, if there are selected features,
the closest vertex from a selected feature will be used with priority.
2. when dragging a rectangle, if there is a selected feature,
only vertices from selected features will be used.
If there is selection in any editable layers, but away from the location where
user clicked to pick vertex (or dragged rectangle to pick multiple vertices),
the existing vertex tool behavior is not affected (so it cannot happen that
vertex tool suddenly appears to have stopped working just because there is
selection somewhere possibly outside of the current map view).