OpenCoverage

qqmllistmodelworkeragent.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmllistmodelworkeragent.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QQmlListModelWorkerAgent::Sync::~Sync()-
7{-
8}-
9-
10QQmlListModelWorkerAgent::QQmlListModelWorkerAgent(QQmlListModel *model)-
11: m_ref(1), m_orig(model), m_copy(new QQmlListModel(model, this))-
12{-
13}
executed 904 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
904
14-
15QQmlListModelWorkerAgent::~QQmlListModelWorkerAgent()-
16{-
17 mutex.lock();-
18 syncDone.wakeAll();-
19 mutex.unlock();-
20}
executed 902 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
902
21-
22void QQmlListModelWorkerAgent::setEngine(QV4::ExecutionEngine *eng)-
23{-
24 m_copy->m_engine = eng;-
25}
executed 928 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
928
26-
27void QQmlListModelWorkerAgent::addref()-
28{-
29 m_ref.ref();-
30}
executed 2814 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
2814
31-
32void QQmlListModelWorkerAgent::release()-
33{-
34 bool del = !m_ref.deref();-
35-
36 if (del
delDescription
TRUEevaluated 904 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
FALSEevaluated 2814 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
)
904-2814
37 deleteLater();
executed 904 times by 2 tests: deleteLater();
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
904
38}
executed 3718 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
3718
39-
40void QQmlListModelWorkerAgent::modelDestroyed()-
41{-
42 m_orig = nullptr;-
43}
executed 934 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
934
44-
45int QQmlListModelWorkerAgent::count() const-
46{-
47 return
executed 164 times by 1 test: return m_copy->count();
Executed by:
  • tst_qqmllistmodelworkerscript
m_copy->count();
executed 164 times by 1 test: return m_copy->count();
Executed by:
  • tst_qqmllistmodelworkerscript
164
48}-
49-
50void QQmlListModelWorkerAgent::clear()-
51{-
52 m_copy->clear();-
53}
executed 28 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
28
54-
55void QQmlListModelWorkerAgent::remove(QQmlV4Function *args)-
56{-
57 m_copy->remove(args);-
58}
executed 172 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
172
59-
60void QQmlListModelWorkerAgent::append(QQmlV4Function *args)-
61{-
62 m_copy->append(args);-
63}
executed 1006 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
1006
64-
65void QQmlListModelWorkerAgent::insert(QQmlV4Function *args)-
66{-
67 m_copy->insert(args);-
68}
executed 100 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
100
69-
70QQmlV4Handle QQmlListModelWorkerAgent::get(int index) const-
71{-
72 return
executed 258 times by 1 test: return m_copy->get(index);
Executed by:
  • tst_qqmllistmodelworkerscript
m_copy->get(index);
executed 258 times by 1 test: return m_copy->get(index);
Executed by:
  • tst_qqmllistmodelworkerscript
258
73}-
74-
75void QQmlListModelWorkerAgent::set(int index, const QQmlV4Handle &value)-
76{-
77 m_copy->set(index, value);-
78}
executed 160 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
160
79-
80void QQmlListModelWorkerAgent::setProperty(int index, const QString& property, const QVariant& value)-
81{-
82 m_copy->setProperty(index, property, value);-
83}
executed 72 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
72
84-
85void QQmlListModelWorkerAgent::move(int from, int to, int count)-
86{-
87 m_copy->move(from, to, count);-
88}
executed 104 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodelworkerscript
104
89-
90void QQmlListModelWorkerAgent::sync()-
91{-
92 Sync *s = new Sync(m_copy);-
93-
94 mutex.lock();-
95 QCoreApplication::postEvent(this, s);-
96 syncDone.wait(&mutex);-
97 mutex.unlock();-
98}
executed 908 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
908
99-
100bool QQmlListModelWorkerAgent::event(QEvent *e)-
101{-
102 if (e->type() == QEvent::User
e->type() == QEvent::UserDescription
TRUEevaluated 908 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
FALSEevaluated 1806 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
) {
908-1806
103 bool cc = false;-
104 QMutexLocker locker(&mutex);-
105 if (m_orig
m_origDescription
TRUEevaluated 902 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
) {
6-902
106 Sync *s = static_cast<Sync *>(e);-
107-
108 cc = (m_orig->count() != s->list->count());-
109-
110 ((m_orig->m_dynamicRoles == s->list->m_dynamicRoles) ? static_cast<void>(0) : qt_assert("m_orig->m_dynamicRoles == s->list->m_dynamicRoles", __FILE__, 157));-
111 if (m_orig->m_dynamicRoles
m_orig->m_dynamicRolesDescription
TRUEevaluated 468 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 434 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
)
434-468
112 QQmlListModel::sync(s->list, m_orig);
executed 468 times by 1 test: QQmlListModel::sync(s->list, m_orig);
Executed by:
  • tst_qqmllistmodelworkerscript
468
113 else-
114 ListModel::sync(s->list->m_listModel, m_orig->m_listModel);
executed 434 times by 1 test: ListModel::sync(s->list->m_listModel, m_orig->m_listModel);
Executed by:
  • tst_qqmllistmodelworkerscript
434
115 }-
116-
117 syncDone.wakeAll();-
118 locker.unlock();-
119-
120 if (cc
ccDescription
TRUEevaluated 660 times by 1 test
Evaluated by:
  • tst_qqmllistmodelworkerscript
FALSEevaluated 248 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
)
248-660
121 m_orig->countChanged();
executed 660 times by 1 test: m_orig->countChanged();
Executed by:
  • tst_qqmllistmodelworkerscript
660
122 return
executed 908 times by 2 tests: return true;
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
true;
executed 908 times by 2 tests: return true;
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
908
123 }-
124-
125 return
executed 1806 times by 2 tests: return QObject::event(e);
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
QObject::event(e);
executed 1806 times by 2 tests: return QObject::event(e);
Executed by:
  • tst_examples
  • tst_qqmllistmodelworkerscript
1806
126}-
127-
128-
129-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0