[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    RE: KInstance problems
From:       David Faure <David.Faure () cramersystems ! com>
Date:       1999-10-29 7:51:14
[Download RAW message or body]

> Hi,
> 
> what should you do, when you need stuff from KGlobal, but you're not
> having a KApplication?
create a KInstance is the answer.

> E.g. currently you can't use KConfig without a KInstance/KApplication,
> because KConfig uses KGlobal::dirs(), which is only available 
> when there is a KInstance.
... which makes sense.

> Should anyone needing KGlobal, KConfig and most possibly other classes
> before KApplication create a temporary KInstance itself? The 
> destructor of KInstance should then set KGlobal::_instance to 0
... only if the destructed instance _was_ KGlobal::_instance.
Think about koffice apps which have one instance per lib :)

> so that the KApplication
> object can become the next KGlobal::_instance.
Yes, this makes sense.

> And we'd need to have a policy: before calling any methods in 
> kdelibs, you
> need to have either a KInstance or KApplication.
> Is this correct?
Yes.

--
David Faure
faure@kde.org - KDE developer
david@mandrakesoft.com - Mandrake
david.faure@cramersystems.com - Cramer Systems

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic