mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-07 01:55:53 +08:00
Ref T103, executable file path moved to CDirectoryUtils::executableFilePath
This commit is contained in:
committed by
Mathew Sutcliffe
parent
3245ff4ef4
commit
caf358401f
@@ -45,6 +45,23 @@ namespace BlackMisc
|
||||
return pDir;
|
||||
}
|
||||
|
||||
QString CDirectoryUtils::executableFilePath(const QString &executable)
|
||||
{
|
||||
Q_ASSERT_X(!executable.isEmpty(), Q_FUNC_INFO, "Missing executable file path");
|
||||
Q_ASSERT_X(CBuildConfig::isKnownExecutableName(executable), Q_FUNC_INFO, "Unknown exectuable");
|
||||
|
||||
QString s = CFileUtils::appendFilePaths(CDirectoryUtils::binDirectory(), executable);
|
||||
if (CBuildConfig::isRunningOnMacOSXPlatform() && CDirectoryUtils::isMacOSXAppBundle())
|
||||
{
|
||||
s += QLatin1String(".app/Contents/MacOS/") + executable;
|
||||
}
|
||||
else if (CBuildConfig::isRunningOnWindowsNtPlatform())
|
||||
{
|
||||
s += QLatin1String(".exe");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
QString normalizedApplicationDirectoryImpl()
|
||||
{
|
||||
QString appDir = CDirectoryUtils::binDirectory();
|
||||
|
||||
Reference in New Issue
Block a user