mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-25 00:05:24 -04:00
This adds a mechanism where flushes of QgsSettings to the underlying ini storage file can be temporarily suspended. It is intended for code paths where many settings entries are consecutively read/written, to avoid the very expensive cost of constructing and destructing multiple QgsSettings objects for each in turn. When QgsSettings::holdFlush() is called, then a temporary thread local QgsSettings object will be created and ALL access to settings entries will use this same object (preventing flushing of it to ini files). An accompanying QgsSettings::releaseFlush() call MUST be made from the same thread to destroy the thread local QgsSettings, flush it to disk, and resume normal operation. This helps avoid the VERY costly backward migration of settings, and cuts the run time for qgis_process commands like `qgis_process list` by at least half (and considerably more in common setups).