List Info

Thread: KConfigSkeleton - problems when resetting value back to default




KConfigSkeleton - problems when resetting value back to default
country flaguser name
Germany
2007-03-08 09:11:51
Hello list!

I'm new to kde - development.
I have written a small test for this KConfig XT thing and
found a problem when 
setting string-data back to a provided default value.
Reproduction is easy, first the string must be changed and
applied and then 
set back to default and applied again.
The data inside the Preferences-class is still the old one.

I had a short look in KConfigSkeleton and it seems, that
revertToDefault() try 
to look up the default value in data which are loaded from
the ini-files, 
where it can't be found i think.
With a small change (which i added as diff) it works. I know
that can't be the 
final solution...  but I
wanted to report this, so somebody who is familiar 
with KConfig-stuff can help solving it more elegant and more
complete .

Also it is possible that there is a error in my code or
configuration. Here is 
the
link to my testapp (cmake . && make &&
./src/test): 
http://homepages.fh-regensburg.de/~wea35436/configt
est.tar.gz
Which can be used to reproduce.

greetings,
Antonio

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

  
Re: KConfigSkeleton - problems when resetting value back to default
country flaguser name
Canada
2007-03-08 12:28:27
On March 8, 2007, Antonio Weber wrote:
> I'm new to kde - development.

welcome to kde =))

> I have written a small test for this KConfig XT thing
and found a problem
> when setting string-data back to a provided default
value.

thanks for the excellent test case. i was able to reproduce
it, indeed. turns 
out it was a problem in the INI backend where it was
aborting the writing of 
the file if there were no entries (e.g. an empty file). nice
optimization, 
except that if there was a previously existing file it was
not being removed, 
and therefore all the changes were lost.

fixed in svn; great catch! =)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1
A7F1 DB43

Full time KDE developer sponsored by Trolltech (http://www.trolltech.com
)

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Re: KConfigSkeleton - problems when resetting value back to default
user name
2007-03-08 13:32:17
Hi all,

on Thursday 08 March 2007 19:28, Aaron J. Seigo wrote:

> On March 8, 2007, Antonio Weber wrote:
> > I'm new to kde - development.
>
> welcome to kde =))
>
> > I have written a small test for this KConfig XT
thing and found a
> > problem when setting string-data back to a
provided default value.
>
> thanks for the excellent test case. i was able to
reproduce it, indeed.
> turns out it was a problem in the INI backend where it
was aborting the
> writing of the file if there were no entries (e.g. an
empty file). nice
> optimization, except that if there was a previously
existing file it was
> not being removed, and therefore all the changes were
lost.
>
> fixed in svn; great catch! =)

Yes, great catch. Would it be feasible to fix that in the
3.5 branch as 
well so that all applications using KConfigXT (eg. KMyMoney)
benefit from 
this improvement?

-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
------------------------------------------------------------
-
Las Vegas - Mecca of experimental statistics. (Jens
Hoffmann)
------------------------------------------------------------
-

 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )