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

List:       kde-devel
Subject:    Re: KConfig
From:       Albert Chin-A-Young <china () thewrittenword ! com>
Date:       2000-10-21 14:38:04
[Download RAW message or body]

On Sat, Oct 21, 2000 at 10:26:34AM +0200, Stephan Kulow wrote:
> Albert Chin-A-Young wrote:
> > 
> > I'm trying to set up the rPaths entry for the kview config file. kview
> > uses kimageio to load the image files depending on the type of graphic
> > being loaded. kimageio.cpp has the following function:
> > 
> > KImageIOFormat::KImageIOFormat( const QString &path)
> >   : KSycocaEntry(path)
> > {
> >    bLibLoaded = false;
> >    mReadFunc = 0;
> >    mWriteFunc = 0;
> >    KConfig config(path, true, false);
> > 
> >    config.setGroup("Image Format");
> >    mType = config.readEntry("Type");
> >    mHeader = KURL::decode_string(config.readEntry("Header"));
> >    mFlags = config.readEntry("Flags");
> >    bRead = config.readBoolEntry("Read");
> >    bWrite = config.readBoolEntry("Write");
> >    mSuffices = config.readListEntry("Suffices");
> >    mPattern = config.readEntry("Name");
> >    mMimetype = config.readEntry("Mimetype");
> >    mLib = config.readEntry("Library");
> >    rPaths = config.readListEntry("rPaths");
> > }
> > 
> > Does this mean I have an entry in ~/.kde/share/config/kviewrc like so:
> >   [Image Format]
> >   rPaths=/opt/TWWfsw/kde20/lib
> > 
> > Also, can I set a global configuration file where I can set rPaths for
> > all programs?
> > 
> Yes, KConfig merges kdeglobals in it, so you can just add the rPaths
> entry there

Do you know if my example entry above is correct? It doesn't appear to
work as I placed a printf statement to print out the rPath entries in
kimageio.cpp but the first puts works while no entries get printed for
paths being added by lt_dladdsearchdir():

KImageIOFactory::KImageIOFactory() : KSycocaFactory( KST_KImageIO )
{
  _self = this;
  if (m_str)
  {
     // read from database
     (*m_str) >> mReadPattern >> mWritePattern >> rPath;
     if (!formatList)
     {
        formatList = new KImageIOFormatList();
        lt_dlinit(); // Do this only once!
        // Add rPaths.
puts ("a");
        for(QStringList::Iterator it = rPath.begin();
            it != rPath.end(); ++it) {
           lt_dladdsearchdir( (*it).ascii());
printf ("lt_dladdsearchdir: %s", (*it).ascii());
        }
     }
     load();

BTW, once I am able to set a global rPaths in
~/.kde/share/config/kdeglobals and having fixed a bug in ltdl.c
regarding loading of dependency libraries recently reported on the
libtool mailing list, it should not be necessary to set either
LTDL_LIBRARY_PATH or LD_LIBRARY_PATH under Solaris and, methinks, any
other OS that libtool's ltdl supports.

-- 
albert chin (china@thewrittenword.com)
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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