From 4b8564cb4294da623167f1e01097f581acb768b4 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sat, 10 Sep 2016 22:58:37 +0300 Subject: [PATCH] ProjectExplorer: Replace macro usages with HostOsInfo Change-Id: I8d4975635f0a4a181ff1ea0950bb58819aae1546 Reviewed-by: Tobias Hunger --- .../projectexplorer/projectexplorer.cpp | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index c18b8389510..787210a33a2 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -89,11 +89,9 @@ #include "waitforstopdialog.h" #include "projectexplorericons.h" -#ifdef Q_OS_WIN -# include "windebuginterface.h" -# include "msvctoolchain.h" -# include "wincetoolchain.h" -#endif +#include "windebuginterface.h" +#include "msvctoolchain.h" +#include "wincetoolchain.h" #include "projecttree.h" #include "projectwelcomepage.h" @@ -432,17 +430,15 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er #endif // Add ToolChainFactories: -#ifdef Q_OS_WIN - addAutoReleasedObject(new WinDebugInterface); - - addAutoReleasedObject(new MsvcToolChainFactory); - addAutoReleasedObject(new WinCEToolChainFactory); -#else - addAutoReleasedObject(new LinuxIccToolChainFactory); -#endif -#ifndef Q_OS_MAC - addAutoReleasedObject(new MingwToolChainFactory); // Mingw offers cross-compiling to windows -#endif + if (Utils::HostOsInfo::isWindowsHost()) { + addAutoReleasedObject(new WinDebugInterface); + addAutoReleasedObject(new MsvcToolChainFactory); + addAutoReleasedObject(new WinCEToolChainFactory); + } else { + addAutoReleasedObject(new LinuxIccToolChainFactory); + } + if (!Utils::HostOsInfo::isMacHost()) + addAutoReleasedObject(new MingwToolChainFactory); // Mingw offers cross-compiling to windows addAutoReleasedObject(new GccToolChainFactory); addAutoReleasedObject(new ClangToolChainFactory); addAutoReleasedObject(new CustomToolChainFactory); @@ -719,9 +715,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er // open action dd->m_loadAction = new QAction(tr("Load Project..."), this); cmd = ActionManager::registerAction(dd->m_loadAction, Constants::LOAD); -#ifndef Q_OS_MAC - cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+O"))); -#endif + if (!Utils::HostOsInfo::isMacHost()) + cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+O"))); msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES); // Default open action