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

List:       kde-core-devel
Subject:    Re: mocking kcontrol infrastructure for quick kontrol module test
From:       Matthias Kretz <kretz () kde ! org>
Date:       2006-08-27 19:02:18
Message-ID: 200608272102.22488.kretz () kde ! org
[Download RAW message or body]


On Sunday 27 August 2006 18:45, Andriy Rysin wrote:
> Can somebody tell me how that could be done with new KGenericFactory
> approach?
>  If I just change to LayoutConfig(window, emptyStringList) it asserts in
> kcmodule.cpp

That's because the LayoutConfig ctor passes LayoutConfigFactory::instance() to 
the KCModule ctor for the KInstance pointer (which of course is 0 as 
LayoutConfigFactory was not created).

The correct way to do it, of course, is to use KCModuleLoader from libkutils. 
You should also be able to do it using KLibLoader. How you do it without 
having to link your application against a plugin (i.e. not a shared lib) I 
don't know for certain (perhaps I don't want to know), but you could try to 
call the init_keyboard_layout method which returns a LayoutConfigFactory 
which in turn will create an instance of LayoutConfig for you.

-- 
C'ya
        Matthias
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz@gmx.net, kretz@kde.org,
Matthias.Kretz@urz.uni-heidelberg.de

[Attachment #3 (application/pgp-signature)]

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

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