aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrank Meerkoetter <frank.meerkoetter@basyskom.com>2015-12-11 20:37:32 +0100
committerFrank Meerkoetter <frank.meerkoetter@basyskom.com>2015-12-15 05:11:29 +0000
commite77bf29218c9421d0d24c4a8954ebcea69ea81ed (patch)
treec07c2bf8c29c2d4ea632ed1aaf6e896746176742 /src
parent40c725099afe809d825b864ca1ba20dd4d54da7c (diff)
Provide a proper constructor
Fixes coverity CID10755. A proper constructor enforces that the 'Sync' type is properly initialized. Change-Id: I8a4758e5bb1cfea09664961b3d32db5ddf0e4515 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/types/qqmllistmodelworkeragent.cpp4
-rw-r--r--src/qml/types/qqmllistmodelworkeragent_p.h6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/types/qqmllistmodelworkeragent.cpp b/src/qml/types/qqmllistmodelworkeragent.cpp
index 76aab248bc..bcf9cd94f7 100644
--- a/src/qml/types/qqmllistmodelworkeragent.cpp
+++ b/src/qml/types/qqmllistmodelworkeragent.cpp
@@ -161,9 +161,7 @@ void QQmlListModelWorkerAgent::move(int from, int to, int count)
void QQmlListModelWorkerAgent::sync()
{
- Sync *s = new Sync;
- s->data = data;
- s->list = m_copy;
+ Sync *s = new Sync(data, m_copy);
data.changes.clear();
mutex.lock();
diff --git a/src/qml/types/qqmllistmodelworkeragent_p.h b/src/qml/types/qqmllistmodelworkeragent_p.h
index be5217eaa4..76603e4a8e 100644
--- a/src/qml/types/qqmllistmodelworkeragent_p.h
+++ b/src/qml/types/qqmllistmodelworkeragent_p.h
@@ -129,7 +129,11 @@ private:
Data data;
struct Sync : public QEvent {
- Sync() : QEvent(QEvent::User) {}
+ Sync(const Data &d, QQmlListModel *l)
+ : QEvent(QEvent::User)
+ , data(d)
+ , list(l)
+ {}
Data data;
QQmlListModel *list;
};