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

List:       koffice-devel
Subject:    KInstance, KGlobal and dirs.
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2005-10-23 19:32:41
Message-ID: 200510232132.42237.boud () valdyas ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Krita used to pass its KoFactory derived KisFactory around so everyone could 
get at the KInstance and thus at the dirs and so. But reading the 
documentation, I thought that that was wrong, and that I should ask KGlobal 
for the dirs -- like this:

KInstance* KisFactory::instance()
{
    if ( !s_instance )
    {
        s_instance = new KInstance(s_aboutData);
        s_instance -> dirs() -> addResourceType("kis_profiles",
                          KStandardDirs::kde_default("data") + 
"krita/profiles/");
    }
}

And then from somewhere else, I do:

KisMetaRegistry::KisMetaRegistry()
{
    // Create the colorspaces and load the profiles

    QStringList profileFilenames;
    profileFilenames += KGlobal::dirs() -> findAllResources("kis_profiles", 
"*.icm");
   ...
}

My assumption was that this should work -- and given the documentation, I 
guessed I shouldn't call KGlobal::activeInstance() or something like that. 
What am I doing wrong?

-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi

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

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


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

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