Skip to content

Preferences transaction scope guard for temporary prefs

Martin Owens requested to merge doctormo/inkscape:temporary-preferences into master

A lot of inkscape's actions and processes require the changing of preferences.

But we often don't have good control over the preferences transaction, causing preferences to be reset manually. Which is fragile and prone to errors.

This adds a scope guard which rolls back any preferences changes when the scope ends.

Only one transaction can exist at a time, but a lot of these temporary preferences may happen on top of each other. So we support the top-most guard and do nothing for any of the inner calls.

Additional fix: The preferences tests have been brought back from the graveyard and a new test is added to make sure this feature works.

Merge request reports