Review Request: Extend KStandardDirs::find[All]Exe() to also look for .com, and .bat on Windows

Thomas Friedrichsmeier thomas.friedrichsmeier at
Fri Apr 16 19:03:44 BST 2010

This is an automatically generated e-mail. To reply, visit:

(Updated 2010-04-16 18:03:44.395584)

Review request for kdelibs, Jaroslaw Staniek and Patrick Spendrin.


The reason I could not run tests was that I did not have KDE4_BUILD_TESTS defined.

The fourth version of the patch changes kstandarddirstest to use case-insensitive comparisons on windows, where appropriate. This relates to the current patch, as binaries will generally be found as "binary.EXE" instead of "binary.exe" with the patch. Ignoring the case when comparing file paths on Windows also fixes several unrelated failures within kstandarddirstest for me.


On Windows, KStandardDirs::findExe(), and findAllExe() append ".exe" to the filename to look for. However, executable files on Windows may also end in .com or .bat. Therefore, this patch looks for all three extensions in the order .exe, .com, .bat.

For example, rkward ships with a wrapper script rkward.bat. kwinstartmenu relies on KStandardDirs::findExe() to locate the executables referenced in .desktop files, and fails to find rkward.bat. This patch fixes that.

P.S.: Where should windows-specific review requests go to?

Diffs (updated)

  trunk/KDE/kdelibs/kdecore//kernel/kstandarddirs.cpp 1115458 
  trunk/KDE/kdelibs/kdecore//tests/kstandarddirstest.cpp 1115458 


Testing (updated)

I get the same pattern of failed test suites with and without this patch.

Inside kstandarddirtstest, all but one tests now pass. The remaining failed part (in both patched and unpatched versions) is KStandarddirsTest::testFindExe() due to picking up the local exe within the build tree (unrelated to the essence of this review request).

I did not yet compile/run the updated kstandarddirstest on Linux, but would do so before committing.



More information about the kde-core-devel mailing list