[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdevelop/5.3] kdevplatform/shell: Shell: mark class members const which should stay const the whole
From: Friedrich W. H. Kossebau <null () kde ! org>
Date: 2018-09-12 1:31:33
Message-ID: E1fzu0D-0006tm-N4 () code ! kde ! org
[Download RAW message or body]
Git commit 7610f34395e888cdf10093971d9f557a39a78b79 by Friedrich W. H. Kossebau.
Committed on 12/09/2018 at 01:21.
Pushed by kossebau into branch '5.3'.
Shell: mark class members const which should stay const the whole lifetime
M +1 -1 kdevplatform/shell/areadisplay.h
M +2 -2 kdevplatform/shell/core_p.h
M +3 -3 kdevplatform/shell/debugcontroller.cpp
M +1 -1 kdevplatform/shell/documentcontroller.cpp
M +1 -1 kdevplatform/shell/editorconfigpage.cpp
M +1 -1 kdevplatform/shell/environmentconfigurebutton.cpp
M +2 -2 kdevplatform/shell/filteredproblemstore.cpp
M +5 -5 kdevplatform/shell/ktexteditorpluginintegration.cpp
M +1 -1 kdevplatform/shell/ktexteditorpluginintegration.h
M +3 -3 kdevplatform/shell/languagecontroller.cpp
M +1 -1 kdevplatform/shell/launchconfiguration.cpp
M +1 -1 kdevplatform/shell/mainwindow_p.h
M +7 -4 kdevplatform/shell/partcontroller.cpp
M +7 -3 kdevplatform/shell/partdocument.cpp
M +7 -3 kdevplatform/shell/plugincontroller.cpp
M +1 -1 kdevplatform/shell/problem.cpp
M +2 -2 kdevplatform/shell/progresswidget/progressmanager.h
M +14 -10 kdevplatform/shell/projectcontroller.cpp
M +1 -1 kdevplatform/shell/projectcontroller.h
M +1 -1 kdevplatform/shell/runtimecontroller.h
M +1 -1 kdevplatform/shell/savedialog.cpp
M +1 -1 kdevplatform/shell/session.cpp
M +3 -3 kdevplatform/shell/sessionchooserdialog.h
M +1 -1 kdevplatform/shell/sessioncontroller.cpp
M +1 -1 kdevplatform/shell/sessionlock.h
M +1 -1 kdevplatform/shell/sourceformatterjob.h
M +1 -1 kdevplatform/shell/statusbar.h
M +14 -12 kdevplatform/shell/uicontroller.cpp
M +1 -1 kdevplatform/shell/workingsets/closedworkingsetswidget.h
M +2 -2 kdevplatform/shell/workingsets/workingset.h
M +1 -1 kdevplatform/shell/workingsets/workingsettooltipwidget.h
https://commits.kde.org/kdevelop/7610f34395e888cdf10093971d9f557a39a78b79
diff --git a/kdevplatform/shell/areadisplay.h b/kdevplatform/shell/areadisplay.h
index c1a96931fa..1d30e4e929 100644
--- a/kdevplatform/shell/areadisplay.h
+++ b/kdevplatform/shell/areadisplay.h
@@ -56,7 +56,7 @@ private Q_SLOTS:
private:
QLabel* m_separator;
QToolButton* m_button;
- KDevelop::MainWindow* m_mainWindow;
+ KDevelop::MainWindow* const m_mainWindow;
};
#endif // AREADISPLAY_H
diff --git a/kdevplatform/shell/core_p.h b/kdevplatform/shell/core_p.h
index 8af5978173..d5ed3525cc 100644
--- a/kdevplatform/shell/core_p.h
+++ b/kdevplatform/shell/core_p.h
@@ -69,8 +69,8 @@ public:
QPointer<TestController> testController;
QPointer<RuntimeController> runtimeController;
- KAboutData m_aboutData;
- Core *m_core;
+ const KAboutData m_aboutData;
+ Core* const m_core;
bool m_cleanedUp;
bool m_shuttingDown;
Core::Setup m_mode;
diff --git a/kdevplatform/shell/debugcontroller.cpp \
b/kdevplatform/shell/debugcontroller.cpp index 3e3fdde311..dd2549cb07 100644
--- a/kdevplatform/shell/debugcontroller.cpp
+++ b/kdevplatform/shell/debugcontroller.cpp
@@ -91,9 +91,9 @@ public:
}
private:
- DebugController* m_controller;
- QString m_id;
- Qt::DockWidgetArea m_defaultArea;
+ DebugController* const m_controller;
+ const QString m_id;
+ const Qt::DockWidgetArea m_defaultArea;
};
DebugController::DebugController(QObject *parent)
diff --git a/kdevplatform/shell/documentcontroller.cpp \
b/kdevplatform/shell/documentcontroller.cpp index 217dc0185d..320fd8f2b6 100644
--- a/kdevplatform/shell/documentcontroller.cpp
+++ b/kdevplatform/shell/documentcontroller.cpp
@@ -540,7 +540,7 @@ public:
return true;
}
- DocumentController* controller;
+ DocumentController* const controller;
QVector<HistoryEntry> backHistory;
QVector<HistoryEntry> forwardHistory;
diff --git a/kdevplatform/shell/editorconfigpage.cpp \
b/kdevplatform/shell/editorconfigpage.cpp index 9d614f6327..9a55821f0e 100644
--- a/kdevplatform/shell/editorconfigpage.cpp
+++ b/kdevplatform/shell/editorconfigpage.cpp
@@ -83,7 +83,7 @@ public Q_SLOTS:
}
private:
- KTextEditor::ConfigPage* m_page;
+ KTextEditor::ConfigPage* const m_page;
};
}
diff --git a/kdevplatform/shell/environmentconfigurebutton.cpp \
b/kdevplatform/shell/environmentconfigurebutton.cpp index a1eae95b5e..cce3ac4329 \
100644
--- a/kdevplatform/shell/environmentconfigurebutton.cpp
+++ b/kdevplatform/shell/environmentconfigurebutton.cpp
@@ -74,7 +74,7 @@ public:
}
}
- EnvironmentConfigureButton *q;
+ EnvironmentConfigureButton* const q;
EnvironmentSelectionWidget *selectionWidget;
};
diff --git a/kdevplatform/shell/filteredproblemstore.cpp \
b/kdevplatform/shell/filteredproblemstore.cpp index e0b6cd4e62..5081354e62 100644
--- a/kdevplatform/shell/filteredproblemstore.cpp
+++ b/kdevplatform/shell/filteredproblemstore.cpp
@@ -88,7 +88,7 @@ public:
}
protected:
- ProblemStoreNode *m_rootNode;
+ ProblemStoreNode* const m_rootNode;
QScopedPointer<ProblemStoreNode> m_groupedRootNode;
};
@@ -216,7 +216,7 @@ public:
/// Tells if the problem matches the filters
bool match(const IProblem::Ptr &problem) const;
- FilteredProblemStore* q;
+ FilteredProblemStore* const q;
QScopedPointer<GroupingStrategy> m_strategy;
GroupingMethod m_grouping;
};
diff --git a/kdevplatform/shell/ktexteditorpluginintegration.cpp \
b/kdevplatform/shell/ktexteditorpluginintegration.cpp index 254d0d8cd2..80bc89afcf \
100644
--- a/kdevplatform/shell/ktexteditorpluginintegration.cpp
+++ b/kdevplatform/shell/ktexteditorpluginintegration.cpp
@@ -89,7 +89,7 @@ public:
~KeepAliveWidget() override;
private:
- ToolViewFactory *m_factory;
+ ToolViewFactory* const m_factory;
};
class ToolViewFactory : public QObject, public KDevelop::IToolViewFactory
@@ -149,11 +149,11 @@ public:
}
private:
- QString m_text;
- QIcon m_icon;
- QString m_identifier;
+ const QString m_text;
+ const QIcon m_icon;
+ const QString m_identifier;
QPointer<QWidget> m_container;
- KTextEditor::MainWindow::ToolViewPosition m_pos;
+ const KTextEditor::MainWindow::ToolViewPosition m_pos;
friend class KeepAliveWidget;
};
diff --git a/kdevplatform/shell/ktexteditorpluginintegration.h \
b/kdevplatform/shell/ktexteditorpluginintegration.h index 2b1af0dfe3..972d26d9bb \
100644
--- a/kdevplatform/shell/ktexteditorpluginintegration.h
+++ b/kdevplatform/shell/ktexteditorpluginintegration.h
@@ -96,7 +96,7 @@ public:
void removePluginView(const QString &id);
private:
- KDevelop::MainWindow *m_mainWindow;
+ KDevelop::MainWindow* const m_mainWindow;
KTextEditor::MainWindow *m_interface;
QHash<QString, QPointer<QObject>> m_pluginViews;
QHash<KTextEditor::View*, QWidget*> m_viewBars;
diff --git a/kdevplatform/shell/languagecontroller.cpp \
b/kdevplatform/shell/languagecontroller.cpp index 1da0172bac..968a59ea6a 100644
--- a/kdevplatform/shell/languagecontroller.cpp
+++ b/kdevplatform/shell/languagecontroller.cpp
@@ -96,17 +96,17 @@ public:
typedef QMultiHash<QMimeType, ILanguageSupport*> MimeTypeCache;
MimeTypeCache mimeTypeCache; //Maps mimetypes to languages
- BackgroundParser *backgroundParser;
+ BackgroundParser* const backgroundParser;
StaticAssistantsManager* staticAssistantsManager;
bool m_cleanedUp;
void addLanguageSupport(ILanguageSupport* support, const QStringList& \
mimetypes); void addLanguageSupport(ILanguageSupport* support);
- ProblemModelSet *problemModelSet;
+ ProblemModelSet* const problemModelSet;
private:
- LanguageController *m_controller;
+ LanguageController* const m_controller;
};
void LanguageControllerPrivate::addLanguageSupport(ILanguageSupport* \
languageSupport,
diff --git a/kdevplatform/shell/launchconfiguration.cpp \
b/kdevplatform/shell/launchconfiguration.cpp index 6275e924c9..04d74facb5 100644
--- a/kdevplatform/shell/launchconfiguration.cpp
+++ b/kdevplatform/shell/launchconfiguration.cpp
@@ -39,7 +39,7 @@ public:
{}
KConfigGroup baseGroup;
- IProject* project;
+ IProject* const project;
LaunchConfigurationType* type;
};
diff --git a/kdevplatform/shell/mainwindow_p.h b/kdevplatform/shell/mainwindow_p.h
index fdb975e0d6..3020957966 100644
--- a/kdevplatform/shell/mainwindow_p.h
+++ b/kdevplatform/shell/mainwindow_p.h
@@ -138,7 +138,7 @@ public Q_SLOTS:
private:
KActionCollection *actionCollection();
- MainWindow *m_mainWindow;
+ MainWindow* const m_mainWindow;
StatusBar* m_statusBar;
QWidget* lastXMLGUIClientView;
QPointer<QWidget> m_workingSetCornerWidget;
diff --git a/kdevplatform/shell/partcontroller.cpp \
b/kdevplatform/shell/partcontroller.cpp index 31087c2b1e..891a52c2ea 100644
--- a/kdevplatform/shell/partcontroller.cpp
+++ b/kdevplatform/shell/partcontroller.cpp
@@ -52,21 +52,24 @@ namespace KDevelop
class PartControllerPrivate
{
public:
- PartControllerPrivate() {}
+ explicit PartControllerPrivate(Core* core)
+ : m_core(core)
+ {}
bool m_showTextEditorStatusBar = false;
QString m_editor;
QStringList m_textTypes;
- Core *m_core;
+ Core* const m_core;
};
PartController::PartController(Core *core, QWidget *toplevel)
- : IPartController( toplevel ), d(new PartControllerPrivate)
+ : IPartController(toplevel)
+ , d(new PartControllerPrivate(core))
{
setObjectName(QStringLiteral("PartController"));
- d->m_core = core;
+
//Cache this as it is too expensive when creating parts
// KConfig * config = Config::standard();
// config->setGroup( "General" );
diff --git a/kdevplatform/shell/partdocument.cpp \
b/kdevplatform/shell/partdocument.cpp index 62353b1c3b..458e40621a 100644
--- a/kdevplatform/shell/partdocument.cpp
+++ b/kdevplatform/shell/partdocument.cpp
@@ -37,15 +37,19 @@ namespace KDevelop {
class PartDocumentPrivate {
public:
+ explicit PartDocumentPrivate(const QString& preferredPart)
+ : preferredPart(preferredPart)
+ {}
QMap<QWidget*, KParts::Part*> partForView;
- QString preferredPart;
+ const QString preferredPart;
};
PartDocument::PartDocument(const QUrl& url, KDevelop::ICore* core, const QString& \
preferredPart)
- : Sublime::UrlDocument(core->uiController()->controller(), url), \
KDevelop::IDocument(core), d(new PartDocumentPrivate) + : \
Sublime::UrlDocument(core->uiController()->controller(), url) + , \
KDevelop::IDocument(core) + , d(new PartDocumentPrivate(preferredPart))
{
- d->preferredPart = preferredPart;
}
PartDocument::~PartDocument() = default;
diff --git a/kdevplatform/shell/plugincontroller.cpp \
b/kdevplatform/shell/plugincontroller.cpp index 5e3f3b98b9..58f523cc90 100644
--- a/kdevplatform/shell/plugincontroller.cpp
+++ b/kdevplatform/shell/plugincontroller.cpp
@@ -146,6 +146,10 @@ namespace KDevelop {
class PluginControllerPrivate
{
public:
+ explicit PluginControllerPrivate(Core *core)
+ : core(core)
+ {}
+
QVector<KPluginMetaData> plugins;
//map plugin infos to currently loaded plugins
@@ -269,14 +273,14 @@ public:
return (enabledState(info) >= FirstEnabledState);
}
- Core *core;
+ Core* const core;
};
PluginController::PluginController(Core *core)
- : IPluginController(), d(new PluginControllerPrivate)
+ : IPluginController()
+ , d(new PluginControllerPrivate(core))
{
setObjectName(QStringLiteral("PluginController"));
- d->core = core;
QSet<QString> foundPlugins;
auto newPlugins = KPluginLoader::findPlugins(QStringLiteral("kdevplatform/" \
QT_STRINGIFY(KDEVELOP_PLUGIN_VERSION)), [&](const KPluginMetaData& \
meta) {
diff --git a/kdevplatform/shell/problem.cpp b/kdevplatform/shell/problem.cpp
index 255e368d21..3e3e72671b 100644
--- a/kdevplatform/shell/problem.cpp
+++ b/kdevplatform/shell/problem.cpp
@@ -40,7 +40,7 @@ public:
QString m_description;
QString m_explanation;
- QString m_pluginName;
+ const QString m_pluginName;
KDevelop::IProblem::Severity m_severity;
KDevelop::IProblem::Source m_source;
KDevelop::DocumentRange m_range;
diff --git a/kdevplatform/shell/progresswidget/progressmanager.h \
b/kdevplatform/shell/progresswidget/progressmanager.h index deb8876192..31216dd7e9 \
100644
--- a/kdevplatform/shell/progresswidget/progressmanager.h
+++ b/kdevplatform/shell/progresswidget/progressmanager.h
@@ -231,11 +231,11 @@ protected:
~ProgressItem() override;
private:
- QString mId;
+ const QString mId;
QString mLabel;
QString mStatus;
QPointer<ProgressItem> mParent;
- bool mCanBeCanceled;
+ const bool mCanBeCanceled;
unsigned int mProgress;
ProgressItemMap mChildren;
unsigned int mTotal;
diff --git a/kdevplatform/shell/projectcontroller.cpp \
b/kdevplatform/shell/projectcontroller.cpp index 692c098a7a..8c80de6fd6 100644
--- a/kdevplatform/shell/projectcontroller.cpp
+++ b/kdevplatform/shell/projectcontroller.cpp
@@ -93,24 +93,30 @@ public:
QList<IProject*> m_projects;
QMap< IProject*, QList<IPlugin*> > m_projectPlugins;
QPointer<KRecentFilesAction> m_recentProjectsAction;
- Core* m_core;
+ Core* const m_core;
// IProject* m_currentProject;
- ProjectModel* model;
+ ProjectModel* const model;
QPointer<QAction> m_openProject;
QPointer<QAction> m_fetchProject;
QPointer<QAction> m_closeProject;
QPointer<QAction> m_openConfig;
IProjectDialogProvider* dialog;
QList<QUrl> m_currentlyOpening; // project-file urls that are being opened
- ProjectController* q;
+ ProjectController* const q;
ProjectBuildSetModel* buildset;
bool m_foundProjectFile; //Temporary flag used while searching the hierarchy for \
a project file
bool m_cleaningUp; //Temporary flag enabled while destroying the \
project-controller ProjectChangesModel* m_changesModel = nullptr;
QHash< IProject*, QPointer<KJob> > m_parseJobs; // parse jobs that add files \
from the project to the background parser.
- explicit ProjectControllerPrivate( ProjectController* p )
- : m_core(nullptr), model(nullptr), dialog(nullptr), q(p), buildset(nullptr), \
m_foundProjectFile(false), m_cleaningUp(false) + ProjectControllerPrivate(Core* \
core, ProjectController* p) + : m_core(core)
+ , model(new ProjectModel())
+ , dialog(nullptr)
+ , q(p)
+ , buildset(nullptr)
+ , m_foundProjectFile(false)
+ , m_cleaningUp(false)
{
}
@@ -355,7 +361,7 @@ IProjectDialogProvider::IProjectDialogProvider()
IProjectDialogProvider::~IProjectDialogProvider()
{}
-ProjectDialogProvider::ProjectDialogProvider(ProjectControllerPrivate* const p) : \
d(p) +ProjectDialogProvider::ProjectDialogProvider(ProjectControllerPrivate* p) : \
d(p) {}
ProjectDialogProvider::~ProjectDialogProvider()
@@ -522,15 +528,13 @@ void \
ProjectController::setDialogProvider(IProjectDialogProvider* dialog) }
ProjectController::ProjectController( Core* core )
- : IProjectController( core ), d( new ProjectControllerPrivate( this ) )
+ : IProjectController(core)
+ , d(new ProjectControllerPrivate(core, this))
{
qRegisterMetaType<QList<QUrl>>();
setObjectName(QStringLiteral("ProjectController"));
- d->m_core = core;
- d->model = new ProjectModel();
-
//NOTE: this is required to be called here, such that the
// actions are available when the UI controller gets
// initialized *before* the project controller
diff --git a/kdevplatform/shell/projectcontroller.h \
b/kdevplatform/shell/projectcontroller.h index ca229d2138..5177dfd776 100644
--- a/kdevplatform/shell/projectcontroller.h
+++ b/kdevplatform/shell/projectcontroller.h
@@ -176,7 +176,7 @@ class ProjectDialogProvider : public IProjectDialogProvider
{
Q_OBJECT
public:
- explicit ProjectDialogProvider(ProjectControllerPrivate* const p);
+ explicit ProjectDialogProvider(ProjectControllerPrivate* p);
~ProjectDialogProvider() override;
ProjectControllerPrivate* const d;
diff --git a/kdevplatform/shell/runtimecontroller.h \
b/kdevplatform/shell/runtimecontroller.h index 6761ade32c..abf3db44ef 100644
--- a/kdevplatform/shell/runtimecontroller.h
+++ b/kdevplatform/shell/runtimecontroller.h
@@ -52,7 +52,7 @@ private:
QScopedPointer<QMenu> m_runtimesMenu;
QVector<IRuntime*> m_runtimes;
IRuntime* m_currentRuntime = nullptr;
- Core* m_core = nullptr;
+ Core* const m_core;
};
}
diff --git a/kdevplatform/shell/savedialog.cpp b/kdevplatform/shell/savedialog.cpp
index 517b2176e0..5b9c247d6f 100644
--- a/kdevplatform/shell/savedialog.cpp
+++ b/kdevplatform/shell/savedialog.cpp
@@ -48,7 +48,7 @@ public:
IDocument* doc() const { return m_doc; }
private:
- IDocument* m_doc;
+ IDocument* const m_doc;
};
KSaveSelectDialog::KSaveSelectDialog( const QList<IDocument*>& files, QWidget * \
parent )
diff --git a/kdevplatform/shell/session.cpp b/kdevplatform/shell/session.cpp
index 62c6afe8cf..190ee2001e 100644
--- a/kdevplatform/shell/session.cpp
+++ b/kdevplatform/shell/session.cpp
@@ -44,7 +44,7 @@ class SessionPrivate
{
public:
SessionInfo info;
- Session* q;
+ Session* const q;
bool isTemporary;
QUrl pluginArea( const IPlugin* plugin )
diff --git a/kdevplatform/shell/sessionchooserdialog.h \
b/kdevplatform/shell/sessionchooserdialog.h index 919829e8f4..9fc152011d 100644
--- a/kdevplatform/shell/sessionchooserdialog.h
+++ b/kdevplatform/shell/sessionchooserdialog.h
@@ -55,9 +55,9 @@ private Q_SLOTS:
void itemEntered(const QModelIndex& index);
private:
- QListView* m_view;
- QAbstractItemModel* m_model;
- QLineEdit* m_filter;
+ QListView* const m_view;
+ QAbstractItemModel* const m_model;
+ QLineEdit* const m_filter;
QTimer m_updateStateTimer;
QDialogButtonBox* m_buttonBox;
diff --git a/kdevplatform/shell/sessioncontroller.cpp \
b/kdevplatform/shell/sessioncontroller.cpp index 2de0a26f78..db734b0080 100644
--- a/kdevplatform/shell/sessioncontroller.cpp
+++ b/kdevplatform/shell/sessioncontroller.cpp
@@ -222,7 +222,7 @@ public:
sessionUpdated( s );
}
- SessionController* q;
+ SessionController* const q;
QHash<Session*, QAction*> sessionActions;
ISession* activeSession;
diff --git a/kdevplatform/shell/sessionlock.h b/kdevplatform/shell/sessionlock.h
index b8f659b69e..16daf04031 100644
--- a/kdevplatform/shell/sessionlock.h
+++ b/kdevplatform/shell/sessionlock.h
@@ -59,7 +59,7 @@ public:
private:
SessionLock(const QString& sessionId, const QSharedPointer<QLockFile>& \
lockFile);
- QString m_sessionId;
+ const QString m_sessionId;
QSharedPointer<QLockFile> m_lockFile;
};
diff --git a/kdevplatform/shell/sourceformatterjob.h \
b/kdevplatform/shell/sourceformatterjob.h index 3482b7228e..2f8143052d 100644
--- a/kdevplatform/shell/sourceformatterjob.h
+++ b/kdevplatform/shell/sourceformatterjob.h
@@ -68,7 +68,7 @@ private:
void formatFile(const QUrl& url);
private:
- SourceFormatterController* m_sourceFormatterController;
+ SourceFormatterController* const m_sourceFormatterController;
enum {
WorkIdle,
diff --git a/kdevplatform/shell/statusbar.h b/kdevplatform/shell/statusbar.h
index 8f01bbc6bc..898472c3ac 100644
--- a/kdevplatform/shell/statusbar.h
+++ b/kdevplatform/shell/statusbar.h
@@ -83,7 +83,7 @@ private:
};
QMap<IStatus*, Message> m_messages;
- QTimer* m_timer;
+ QTimer* const m_timer;
QTime m_time;
Sublime::View* m_currentView;
QMap<IStatus*,ProgressItem*> m_progressItems;
diff --git a/kdevplatform/shell/uicontroller.cpp \
b/kdevplatform/shell/uicontroller.cpp index 8e0b0df362..ccaffeaf51 100644
--- a/kdevplatform/shell/uicontroller.cpp
+++ b/kdevplatform/shell/uicontroller.cpp
@@ -65,8 +65,10 @@ namespace KDevelop {
class UiControllerPrivate {
public:
- explicit UiControllerPrivate(UiController *controller)
- : areasRestored(false), m_controller(controller)
+ UiControllerPrivate(Core* core, UiController* controller)
+ : core(core)
+ , areasRestored(false)
+ , m_controller(controller)
{
if (Core::self()->workingSetControllerInternal())
Core::self()->workingSetControllerInternal()->initializeController(m_controller);
@@ -137,7 +139,7 @@ public:
}
}
- Core *core;
+ Core* const core;
QPointer<MainWindow> defaultMainWindow;
QHash<IToolViewFactory*, Sublime::ToolDocument*> factoryDocuments;
@@ -176,15 +178,17 @@ public:
QString id() const override { return m_factory->id(); }
private:
- IToolViewFactory *m_factory;
+ IToolViewFactory* const m_factory;
};
class ViewSelectorItem: public QListWidgetItem {
public:
- explicit ViewSelectorItem(const QString &text, QListWidget *parent = nullptr, \
int type = Type)
- :QListWidgetItem(text, parent, type) {}
- IToolViewFactory *factory;
+ explicit ViewSelectorItem(const QString& text, IToolViewFactory* factory, \
QListWidget* parent = nullptr, int type = Type) + : QListWidgetItem(text, \
parent, type) + , factory(factory)
+ {}
+ IToolViewFactory* const factory;
};
@@ -211,14 +215,13 @@ private Q_SLOTS:
}
private:
- MainWindow *m_mw;
+ MainWindow* const m_mw;
};
UiController::UiController(Core *core)
- :Sublime::Controller(nullptr), IUiController(), d(new UiControllerPrivate(this))
+ :Sublime::Controller(nullptr), IUiController(), d(new UiControllerPrivate(core, \
this)) {
setObjectName(QStringLiteral("UiController"));
- d->core = core;
if (!defaultMainWindow() || (Core::self()->setupFlags() & Core::NoUi))
return;
@@ -445,8 +448,7 @@ void UiController::selectNewToolViewToAdd(MainWindow *mw)
for (QHash<IToolViewFactory*, Sublime::ToolDocument*>::const_iterator it = \
d->factoryDocuments.constBegin(); it != d->factoryDocuments.constEnd(); ++it)
{
- ViewSelectorItem *item = new ViewSelectorItem(it.value()->title(), list);
- item->factory = it.key();
+ ViewSelectorItem *item = new ViewSelectorItem(it.value()->title(), it.key(), \
list);
if (!item->factory->allowMultiple() && toolViewPresent(it.value(), \
mw->area())) { // Disable item if the tool view is already present.
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
diff --git a/kdevplatform/shell/workingsets/closedworkingsetswidget.h \
b/kdevplatform/shell/workingsets/closedworkingsetswidget.h index \
e5ee9e5859..f5d3eea18d 100644
--- a/kdevplatform/shell/workingsets/closedworkingsetswidget.h
+++ b/kdevplatform/shell/workingsets/closedworkingsetswidget.h
@@ -58,7 +58,7 @@ private Q_SLOTS:
void removeWorkingSet( WorkingSet* );
private:
- MainWindow* m_mainWindow;
+ MainWindow* const m_mainWindow;
QHBoxLayout* m_layout;
QPointer<Sublime::Area> m_connectedArea;
QMap<WorkingSet*, WorkingSetToolButton*> m_buttons;
diff --git a/kdevplatform/shell/workingsets/workingset.h \
b/kdevplatform/shell/workingsets/workingset.h index e89c326c49..ea280ea19e 100644
--- a/kdevplatform/shell/workingsets/workingset.h
+++ b/kdevplatform/shell/workingsets/workingset.h
@@ -117,8 +117,8 @@ private:
void saveFromArea(Sublime::Area* area, Sublime::AreaIndex *areaIndex, \
KConfigGroup setGroup, KConfigGroup areaGroup); void loadToArea(Sublime::Area* area, \
Sublime::AreaIndex *areaIndex, const KConfigGroup& setGroup, const KConfigGroup& \
areaGroup, QMultiMap<QString, Sublime::View*>& recycle);
- QString m_id;
- QIcon m_icon;
+ const QString m_id;
+ const QIcon m_icon;
QVector<QPointer<Sublime::Area>> m_areas;
static bool m_loading;
};
diff --git a/kdevplatform/shell/workingsets/workingsettooltipwidget.h \
b/kdevplatform/shell/workingsets/workingsettooltipwidget.h index \
ec60fb4438..929fc204bf 100644
--- a/kdevplatform/shell/workingsets/workingsettooltipwidget.h
+++ b/kdevplatform/shell/workingsets/workingsettooltipwidget.h
@@ -57,7 +57,7 @@ private:
QVector<FileWidget*> m_orderedFileWidgets;
QMap<QString, FileWidget*> m_fileWidgets;
- WorkingSet* m_set;
+ WorkingSet* const m_set;
QPushButton* m_mergeButton;
QPushButton* m_subtractButton;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic