summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-11-14 01:01:34 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-11-14 01:55:56 +0100
commit7bbe78946807a951a5513feb3a187d51f862d8a5 (patch)
treedfb9db4905adb9070d74856effda8eea9d95689e /src/control
parent3a9048073bf045c40ae015d61634bf6248540ce2 (diff)
controlobjectscript: Use QVector instead of QList
QVector should be used if the contained type is larger than the current platform's pointer type. Fixes -Wclazy-inefficient-qlist-soft warning. See https://github.com/KDE/clazy/blob/master/docs/checks/README-inefficient-qlist-soft.md for details.
Diffstat (limited to 'src/control')
-rw-r--r--src/control/controlobjectscript.cpp4
-rw-r--r--src/control/controlobjectscript.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/control/controlobjectscript.cpp b/src/control/controlobjectscript.cpp
index 429a4d0230..ae6438e87e 100644
--- a/src/control/controlobjectscript.cpp
+++ b/src/control/controlobjectscript.cpp
@@ -66,7 +66,7 @@ bool ControlObjectScript::removeScriptConnection(const ScriptConnection& conn) {
void ControlObjectScript::disconnectAllConnectionsToFunction(const QScriptValue& function) {
// Make a local copy of m_scriptConnections because items are removed within the loop.
- const QList<ScriptConnection> connections = m_scriptConnections;
+ const QVector<ScriptConnection> connections = m_scriptConnections;
for (const auto& conn: connections) {
if (conn.callback.strictlyEquals(function)) {
removeScriptConnection(conn);
@@ -79,7 +79,7 @@ void ControlObjectScript::slotValueChanged(double value, QObject*) {
// This allows a script to disconnect a callback from inside the
// the callback. Otherwise the this may crash since the disconnect call
// happens during conn.function.call() in the middle of the loop below.
- const QList<ScriptConnection> connections = m_scriptConnections;
+ const QVector<ScriptConnection> connections = m_scriptConnections;
for (auto&& conn: connections) {
conn.executeCallback(value);
}
diff --git a/src/control/controlobjectscript.h b/src/control/controlobjectscript.h
index 853c1435cf..87bf2171fa 100644
--- a/src/control/controlobjectscript.h
+++ b/src/control/controlobjectscript.h
@@ -38,7 +38,7 @@ class ControlObjectScript : public ControlProxy {
void slotValueChanged(double v, QObject*);
private:
- QList<ScriptConnection> m_scriptConnections;
+ QVector<ScriptConnection> m_scriptConnections;
};
#endif // CONTROLOBJECTSCRIPT_H