KConfig borkage
Jeff Mitchell
kde-dev at emailgoeshere.com
Sun Oct 28 07:16:41 GMT 2007
I'm seeing some odd, reproduceable behavior in my amarokrc file. kdelibs was
built from SVN about 12 hours ago.
There is a [PortableDevices] section that is occasionally added to or deleted
from. The problem is that whenever the last (positionally, not numerically)
entry is removed, it's not actually removed, but rather gets corrupted
somehow.
Example:
If I start out with this:
[PortableDevices]
manual|mtp|(null)=mtp-mediadevice
manual|generic|/mnt/usbdisk=generic-mediadevice
and in my program I run code to remove the first entry:
KConfigGroup config = Amarok::config( "PortableDevices" );
config.deleteEntry( "manual|mtp|(null)" );
then after the program exits I'm left with:
[PortableDevices]
manual|generic|/mnt/usbdisk=generic-mediadevice
as expected. However, if I then run code to remove the other device:
KConfigGroup config = Amarok::config( "PortableDevices" );
config.deleteEntry( "manual|generic|/mnt/usbdisk" );
then when the program exits I'm left with:
[PortableDevices]
manual|generic|/mnt/usbdisk[$d]
Which isn't what I expect.
Similarly, if I start out with:
[PortableDevices]
manual|generic|/mnt/usbdisk=generic-mediadevice
manual|mtp|(null)=mtp-mediadevice
and run code to remove the second one, I'm left with the following:
[PortableDevices]
manual|generic|/mnt/usbdisk=generic-mediadevice
manual|mtp|(null)[$d]
Is this expected behavior, or is something wonky in KConfig?
Thanks,
Jeff
More information about the kde-core-devel
mailing list