Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dev:config_groups_config_groups [2009/08/14 16:15]
michael created
dev:config_groups_config_groups [2018/02/07 16:07]
Line 1: Line 1:
-====== QSettings Config Groups ====== 
-Rosegarden currently uses a mixture of idioms after the conversion to use QSettings for storing user preferences.  The first type of code looks like: 
- 
-<code c++> 
-    QSettings.settings; 
-    settings.beginGroup("Lazy Options Directly in a String"); 
-    ... 
-</code> 
- 
-The second type of code looks like: 
- 
-<code c++> 
-    #include "misc/ConfigGroups.h" 
-    ... 
-    QSettings settings; 
-    settings.beginGroup(SomeOptionsConfigGroup); 
-</code> 
- 
-It is always preferable to use the second idiom whenever you have some new need of a new settings category.  Take the time to edit and include misc/ConfigGroups.h, and use the constant defined there throughout the code.  This does mean some extra work and compile time, but in the long run having the discipline to use ConfigGroups.h throughout lowers our chances of having stupid settings-related bugs where one piece of code reads from "Lazy Options Directly in a String" and another piece writes to "LazyOptionsDirectlyinaString" or what have you. 
- 
-I would go so far as to say that whenever you encounter the lazy type, it would be good to take a moment to go fix it.  There aren't too many of the lazy type left, and we could make them go away pretty quickly, and avoid future "settings amnesia" bugs. 
- 
-Whether you take it upon yourself to do these cleanups or not, please use ConfigGroups.h in any new code.  Also, please feel free to create new ConfigGroups as seems appropriate.  For example, when I did the work to make windows remember their positions, I put all window positions into the same ConfigGroup for consistency across the application, and easy block copying of the code snippet to make the save/restore work.  You certainly don't need to feel limited to the ConfigGroups that already exist. 
  
 
 
dev/config_groups_config_groups.txt ยท Last modified: 2022/05/06 16:07 (external edit)
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki