| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmllistmodelworkeragent.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | QQmlListModelWorkerAgent::Sync::~Sync() | - | ||||||
| 7 | { | - | ||||||
| 8 | } | - | ||||||
| 9 | - | |||||||
| 10 | QQmlListModelWorkerAgent::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 blockExecuted by:
| 904 | ||||||
| 14 | - | |||||||
| 15 | QQmlListModelWorkerAgent::~QQmlListModelWorkerAgent() | - | ||||||
| 16 | { | - | ||||||
| 17 | mutex.lock(); | - | ||||||
| 18 | syncDone.wakeAll(); | - | ||||||
| 19 | mutex.unlock(); | - | ||||||
| 20 | } executed 902 times by 1 test: end of blockExecuted by:
| 902 | ||||||
| 21 | - | |||||||
| 22 | void QQmlListModelWorkerAgent::setEngine(QV4::ExecutionEngine *eng) | - | ||||||
| 23 | { | - | ||||||
| 24 | m_copy->m_engine = eng; | - | ||||||
| 25 | } executed 928 times by 2 tests: end of blockExecuted by:
| 928 | ||||||
| 26 | - | |||||||
| 27 | void QQmlListModelWorkerAgent::addref() | - | ||||||
| 28 | { | - | ||||||
| 29 | m_ref.ref(); | - | ||||||
| 30 | } executed 2814 times by 2 tests: end of blockExecuted by:
| 2814 | ||||||
| 31 | - | |||||||
| 32 | void QQmlListModelWorkerAgent::release() | - | ||||||
| 33 | { | - | ||||||
| 34 | bool del = !m_ref.deref(); | - | ||||||
| 35 | - | |||||||
| 36 | if (del
| 904-2814 | ||||||
| 37 | deleteLater(); executed 904 times by 2 tests: deleteLater();Executed by:
| 904 | ||||||
| 38 | } executed 3718 times by 2 tests: end of blockExecuted by:
| 3718 | ||||||
| 39 | - | |||||||
| 40 | void QQmlListModelWorkerAgent::modelDestroyed() | - | ||||||
| 41 | { | - | ||||||
| 42 | m_orig = nullptr; | - | ||||||
| 43 | } executed 934 times by 2 tests: end of blockExecuted by:
| 934 | ||||||
| 44 | - | |||||||
| 45 | int QQmlListModelWorkerAgent::count() const | - | ||||||
| 46 | { | - | ||||||
| 47 | return executed 164 times by 1 test: m_copy->count();return m_copy->count();Executed by:
executed 164 times by 1 test: return m_copy->count();Executed by:
| 164 | ||||||
| 48 | } | - | ||||||
| 49 | - | |||||||
| 50 | void QQmlListModelWorkerAgent::clear() | - | ||||||
| 51 | { | - | ||||||
| 52 | m_copy->clear(); | - | ||||||
| 53 | } executed 28 times by 1 test: end of blockExecuted by:
| 28 | ||||||
| 54 | - | |||||||
| 55 | void QQmlListModelWorkerAgent::remove(QQmlV4Function *args) | - | ||||||
| 56 | { | - | ||||||
| 57 | m_copy->remove(args); | - | ||||||
| 58 | } executed 172 times by 1 test: end of blockExecuted by:
| 172 | ||||||
| 59 | - | |||||||
| 60 | void QQmlListModelWorkerAgent::append(QQmlV4Function *args) | - | ||||||
| 61 | { | - | ||||||
| 62 | m_copy->append(args); | - | ||||||
| 63 | } executed 1006 times by 2 tests: end of blockExecuted by:
| 1006 | ||||||
| 64 | - | |||||||
| 65 | void QQmlListModelWorkerAgent::insert(QQmlV4Function *args) | - | ||||||
| 66 | { | - | ||||||
| 67 | m_copy->insert(args); | - | ||||||
| 68 | } executed 100 times by 1 test: end of blockExecuted by:
| 100 | ||||||
| 69 | - | |||||||
| 70 | QQmlV4Handle QQmlListModelWorkerAgent::get(int index) const | - | ||||||
| 71 | { | - | ||||||
| 72 | return executed 258 times by 1 test: m_copy->get(index);return m_copy->get(index);Executed by:
executed 258 times by 1 test: return m_copy->get(index);Executed by:
| 258 | ||||||
| 73 | } | - | ||||||
| 74 | - | |||||||
| 75 | void QQmlListModelWorkerAgent::set(int index, const QQmlV4Handle &value) | - | ||||||
| 76 | { | - | ||||||
| 77 | m_copy->set(index, value); | - | ||||||
| 78 | } executed 160 times by 1 test: end of blockExecuted by:
| 160 | ||||||
| 79 | - | |||||||
| 80 | void 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 blockExecuted by:
| 72 | ||||||
| 84 | - | |||||||
| 85 | void 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 blockExecuted by:
| 104 | ||||||
| 89 | - | |||||||
| 90 | void 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 blockExecuted by:
| 908 | ||||||
| 99 | - | |||||||
| 100 | bool QQmlListModelWorkerAgent::event(QEvent *e) | - | ||||||
| 101 | { | - | ||||||
| 102 | if (e->type() == QEvent::User
| 908-1806 | ||||||
| 103 | bool cc = false; | - | ||||||
| 104 | QMutexLocker locker(&mutex); | - | ||||||
| 105 | if (m_orig
| 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
| 434-468 | ||||||
| 112 | QQmlListModel::sync(s->list, m_orig); executed 468 times by 1 test: QQmlListModel::sync(s->list, m_orig);Executed by:
| 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:
| 434 | ||||||
| 115 | } | - | ||||||
| 116 | - | |||||||
| 117 | syncDone.wakeAll(); | - | ||||||
| 118 | locker.unlock(); | - | ||||||
| 119 | - | |||||||
| 120 | if (cc
| 248-660 | ||||||
| 121 | m_orig->countChanged(); executed 660 times by 1 test: m_orig->countChanged();Executed by:
| 660 | ||||||
| 122 | return executed 908 times by 2 tests: true;return true;Executed by:
executed 908 times by 2 tests: return true;Executed by:
| 908 | ||||||
| 123 | } | - | ||||||
| 124 | - | |||||||
| 125 | return executed 1806 times by 2 tests: QObject::event(e);return QObject::event(e);Executed by:
executed 1806 times by 2 tests: return QObject::event(e);Executed by:
| 1806 | ||||||
| 126 | } | - | ||||||
| 127 | - | |||||||
| 128 | - | |||||||
| 129 | - | |||||||
| Switch to Source code | Preprocessed file |