This forum has been archived. All content is frozen. Please use KDE Discuss instead.

question about KConfig

Tags: None
(comma "," separated)
fluca1978
Registered Member
Posts
81
Karma
0
OS

question about KConfig

Mon Jun 04, 2012 2:24 pm
Hi all,
I don't understand if this is the normal behavior/pattern, but if I want to update the configuration of an application I have first to remove/delete the configuration group (or each entry) and then write it again. That is, my application on exit does the following:

Code: Select all
 slaveConfigPtr->deleteGroup( "version" );
  KConfigGroup cgVersion = slaveConfigPtr->group( "version" );
  cgVersion.writeEntry( ... );
 


being slaveConfigPtr a KSharedConfig::Ptr type obtained from a kioslave instance as follows:

Code: Select all
KComponentData instance( "kio_rolefs" );  // in kdemain
slaveConfigPtr = slaveInstance.config();


Is this correct or is there a smarter way to "update" a section of the configuration file?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: question about KConfig

Thu Jun 07, 2012 5:52 am
Usually KDE applications update their configuration file as changes are made - or when the Apply button is pressed. All existing values are left untouched.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft