org.kde.koala
public class KConfigGroupSaver extends Object implements QtSupport
String oldgroup config.group(); config.setGroup( "TheGroupThatIWant" ); ... config.writeEntry( "Blah", "Blubb" ); config.setGroup( oldgroup );In order to facilitate this task, you can use KConfigGroupSaver. Simply construct such an object ON THE STACK when you want to switch to a new group. Then, when the object goes out of scope, the group will automatically be restored. If you want to use several different groups within a function or method, you can still use KConfigGroupSaver: Simply enclose all work with one group (including the creation of the KConfigGroupSaver object) in one block. KConfigGroup provides similar functionality in a more object oriented way.
See Also: KConfigBase KConfig KSimpleConfig KConfigGroup
UNKNOWN: Helper class for easier use of KConfig/KSimpleConfig groups.
Constructor Summary | |
---|---|
protected | KConfigGroupSaver(Class dummy) |
KConfigGroupSaver(KConfigBase config, String group)
Constructor. |
Method Summary | |
---|---|
KConfigBase | config() |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
protected void | finalize() Deletes the wrapped C++ instance |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
Parameters: config The KConfigBase-derived object this KConfigGroupSaver works on. group The new group that the config object should switch to.
UNKNOWN: Constructor.