QString p = QString("%1/%2").arg(kfsstnd_defaultbindir()).arg(real_appname);
you can see that it uses function kfsstnd_defaultbindir() to get the absolute path to the application. KStandardDirs::kfsstnd_defaultbindir() returns __KDE_BINDIR and, from the ubuntu packages, the default compiled value for __KDE_BINDIR is /usr/bin. So, it doesn't matter what you set in your PATH environment variable, but it always will execute /usr/bin/myapp.
IMHO, I think that KStandardDirs::findExe() should use KStandardDirs::kfsstnd_defaultbindir() as the last option to find the absolute path to the application (and not as the second one, as is coded right now).
Found where the problem is. It's in the KStandardDirs: :findExe( ) function. From line 937 (http:// api.kde. org/3.5- api/kdelibs- apidocs/ kdecore/ html/kstandardd irs_8cpp- source. html#l00937)
QString p = QString( "%1/%2" ).arg(kfsstnd_ defaultbindir( )).arg( real_appname) ;
you can see that it uses function kfsstnd_ defaultbindir( ) to get the absolute path to the application. KStandardDirs: :kfsstnd_ defaultbindir( ) returns __KDE_BINDIR and, from the ubuntu packages, the default compiled value for __KDE_BINDIR is /usr/bin. So, it doesn't matter what you set in your PATH environment variable, but it always will execute /usr/bin/myapp.
IMHO, I think that KStandardDirs: :findExe( ) should use KStandardDirs: :kfsstnd_ defaultbindir( ) as the last option to find the absolute path to the application (and not as the second one, as is coded right now).
Any comments? Thanks...