Don't modify a temporary object
Summary: Instead copy the object, operate it and update it into the object. Test Plan: just used plasma shell and ran the tests. I'm not sure who uses this. Issue found with clazy. Reviewers: #plasma, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D21483
This commit is contained in:
parent
f631aec33f
commit
0b18d4f0b3
@ -110,9 +110,12 @@ void StorageThread::save(QPointer<StorageJob> wcaller, const QVariantMap ¶ms
|
||||
valueGroup = QStringLiteral("default");
|
||||
}
|
||||
QSqlQuery query(m_db);
|
||||
|
||||
QVariantMap data = caller->data();
|
||||
if (params.value(QStringLiteral("key")).toString().isNull()) {
|
||||
caller->data().insert(params.value(QStringLiteral("key")).toString(), params.value(QStringLiteral("data")));
|
||||
data.insert(params.value(QStringLiteral("key")).toString(), params.value(QStringLiteral("data")));
|
||||
}
|
||||
caller->setData(data);
|
||||
|
||||
QMapIterator<QString, QVariant> it(caller->data());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user