Utils: Introduce HostOsInfo class.

The class' member functions are intended to be used
instead of the Q_OS_* macros in all contexts where
the latter are not syntactically required.
This lowers the likelihood of changes made on one
platform breaking the build on another, e.g. due to
the code model missing symbols in #ifdef'ed out code
when refactoring.

Change-Id: I4a54788591b4c8f8d589b8368a6c683d4155c9fa
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Christian Kandeler
2012-08-23 15:53:58 +02:00
committed by hjk
parent b674b59b3d
commit e669f05406
109 changed files with 1281 additions and 1249 deletions

View File

@@ -33,6 +33,7 @@
#include "ui_addnewavddialog.h"
#include <coreplugin/icore.h>
#include <utils/hostosinfo.h>
#include <utils/persistentsettings.h>
#include <QDateTime>
@@ -268,19 +269,19 @@ FileName AndroidConfigurations::adbToolPath() const
FileName AndroidConfigurations::androidToolPath() const
{
#ifdef Q_OS_WIN32
// I want to switch from using android.bat to using an executable. All it really does is call
// Java and I've made some progress on it. So if android.exe exists, return that instead.
FileName path = m_config.sdkLocation;
path.appendPath(QLatin1String("tools/android"ANDROID_EXE_SUFFIX));
if (path.toFileInfo().exists())
return path;
path = m_config.sdkLocation;
return path.appendPath(QLatin1String("tools/android"ANDROID_BAT_SUFFIX));
#else
FileName path = m_config.sdkLocation;
return path.appendPath(QLatin1String("tools/android"));
#endif
if (HostOsInfo::isWindowsHost()) {
// I want to switch from using android.bat to using an executable. All it really does is call
// Java and I've made some progress on it. So if android.exe exists, return that instead.
FileName path = m_config.sdkLocation;
path.appendPath(QLatin1String("tools/android"ANDROID_EXE_SUFFIX));
if (path.toFileInfo().exists())
return path;
path = m_config.sdkLocation;
return path.appendPath(QLatin1String("tools/android"ANDROID_BAT_SUFFIX));
} else {
FileName path = m_config.sdkLocation;
return path.appendPath(QLatin1String("tools/android"));
}
}
FileName AndroidConfigurations::antToolPath() const