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
[project] Avoid needlessly dirtying when written value does not change #8470
Conversation
Upon advise from @nyalldawson , I went for a lower level solution, which avoids needless dirtying of project in other parts of QGIS (for e.g., for an impractical example: opening and closing a decoration dialog won't dirty the project if none of the settings are modified). |
Note: it also improves the way isDirtyChanged is emitted, whereas before it was a/ emitted prior to the entry was written, and b/ emitted irrespective of whether the entry was actually written. |
...and that's why you make the big bucks ;) |
c1995e8
to
f8c4ee2
Compare
@nyalldawson , OK to merge (and backport) upon travis turning green? |
Better leave it a day or so for wider feedback, QgsProject is critical stuff |
@wonder-sk , @m-kuhn , your review would be appreciated here. |
*/ | ||
QgsProjectProperty *addKey_( const QString &scope, | ||
const QString &key, | ||
QgsProjectPropertyKey *rootProperty, | ||
const QVariant &value ) | ||
const QVariant &value, | ||
bool &propertiesModified ) |
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.
why not use directly setDirty inside addKey_ when necessary?
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.
@luipir , because we'd have to pass on a QgsProject pointer to do that, which doesn't seem to be a good idea to begin with :)
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.
has ok, I supposed addKey_ was a private QgsProject member, sorry for the noise
Looks good to me |
Description
@nyalldawson , this PR avoids needlessly dirtying project when exporting a layout by checking if the export path is modified instead of always re-writing the last export path into the project.
Checklist
fixes #11111
in the commit message next to the description[FEATURE]
in the commit message[needs-docs]
in the commit message and contain sufficient information in the commit message to be documentedscripts/prepare-commit.sh
script before each commit