EditorManager: Use non-static member initialization

And initialize some members that were not really initialized before.

Change-Id: I2c32187c406774595b1575fdfb6d1a4f1116f478
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Eike Ziller
2016-05-17 12:33:39 +02:00
committed by Eike Ziller
parent 9e05cfa9c3
commit 40c25df80f
2 changed files with 11 additions and 18 deletions

View File

@@ -192,7 +192,6 @@ EditorFactoryLike *findById(Id id)
EditorManagerPrivate::EditorManagerPrivate(QObject *parent) : EditorManagerPrivate::EditorManagerPrivate(QObject *parent) :
QObject(parent), QObject(parent),
m_autoSaveTimer(0),
m_revertToSavedAction(new QAction(EditorManager::tr("Revert to Saved"), this)), m_revertToSavedAction(new QAction(EditorManager::tr("Revert to Saved"), this)),
m_saveAction(new QAction(this)), m_saveAction(new QAction(this)),
m_saveAsAction(new QAction(this)), m_saveAsAction(new QAction(this)),
@@ -216,13 +215,7 @@ EditorManagerPrivate::EditorManagerPrivate(QObject *parent) :
m_closeAllEditorsExceptVisibleContextAction(new QAction(EditorManager::tr("Close All Except Visible"), this)), m_closeAllEditorsExceptVisibleContextAction(new QAction(EditorManager::tr("Close All Except Visible"), this)),
m_openGraphicalShellAction(new QAction(FileUtils::msgGraphicalShellAction(), this)), m_openGraphicalShellAction(new QAction(FileUtils::msgGraphicalShellAction(), this)),
m_openTerminalAction(new QAction(FileUtils::msgTerminalAction(), this)), m_openTerminalAction(new QAction(FileUtils::msgTerminalAction(), this)),
m_findInDirectoryAction(new QAction(FileUtils::msgFindInDirectory(), this)), m_findInDirectoryAction(new QAction(FileUtils::msgFindInDirectory(), this))
m_windowPopup(0),
m_reloadSetting(IDocument::AlwaysAsk),
m_autoSaveEnabled(true),
m_autoSaveInterval(5),
m_warnBeforeOpeningBigFilesEnabled(true),
m_bigFileSizeLimitInMB(5)
{ {
d = this; d = this;
} }

View File

@@ -197,7 +197,7 @@ private:
QPointer<IEditor> m_currentEditor; QPointer<IEditor> m_currentEditor;
QPointer<IEditor> m_scheduledCurrentEditor; QPointer<IEditor> m_scheduledCurrentEditor;
QPointer<EditorView> m_currentView; QPointer<EditorView> m_currentView;
QTimer *m_autoSaveTimer; QTimer *m_autoSaveTimer = nullptr;
// actions // actions
QAction *m_revertToSavedAction; QAction *m_revertToSavedAction;
@@ -233,24 +233,24 @@ private:
QAction *m_openGraphicalShellAction; QAction *m_openGraphicalShellAction;
QAction *m_openTerminalAction; QAction *m_openTerminalAction;
QAction *m_findInDirectoryAction; QAction *m_findInDirectoryAction;
DocumentModel::Entry *m_contextMenuEntry; DocumentModel::Entry *m_contextMenuEntry = nullptr;
IEditor *m_contextMenuEditor; IEditor *m_contextMenuEditor = nullptr;
OpenEditorsWindow *m_windowPopup; OpenEditorsWindow *m_windowPopup = nullptr;
QMap<QString, QVariant> m_editorStates; QMap<QString, QVariant> m_editorStates;
OpenEditorsViewFactory *m_openEditorsFactory; OpenEditorsViewFactory *m_openEditorsFactory = nullptr;
IDocument::ReloadSetting m_reloadSetting; IDocument::ReloadSetting m_reloadSetting = IDocument::AlwaysAsk;
EditorManager::WindowTitleHandler m_titleAdditionHandler; EditorManager::WindowTitleHandler m_titleAdditionHandler;
EditorManager::WindowTitleHandler m_titleVcsTopicHandler; EditorManager::WindowTitleHandler m_titleVcsTopicHandler;
bool m_autoSaveEnabled; bool m_autoSaveEnabled = true;
int m_autoSaveInterval; int m_autoSaveInterval = 5;
bool m_warnBeforeOpeningBigFilesEnabled; bool m_warnBeforeOpeningBigFilesEnabled = true;
int m_bigFileSizeLimitInMB; int m_bigFileSizeLimitInMB = 5;
QString m_placeholderText; QString m_placeholderText;
QList<std::function<bool(IEditor *)>> m_closeEditorListeners; QList<std::function<bool(IEditor *)>> m_closeEditorListeners;