Changeset View
Changeset View
Standalone View
Standalone View
tests/testlib/akonadifakestorage.cpp
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | 135 | if (m_data->item(item.id()).isValid()) { | |||
---|---|---|---|---|---|
144 | }, startMode); | 144 | }, startMode); | ||
145 | } else { | 145 | } else { | ||
146 | job->setExpectedError(1, QStringLiteral("Item doesn't exist")); | 146 | job->setExpectedError(1, QStringLiteral("Item doesn't exist")); | ||
147 | Utils::JobHandler::install(job, noop, startMode); | 147 | Utils::JobHandler::install(job, noop, startMode); | ||
148 | } | 148 | } | ||
149 | return job; | 149 | return job; | ||
150 | } | 150 | } | ||
151 | 151 | | |||
152 | KJob *AkonadiFakeStorage::removeItem(Akonadi::Item item) | 152 | KJob *AkonadiFakeStorage::removeItem(Akonadi::Item item, QObject *parent) | ||
153 | { | 153 | { | ||
154 | auto job = new FakeJob; | 154 | auto job = new FakeJob(parent); | ||
155 | if (m_data->item(item.id()).isValid()) { | 155 | if (m_data->item(item.id()).isValid()) { | ||
156 | Utils::JobHandler::install(job, [=] { | 156 | Utils::JobHandler::install(job, [=] { | ||
157 | if (!job->error()) { | 157 | if (!job->error()) { | ||
158 | m_data->removeItem(item); | 158 | m_data->removeItem(item); | ||
159 | } | 159 | } | ||
160 | }); | 160 | }); | ||
161 | } else { | 161 | } else { | ||
162 | job->setExpectedError(1, QStringLiteral("Item doesn't exist")); | 162 | job->setExpectedError(1, QStringLiteral("Item doesn't exist")); | ||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |