[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: KConfig
From: Michael Kropfberger <michael.kropfberger () gmx ! net>
Date: 1999-02-24 13:11:13
[Download RAW message or body]
Rik Hemsley wrote:
>
> >... the writeEntry always changes the pValue immediately just by the
> >call itself!!!
> [...]
> >Please somebody help me!
>
> Ok I tried to reproduce your problem but couldn't repeat your results.
> A brief glance at kconfig.cpp from kdelibs-1.1 gives me the impression that
> nowhere is your data modified. Still, I made a test program
> that behaves in a similar way to yours and tried it. It seems that there is
> likely a bug in your program (sorry but if I can't find why it happens in
> the
> library code and if I can't reproduce it...).
>
> I have seen this happen before - My brain for some reason told my fingers to
> write something like this:
>
> const char * crazyFunction()
> {
> QString s = "Whee ! I'm going to die !";
> return s;
> }
>
> Bang. s gets destroyed as crazyFunction returns. I thought I was safe and
> no-one would ever know I had been this foolish, but it looks like my
> secret's
> out.
>
but this is exactly what kconfig is doing...
in const char* KConfigBase::writeEntry( const char* pKey, const char*
pValue, ...
there is this QString aValue; which is returned at the end!
But even if it returns a broken/invalid aValue, it should set the right
value
internally and shouldn't touch/change the given param pValue...
bye,
Mike
--
< ....need an upgrade to Windoze95 or better? install LINUX! >
< To iterate is human, to recurse divine. -- L. Peter Deutsch >
<---------------------------------------------------------------------->
< /+++/ Michael Kropfberger (mailto:michael.kropfberger@gmx.net) >
< A-9074 Keutschach 58, Tel.: (04273) 30 41 or (+43664)1233 068 /+++/ >
<---------------------------------------------------------------------->
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic