Changeset View
Changeset View
Standalone View
Standalone View
src/personpluginmanager.cpp
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Line(s) | 155 | for (auto p : qAsConst(s_instance->dataSourcePlugins)) { | |||
---|---|---|---|---|---|
156 | auto v2 = dynamic_cast<BasePersonsDataSourceV2*>(p); | 156 | auto v2 = dynamic_cast<BasePersonsDataSourceV2*>(p); | ||
157 | if (!v2) | 157 | if (!v2) | ||
158 | continue; | 158 | continue; | ||
159 | const bool deleted = v2->deleteContact(uri); | 159 | const bool deleted = v2->deleteContact(uri); | ||
160 | ret |= deleted; | 160 | ret |= deleted; | ||
161 | } | 161 | } | ||
162 | return ret; | 162 | return ret; | ||
163 | } | 163 | } | ||
164 | | ||||
165 | bool PersonPluginManager::addContact(const QString &pluginId, const QVariantMap &properties) | ||||
166 | { | ||||
167 | bool ret = false; | ||||
168 | for (auto p : qAsConst(s_instance->dataSourcePlugins)) { | ||||
169 | auto v2 = dynamic_cast<BasePersonsDataSourceV2*>(p); | ||||
170 | if (!v2) | ||||
171 | continue; | ||||
172 | | ||||
173 | if (v2->sourcePluginId() != pluginId) | ||||
174 | continue; | ||||
175 | | ||||
176 | const bool added = v2->addContact(properties); | ||||
177 | ret |= added; | ||||
178 | } | ||||
179 | return ret; | ||||
180 | } |