forked from qt-creator/qt-creator
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:
@@ -31,6 +31,7 @@
|
||||
#include "externaltoolconfig.h"
|
||||
#include "ui_externaltoolconfig.h"
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -351,13 +352,13 @@ QModelIndex ExternalToolModel::addTool(const QModelIndex &atIndex)
|
||||
tool->setDescription(tr("This tool prints a line of useful text"));
|
||||
//: Sample external tool text
|
||||
const QString text = tr("Useful text");
|
||||
#ifdef Q_OS_WIN
|
||||
tool->setExecutables(QStringList(QLatin1String("cmd")));
|
||||
tool->setArguments(QLatin1String("/c echo ") + text);
|
||||
#else
|
||||
tool->setExecutables(QStringList(QLatin1String("echo")));
|
||||
tool->setArguments(text);
|
||||
#endif
|
||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||
tool->setExecutables(QStringList(QLatin1String("cmd")));
|
||||
tool->setArguments(QLatin1String("/c echo ") + text);
|
||||
} else {
|
||||
tool->setExecutables(QStringList(QLatin1String("echo")));
|
||||
tool->setArguments(text);
|
||||
}
|
||||
|
||||
int pos;
|
||||
QModelIndex parent;
|
||||
|
||||
Reference in New Issue
Block a user