[PATCH] New configDialogSize() and saveDialogSize() methods

Christian Loose christian.loose at hamburg.de
Tue Jan 21 23:56:31 GMT 2003


Am Mittwoch, 22. Januar 2003 00:25 schrieb Simon Hausmann:
> On Tue, Jan 21, 2003 at 11:49:01PM +0100, Christian Loose wrote:
> > > Any opinion on my thoughts regarding passing a KConfig reference
> > > instead of a pointer?
> > >
> > > Simon
> >
> > You are right. I forgot to answer your question. Sorry!
> >
> > I don't know. Most methods return a pointer to KConfig like
> > KGlobal::config() etc. So if you changed it to passing a KConfig
> > reference instead, you would have to call it like this
> >
> > configDialogSize( *config, "Dialog" );
> >
> > instead of
> >
> > configDialogSize( config, "Dialog" );
> >
> > Also what happens if config is null?
>
> I don't think it makes sense to call these methods with a null
> pointer, and KGlobal::config() never returns a null pointer either.
>
> Maybe it's a matter of taste though.

You are right. It doesn't make sense to call these methods with a null pointer 
and maybe it's a good thing to document this fact by using a KConfig 
reference. Then you might need to check the KConfig pointer on the caller 
side of these methods, when you are not sure that the pointer can't be null. 
But I think thats okay.

Okay, I will make a new patch. But before, I really need some sleep.. :-)

>
> Simon





More information about the kde-core-devel mailing list