KStandardDirs and documentation on trunk

David Faure faure at kde.org
Sun May 20 23:55:46 BST 2007

On Saturday 19 May 2007, Alex Merry wrote:
> On Saturday 19 May 2007, Philip Rodrigues wrote:
> > Hi,
> > I'm trying to work out what technical things need to be done to make
> > sure the toolchain for creating/viewing documentation is ready in KDE
> > 4. The first problem I've noticed is that the help:/ ioslave calls
> > KGlobal::dirs()->resourceDirs("html") to find out where the
> > documentation is stored, and gets an empty QStringList back. A few
> > other people have confirmed this on different systems. I didn't
> > understand the KStandardDirs code enough to try to fix this, but if I
> > manually
> > insert "KDEDIR/share/doc/HTML" into the QStringList, the ioslave
> > works almost perfectly.
> I've figured out why: KStandardDirs is never told about the "html" 
> resource.
> KStandardDirs::kde_default("html") will return "share/doc/HTML", 
> but "html" isn't listed in the types that 
> KStandardDirs::addKDEDefaults() adds resource types for.
> Despite the claims to the contrary in the documentation for 
> KStandardDirs::addResourceType(), not all the standard resource paths 
> returned by kde_default() are added by addKDEDefaults().
> Should all the standard directories returned by kde_default() be added 
> by addKDEDefaults()?  If so, I can do that.

I don't know about "all", but I would just compare the list with the one from the kde3 kstandarddirs.cpp

In a kde3 test program, I tried
  qDebug("%s", KGlobal::dirs()->resourceDirs("html").join(",").latin1());
and it gave

And kstandarddirs.cpp in kde3 had "html" in the types array. It seems that the conversion
to a string index table lost that one... Thiago, any idea why?

David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

More information about the kde-core-devel mailing list