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:
@@ -46,6 +46,7 @@
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/parameteraction.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -173,10 +174,9 @@ StatusList parseStatusOutput(const QString &output)
|
||||
static inline QStringList svnDirectories()
|
||||
{
|
||||
QStringList rc(QLatin1String(".svn"));
|
||||
#ifdef Q_OS_WIN
|
||||
// Option on Windows systems to avoid hassle with some IDEs
|
||||
rc.push_back(QLatin1String("_svn"));
|
||||
#endif
|
||||
if (Utils::HostOsInfo::isWindowsHost())
|
||||
// Option on Windows systems to avoid hassle with some IDEs
|
||||
rc.push_back(QLatin1String("_svn"));
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1192,11 +1192,9 @@ SubversionPlugin *SubversionPlugin::instance()
|
||||
|
||||
bool SubversionPlugin::vcsAdd(const QString &workingDir, const QString &rawFileName)
|
||||
{
|
||||
#ifdef Q_OS_MAC // See below.
|
||||
return vcsAdd14(workingDir, rawFileName);
|
||||
#else
|
||||
if (Utils::HostOsInfo::isMacHost()) // See below.
|
||||
return vcsAdd14(workingDir, rawFileName);
|
||||
return vcsAdd15(workingDir, rawFileName);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Post 1.4 add: Use "--parents" to add directories
|
||||
|
Reference in New Issue
Block a user