Changeset View
Changeset View
Standalone View
Standalone View
src/core/jobs/collectionattributessynchronizationjob.cpp
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | 12 | * Lesser General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | 14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library. If not, see <https://www.gnu.org/licenses/>. | 15 | * License along with this library. If not, see <https://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "collectionattributessynchronizationjob.h" | 18 | #include "collectionattributessynchronizationjob.h" | ||
19 | #include "KDBusConnectionPool" | 19 | #include <QDBusConnection> | ||
20 | #include "kjobprivatebase_p.h" | 20 | #include "kjobprivatebase_p.h" | ||
21 | #include "servermanager.h" | 21 | #include "servermanager.h" | ||
22 | #include "akonadicore_debug.h" | 22 | #include "akonadicore_debug.h" | ||
23 | 23 | | |||
24 | #include "agentinstance.h" | 24 | #include "agentinstance.h" | ||
25 | #include "agentmanager.h" | 25 | #include "agentmanager.h" | ||
26 | #include "collection.h" | 26 | #include "collection.h" | ||
27 | 27 | | |||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 91 | if (!instance.isValid()) { | |||
93 | q->setErrorText(i18n("Invalid resource instance.")); | 93 | q->setErrorText(i18n("Invalid resource instance.")); | ||
94 | q->emitResult(); | 94 | q->emitResult(); | ||
95 | return; | 95 | return; | ||
96 | } | 96 | } | ||
97 | 97 | | |||
98 | interface = new QDBusInterface(ServerManager::agentServiceName(ServerManager::Resource, instance.identifier()), | 98 | interface = new QDBusInterface(ServerManager::agentServiceName(ServerManager::Resource, instance.identifier()), | ||
99 | QStringLiteral("/"), | 99 | QStringLiteral("/"), | ||
100 | QStringLiteral("org.freedesktop.Akonadi.Resource"), | 100 | QStringLiteral("org.freedesktop.Akonadi.Resource"), | ||
101 | KDBusConnectionPool::threadConnection(), this); | 101 | QDBusConnection::sessionBus(), this); | ||
102 | connect(interface, SIGNAL(attributesSynchronized(qlonglong)), q, SLOT(slotSynchronized(qlonglong))); | 102 | connect(interface, SIGNAL(attributesSynchronized(qlonglong)), q, SLOT(slotSynchronized(qlonglong))); | ||
103 | 103 | | |||
104 | if (interface->isValid()) { | 104 | if (interface->isValid()) { | ||
105 | const QDBusMessage reply = interface->call(QStringLiteral("synchronizeCollectionAttributes"), collection.id()); | 105 | const QDBusMessage reply = interface->call(QStringLiteral("synchronizeCollectionAttributes"), collection.id()); | ||
106 | if (reply.type() == QDBusMessage::ErrorMessage) { | 106 | if (reply.type() == QDBusMessage::ErrorMessage) { | ||
107 | // This means that the resource doesn't provide a synchronizeCollectionAttributes method, so we just finish the job | 107 | // This means that the resource doesn't provide a synchronizeCollectionAttributes method, so we just finish the job | ||
108 | q->emitResult(); | 108 | q->emitResult(); | ||
109 | return; | 109 | return; | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |