forked from qt-creator/qt-creator
Core: Cosmetics and unused #includes
Change-Id: I5838b7340b9f5fca6d43a49026c8fc82f0d0a494 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -66,33 +66,23 @@
|
|||||||
|
|
||||||
#include <nanotrace/nanotrace.h>
|
#include <nanotrace/nanotrace.h>
|
||||||
|
|
||||||
#include <QAbstractProxyModel>
|
|
||||||
#include <QActionGroup>
|
#include <QActionGroup>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QBrush>
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QDir>
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QFileSystemModel>
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPrinter>
|
#include <QPrinter>
|
||||||
#include <QSettings>
|
|
||||||
#include <QSortFilterProxyModel>
|
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
#include <QSyntaxHighlighter>
|
|
||||||
#include <QTextBrowser>
|
#include <QTextBrowser>
|
||||||
#include <QTextList>
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QUrl>
|
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
#include <QWindow>
|
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
@@ -104,12 +94,12 @@ using namespace Utils;
|
|||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static const char settingsGroup[] = "MainWindow";
|
const char settingsGroup[] = "MainWindow";
|
||||||
static const char colorKey[] = "Color";
|
const char colorKey[] = "Color";
|
||||||
static const char windowGeometryKey[] = "WindowGeometry";
|
const char windowGeometryKey[] = "WindowGeometry";
|
||||||
static const char windowStateKey[] = "WindowState";
|
const char windowStateKey[] = "WindowState";
|
||||||
static const char modeSelectorLayoutKey[] = "ModeSelectorLayout";
|
const char modeSelectorLayoutKey[] = "ModeSelectorLayout";
|
||||||
static const char menubarVisibleKey[] = "MenubarVisible";
|
const char menubarVisibleKey[] = "MenubarVisible";
|
||||||
|
|
||||||
static bool hideToolsMenu()
|
static bool hideToolsMenu()
|
||||||
{
|
{
|
||||||
@@ -1262,8 +1252,8 @@ void MainWindow::saveSettings()
|
|||||||
|
|
||||||
void MainWindow::saveWindowSettings()
|
void MainWindow::saveWindowSettings()
|
||||||
{
|
{
|
||||||
QSettings *settings = PluginManager::settings();
|
QtcSettings *settings = PluginManager::settings();
|
||||||
settings->beginGroup(QLatin1String(settingsGroup));
|
settings->beginGroup(settingsGroup);
|
||||||
|
|
||||||
// On OS X applications usually do not restore their full screen state.
|
// On OS X applications usually do not restore their full screen state.
|
||||||
// To be able to restore the correct non-full screen geometry, we have to put
|
// To be able to restore the correct non-full screen geometry, we have to put
|
||||||
@@ -1271,8 +1261,8 @@ void MainWindow::saveWindowSettings()
|
|||||||
// Works around QTBUG-45241
|
// Works around QTBUG-45241
|
||||||
if (Utils::HostOsInfo::isMacHost() && isFullScreen())
|
if (Utils::HostOsInfo::isMacHost() && isFullScreen())
|
||||||
setWindowState(windowState() & ~Qt::WindowFullScreen);
|
setWindowState(windowState() & ~Qt::WindowFullScreen);
|
||||||
settings->setValue(QLatin1String(windowGeometryKey), saveGeometry());
|
settings->setValue(windowGeometryKey, saveGeometry());
|
||||||
settings->setValue(QLatin1String(windowStateKey), saveState());
|
settings->setValue(windowStateKey, saveState());
|
||||||
settings->setValue(modeSelectorLayoutKey, int(ModeManager::modeStyle()));
|
settings->setValue(modeSelectorLayoutKey, int(ModeManager::modeStyle()));
|
||||||
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
@@ -1552,11 +1542,11 @@ QPrinter *MainWindow::printer() const
|
|||||||
void MainWindow::restoreWindowState()
|
void MainWindow::restoreWindowState()
|
||||||
{
|
{
|
||||||
NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState");
|
NANOTRACE_SCOPE("Core", "MainWindow::restoreWindowState");
|
||||||
QSettings *settings = PluginManager::settings();
|
QtcSettings *settings = PluginManager::settings();
|
||||||
settings->beginGroup(QLatin1String(settingsGroup));
|
settings->beginGroup(settingsGroup);
|
||||||
if (!restoreGeometry(settings->value(QLatin1String(windowGeometryKey)).toByteArray()))
|
if (!restoreGeometry(settings->value(windowGeometryKey).toByteArray()))
|
||||||
resize(1260, 700); // size without window decoration
|
resize(1260, 700); // size without window decoration
|
||||||
restoreState(settings->value(QLatin1String(windowStateKey)).toByteArray());
|
restoreState(settings->value(windowStateKey).toByteArray());
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
show();
|
show();
|
||||||
StatusBarManager::restoreSettings();
|
StatusBarManager::restoreSettings();
|
||||||
|
|||||||
Reference in New Issue
Block a user