KStandardDirs behaviour when finding directories

Dmitry Suzdalev dimsuz at gmail.com
Mon Jul 30 12:55:31 BST 2007


Hi!

While searching for bug which prevented loading styles in Kopete I
found the following issue.

Suppose I want to find a directory with KStandardDirs. If I write it like this:

QString path = KStandardDirs::locate("appdata", "SomeDir");

then it returns an empty path even though
~/.kde/share/apps/myapp/SomeDir exists.
It finds this path only when I write:

QString path = KStandardDirs::locate("appdata", "SomeDir/");

i.e. with slash appended.

So is this a bug or a feature?
If this is a feature then it should be documented somewhere in
KStandardDirs apidox.
But honestly I would expect the first version to work :)

Cheers,
Dmitry.




More information about the kde-core-devel mailing list