Core: Remove some unneeded ifdefs.

Change-Id: I90bcb0c05224d7ee9464ab1b22600ee2aba4c0ac
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Christian Kandeler
2012-11-06 16:00:38 +01:00
parent b03ba2bdb1
commit 56ffd3c415

View File

@@ -82,6 +82,7 @@
#include <coreplugin/inavigationwidgetfactory.h>
#include <coreplugin/settingsdatabase.h>
#include <utils/historycompleter.h>
#include <utils/hostosinfo.h>
#include <utils/pathchooser.h>
#include <utils/stylehelper.h>
#include <utils/stringutils.h>
@@ -179,14 +180,13 @@ MainWindow::MainWindow() :
Utils::HistoryCompleter::setSettings(m_settings);
setWindowTitle(tr("Qt Creator"));
#ifndef Q_OS_MAC
if (!Utils::HostOsInfo::isMacHost())
QApplication::setWindowIcon(QIcon(QLatin1String(Constants::ICON_QTLOGO_128)));
#endif
QCoreApplication::setApplicationName(QLatin1String("QtCreator"));
QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::IDE_VERSION_LONG));
QCoreApplication::setOrganizationName(QLatin1String(Constants::IDE_SETTINGSVARIANT_STR));
QString baseName = QApplication::style()->objectName();
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost()) {
if (baseName == QLatin1String("windows")) {
// Sometimes we get the standard windows 95 style as a fallback
if (QStyleFactory::keys().contains("Fusion"))
@@ -200,7 +200,7 @@ MainWindow::MainWindow() :
baseName = QLatin1String("cleanlooks");
}
}
#endif
}
qApp->setStyle(new ManhattanStyle(baseName));
setDockNestingEnabled(true);
@@ -485,9 +485,8 @@ void MainWindow::registerDefaultContainers()
{
ActionContainer *menubar = ActionManager::createMenuBar(Constants::MENU_BAR);
#ifndef Q_OS_MAC // System menu bar on Mac
if (!Utils::HostOsInfo::isMacHost()) // System menu bar on Mac
setMenuBar(menubar->menuBar());
#endif
menubar->appendGroup(Constants::G_FILE);
menubar->appendGroup(Constants::G_EDIT);
menubar->appendGroup(Constants::G_VIEW);
@@ -745,19 +744,18 @@ void MainWindow::registerDefaultActions()
mwindow->addAction(cmd, Constants::G_WINDOW_VIEWS);
m_toggleSideBarAction->setEnabled(false);
#if defined(Q_OS_MAC)
bool fullScreenCheckable = false;
const QString fullScreenActionText(tr("Enter Full Screen"));
bool supportsFullScreen = MacFullScreen::supportsFullScreen();
#else
bool fullScreenCheckable = true;
const QString fullScreenActionText(tr("Full Screen"));
bool supportsFullScreen = true;
#endif
if (supportsFullScreen) {
// Full Screen Action
m_toggleFullScreenAction = new QAction(fullScreenActionText, this);
m_toggleFullScreenAction->setCheckable(fullScreenCheckable);
m_toggleFullScreenAction->setCheckable(!Utils::HostOsInfo::isMacHost());
cmd = ActionManager::registerAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN, globalContext);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Meta+F") : tr("Ctrl+Shift+F11")));
cmd->setAttribute(Command::CA_UpdateText); /* for Mac */
@@ -772,17 +770,15 @@ void MainWindow::registerDefaultActions()
// About IDE Action
icon = QIcon::fromTheme(QLatin1String("help-about"));
#ifdef Q_OS_MAC
if (Utils::HostOsInfo::isMacHost())
tmpaction = new QAction(icon, tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu
#else
else
tmpaction = new QAction(icon, tr("About &Qt Creator..."), this);
#endif
cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_QTCREATOR, globalContext);
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
tmpaction->setEnabled(true);
#ifdef Q_OS_MAC
if (Utils::HostOsInfo::isMacHost())
cmd->action()->setMenuRole(QAction::ApplicationSpecificRole);
#endif
connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutQtCreator()));
//About Plugins Action
@@ -790,9 +786,8 @@ void MainWindow::registerDefaultActions()
cmd = ActionManager::registerAction(tmpaction, Constants::ABOUT_PLUGINS, globalContext);
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
tmpaction->setEnabled(true);
#ifdef Q_OS_MAC
if (Utils::HostOsInfo::isMacHost())
cmd->action()->setMenuRole(QAction::ApplicationSpecificRole);
#endif
connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins()));
// About Qt Action
// tmpaction = new QAction(tr("About &Qt..."), this);
@@ -801,12 +796,12 @@ void MainWindow::registerDefaultActions()
// tmpaction->setEnabled(true);
// connect(tmpaction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
// About sep
#ifndef Q_OS_MAC // doesn't have the "About" actions in the Help menu
if (!Utils::HostOsInfo::isMacHost()) { // doesn't have the "About" actions in the Help menu
tmpaction = new QAction(this);
tmpaction->setSeparator(true);
cmd = ActionManager::registerAction(tmpaction, "QtCreator.Help.Sep.About", globalContext);
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
#endif
}
}
void MainWindow::newFile()