Commit graph

27 commits

Author SHA1 Message Date
Dale Glass
32b9cc123c Fix resetting the settings
Also minor documentation improvements
2023-06-04 14:50:03 +02:00
Dale Glass
9a828077bd Add Overte e.V. copyright 2022-11-01 20:49:00 +01:00
Dale Glass
7d3b45753c Comment moved to header 2022-11-01 17:16:14 +01:00
Dale Glass
20548b7b24 Fix mysterious UUID issue
Turned out to be a remainant of previous code that stopped working
correctly due to the changes
2022-11-01 17:15:50 +01:00
Dale Glass
24d4f87341 Improve logging system termination. Send a signal and wait until done. 2022-11-01 17:15:16 +01:00
Dale Glass
d722650806 Don't forward a change to QSetting if the setting didn't change
This considerably reduces the number of disk writes
2022-11-01 17:14:10 +01:00
Dale Glass
f7ab2be173 Unimportant changes
Signals were made non-references for debugging, but that shouldn't
actually matter since Qt copies the parameters anyway.
2022-11-01 17:13:30 +01:00
Dale Glass
51e1df5e4c Improve logging, v3 2022-11-01 17:08:08 +01:00
Dale Glass
b540c426c1 Use logging categories 2022-11-01 17:06:33 +01:00
Dale Glass
cdc15d7821 Improve settings system, by moving all writes to a thread
This should complete what was started in the HiFi days but didn't quite succeed.

Setting::Manager is now thread safe, and delegates all settings writes to a thread
that nothing waits on, which should ensure that settings don't degrade performance
even on slow storage devices.

Functions that weren't thread safe were removed from Setting::Manager, and it was
reduced to a key/value store.

Functions that modify state like beginGroup were implemented in the Settings class
instead, which should be created only in the context where it's needed. It will
forward all changes to the manager.

A few QSettings functions were left unimplemented because they're not used in
the code. They may be implemented later if there's a need.
2022-10-23 23:25:42 +02:00
Dale Glass
e960829112 Fix test for the master branch 2022-10-23 16:02:37 +02:00
Dale Glass
0896807ca5 Slight cleanup of tests, use friend class to avoid exposing test functions 2022-10-23 13:24:56 +02:00
Dale Glass
334317b175 Test suite for settings system
Proof of concept still. Adds a test-specific function in Setting::Manager.
2022-10-23 13:24:56 +02:00
Seth Alves
86e502637e Make Settings thread safe 2018-09-21 15:46:35 -07:00
Atlante45
80c0f2a21e Fix crash when passing --checkMinSpec flag
That flag caused a DLL to be loaded before Application was
	instanced.
	This triggers a Qt bug inside Q_COREAPP_STARTUP_FUNC that causes
	the previous registration pointing the startup function in
	the main executable to be overridden with the address of the
	function in the DLL (Since they both link the same static
	library)
	This leads to the correct function running in the wrong address
	space (the DLLs), hence not initializing some global variables
	correctly.
2018-02-22 16:29:38 -08:00
Brad Hefta-Gaub
a72f60152b audit use of QTimer intervals to make sure we're using Qt::PreciseTimer when appropriate 2016-12-29 08:53:37 -08:00
Atlante45
eaca3b672f Switch to JSON for application settings 2016-10-12 10:20:19 -07:00
Seth Alves
45c21ca523 make UNSET_VALUE still work while still returning and empty string value for undefined keys 2016-08-04 13:37:08 -07:00
Seth Alves
4c258b9568 fix bug which caused getValue for a non-existent key to return the integer 2 2016-08-04 10:16:08 -07:00
Bradley Austin Davis
b1c472e82b Fixing settings, even in release builds 2016-06-14 12:16:40 -07:00
Bradley Austin Davis
d52a1fe6f9 Fix persistence for global scope settings handles, clean up invalid variants in settings 2016-06-14 09:49:38 -07:00
Brad Davis
65d8f65ed7 Fix unix builds, make settings ACID 2016-06-04 18:39:46 -07:00
Brad Davis
39dcd1f9bd Eliminate file IO contentions for the settings 2016-06-04 17:55:30 -07:00
Seth Alves
db5c6d80d2 possibly fix a couple of crashes 2016-03-17 10:31:54 -07:00
Stephen Birarda
78942b0a87 let QSettings destructor call Setting::Manager sync 2015-05-08 15:49:28 -07:00
Atlante45
f0b5cd195d Renaming + end of file spaces 2015-02-02 18:37:49 -08:00
Atlante45
9abdb41764 Rearrange settings classes in correct files 2015-02-02 17:17:19 -08:00