Aggregation/Utils/ExtensionSystem: Make member functions const/static

readability-make-member-function-const finds lots of member functions
that could be made const. This change just picks getter functions that
really should be const.

readability-convert-member-functions-to-static finds non-static member
functions which do not access this. This change turns most of them
into static ones, but leaves some non static to keep the class API
consistent.

readability-static-accessed-through-instance fixes the places where
the originally non-static, now static functions were called through
instance.

Change-Id: I8cf16c01f7988a7c9d073b5f8ede6a9706b94fb0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2020-11-21 01:04:56 +01:00
parent 5951b26f1a
commit 81f3452e1c
21 changed files with 83 additions and 86 deletions

View File

@@ -142,7 +142,7 @@ EditorView::EditorView(SplitterOrView *parentSplitterOrView, QWidget *parent) :
// item view
if (!qobject_cast<EditorToolBar*>(event->source()))
event->setDropAction(Qt::CopyAction);
if (event->type() == QDropEvent::DragEnter && !dropSupport->isFileDrop(event))
if (event->type() == QDropEvent::DragEnter && !DropSupport::isFileDrop(event))
return false; // do not accept drops without files
return event->source() != m_toolBar; // do not accept drops on ourselves
});

View File

@@ -790,7 +790,7 @@ void ICore::addPreCloseListener(const std::function<bool ()> &listener)
*/
QString ICore::systemInformation()
{
QString result = PluginManager::instance()->systemInformation() + '\n';
QString result = PluginManager::systemInformation() + '\n';
result += versionString() + '\n';
result += buildCompatibilityString() + '\n';
#ifdef IDE_REVISION

View File

@@ -49,8 +49,9 @@ EditorDiagramView::EditorDiagramView(QWidget *parent)
{
auto droputils = new Utils::DropSupport(
this,
[](QDropEvent *event, Utils::DropSupport *dropSupport)
-> bool { return dropSupport->isFileDrop(event) || dropSupport->isValueDrop(event); });
[](QDropEvent *event, Utils::DropSupport *)
-> bool { return Utils::DropSupport::isFileDrop(event)
|| Utils::DropSupport::isValueDrop(event); });
connect(droputils, &Utils::DropSupport::filesDropped,
this, &EditorDiagramView::dropFiles);
connect(droputils, &Utils::DropSupport::valuesDropped,