diff options
author | Bill King <bill.king@nokia.com> | 2010-08-17 11:52:06 +1000 |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2010-08-17 11:52:06 +1000 |
commit | 7fa4adbb4195196723b7e4614d1a20bd32667c1f (patch) | |
tree | 6a5223b1f42b3a928ac32a6b72c5a7131bb90a75 | |
parent | a2c67f20eb580a6bdd6cb60891d61fbe978463a3 (diff) |
Fixes: Allows explicit pathing for appnames supplied to startApplication
-rw-r--r-- | libqsystemtest/qsystemtest_p.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libqsystemtest/qsystemtest_p.cpp b/libqsystemtest/qsystemtest_p.cpp index 877e885..78ee81f 100644 --- a/libqsystemtest/qsystemtest_p.cpp +++ b/libqsystemtest/qsystemtest_p.cpp @@ -721,6 +721,18 @@ QString QSystemTest::PATH() QString QSystemTest::which( const QString &appName ) { QString path = PATH(); + + if(QFile::exists(appName)) + return appName; +#if defined Q_OS_MAC + QString mac_name = appName + ".app/Contents/MacOS/" + QFileInfo(appName).baseName(); + if (QFile::exists(mac_name)) return mac_name; +#endif +#if defined Q_OS_WIN32 + if (QFile::exists(appName+".exe")) return appName+".exe"; + if (QFile::exists(appName+".bat")) return appName+".bat"; +#endif + if (!path.isEmpty()) { QStringList path_list; #if defined Q_OS_WIN32 |