Changeset View
Changeset View
Standalone View
Standalone View
src/agentbase/agentbase.cpp
Show All 22 Lines | |||||
23 | #include "agentbase.h" | 23 | #include "agentbase.h" | ||
24 | #include "agentbase_p.h" | 24 | #include "agentbase_p.h" | ||
25 | 25 | | |||
26 | 26 | | |||
27 | #include "akonadifull-version.h" | 27 | #include "akonadifull-version.h" | ||
28 | #include "agentmanager.h" | 28 | #include "agentmanager.h" | ||
29 | #include "changerecorder.h" | 29 | #include "changerecorder.h" | ||
30 | #include "controladaptor.h" | 30 | #include "controladaptor.h" | ||
31 | #include "KDBusConnectionPool" | | |||
32 | #include "itemfetchjob.h" | 31 | #include "itemfetchjob.h" | ||
33 | #include "monitor_p.h" | 32 | #include "monitor_p.h" | ||
34 | #include "servermanager_p.h" | 33 | #include "servermanager_p.h" | ||
35 | #include "session.h" | 34 | #include "session.h" | ||
36 | #include "session_p.h" | 35 | #include "session_p.h" | ||
37 | #include "statusadaptor.h" | 36 | #include "statusadaptor.h" | ||
38 | #include "agentconfigurationdialog.h" | 37 | #include "agentconfigurationdialog.h" | ||
39 | #include "private/standarddirs_p.h" | 38 | #include "private/standarddirs_p.h" | ||
▲ Show 20 Lines • Show All 334 Lines • ▼ Show 20 Line(s) | 367 | { | |||
374 | 373 | | |||
375 | /** | 374 | /** | ||
376 | * Create a default session for this process. | 375 | * Create a default session for this process. | ||
377 | */ | 376 | */ | ||
378 | SessionPrivate::createDefaultSession(mId.toLatin1()); | 377 | SessionPrivate::createDefaultSession(mId.toLatin1()); | ||
379 | 378 | | |||
380 | mTracer = new org::freedesktop::Akonadi::Tracer(ServerManager::serviceName(ServerManager::Server), | 379 | mTracer = new org::freedesktop::Akonadi::Tracer(ServerManager::serviceName(ServerManager::Server), | ||
381 | QStringLiteral("/tracing"), | 380 | QStringLiteral("/tracing"), | ||
382 | KDBusConnectionPool::threadConnection(), q); | 381 | QDBusConnection::sessionBus(), q); | ||
383 | 382 | | |||
384 | new Akonadi__ControlAdaptor(q); | 383 | new Akonadi__ControlAdaptor(q); | ||
385 | new Akonadi__StatusAdaptor(q); | 384 | new Akonadi__StatusAdaptor(q); | ||
386 | if (!KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/"), q, QDBusConnection::ExportAdaptors)) { | 385 | if (!QDBusConnection::sessionBus().registerObject(QStringLiteral("/"), q, QDBusConnection::ExportAdaptors)) { | ||
387 | Q_EMIT q->error(i18n("Unable to register object at dbus: %1", KDBusConnectionPool::threadConnection().lastError().message())); | 386 | Q_EMIT q->error(i18n("Unable to register object at dbus: %1", QDBusConnection::sessionBus().lastError().message())); | ||
388 | } | 387 | } | ||
389 | 388 | | |||
390 | mSettings = new QSettings(ServerManager::agentConfigFilePath(mId), QSettings::IniFormat); | 389 | mSettings = new QSettings(ServerManager::agentConfigFilePath(mId), QSettings::IniFormat); | ||
391 | 390 | | |||
392 | mChangeRecorder = new ChangeRecorder(q); | 391 | mChangeRecorder = new ChangeRecorder(q); | ||
393 | mChangeRecorder->setObjectName(QStringLiteral("AgentBaseChangeRecorder")); | 392 | mChangeRecorder->setObjectName(QStringLiteral("AgentBaseChangeRecorder")); | ||
394 | mChangeRecorder->ignoreSession(Session::defaultSession()); | 393 | mChangeRecorder->ignoreSession(Session::defaultSession()); | ||
395 | mChangeRecorder->itemFetchScope().setCacheOnly(true); | 394 | mChangeRecorder->itemFetchScope().setCacheOnly(true); | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
456 | QTimer::singleShot(0, q, [this]{ delayedInit();}); | 455 | QTimer::singleShot(0, q, [this]{ delayedInit();}); | ||
457 | } | 456 | } | ||
458 | 457 | | |||
459 | void AgentBasePrivate::delayedInit() | 458 | void AgentBasePrivate::delayedInit() | ||
460 | { | 459 | { | ||
461 | Q_Q(AgentBase); | 460 | Q_Q(AgentBase); | ||
462 | 461 | | |||
463 | const QString serviceId = ServerManager::agentServiceName(ServerManager::Agent, mId); | 462 | const QString serviceId = ServerManager::agentServiceName(ServerManager::Agent, mId); | ||
464 | if (!KDBusConnectionPool::threadConnection().registerService(serviceId)) { | 463 | if (!QDBusConnection::sessionBus().registerService(serviceId)) { | ||
465 | qCCritical(AKONADIAGENTBASE_LOG) << "Unable to register service" << serviceId << "at dbus:" | 464 | qCCritical(AKONADIAGENTBASE_LOG) << "Unable to register service" << serviceId << "at dbus:" | ||
466 | << KDBusConnectionPool::threadConnection().lastError().message(); | 465 | << QDBusConnection::sessionBus().lastError().message(); | ||
467 | } | 466 | } | ||
468 | q->setOnlineInternal(mDesiredOnlineState); | 467 | q->setOnlineInternal(mDesiredOnlineState); | ||
469 | 468 | | |||
470 | KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/Debug"), this, QDBusConnection::ExportScriptableSlots); | 469 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/Debug"), this, QDBusConnection::ExportScriptableSlots); | ||
471 | } | 470 | } | ||
472 | 471 | | |||
473 | void AgentBasePrivate::setProgramName() | 472 | void AgentBasePrivate::setProgramName() | ||
474 | { | 473 | { | ||
475 | // ugly, really ugly, if you find another solution, change it and blame me for this code (Andras) | 474 | // ugly, really ugly, if you find another solution, change it and blame me for this code (Andras) | ||
476 | QString programName = mResourceTypeName; | 475 | QString programName = mResourceTypeName; | ||
477 | if (!mName.isEmpty()) { | 476 | if (!mName.isEmpty()) { | ||
478 | programName = i18nc("Name and type of Akonadi resource", "%1 of type %2", mName, mResourceTypeName); | 477 | programName = i18nc("Name and type of Akonadi resource", "%1 of type %2", mName, mResourceTypeName); | ||
▲ Show 20 Lines • Show All 628 Lines • ▼ Show 20 Line(s) | |||||
1107 | void AgentBase::configure(qlonglong windowId) | 1106 | void AgentBase::configure(qlonglong windowId) | ||
1108 | { | 1107 | { | ||
1109 | configure(static_cast<WId>(windowId)); | 1108 | configure(static_cast<WId>(windowId)); | ||
1110 | } | 1109 | } | ||
1111 | #endif | 1110 | #endif | ||
1112 | 1111 | | |||
1113 | WId AgentBase::winIdForDialogs() const | 1112 | WId AgentBase::winIdForDialogs() const | ||
1114 | { | 1113 | { | ||
1115 | const bool registered = KDBusConnectionPool::threadConnection().interface()->isServiceRegistered(QStringLiteral("org.freedesktop.akonaditray")); | 1114 | const bool registered = QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.freedesktop.akonaditray")); | ||
1116 | if (!registered) { | 1115 | if (!registered) { | ||
1117 | return 0; | 1116 | return 0; | ||
1118 | } | 1117 | } | ||
1119 | 1118 | | |||
1120 | QDBusInterface dbus(QStringLiteral("org.freedesktop.akonaditray"), QStringLiteral("/Actions"), | 1119 | QDBusInterface dbus(QStringLiteral("org.freedesktop.akonaditray"), QStringLiteral("/Actions"), | ||
1121 | QStringLiteral("org.freedesktop.Akonadi.Tray")); | 1120 | QStringLiteral("org.freedesktop.Akonadi.Tray")); | ||
1122 | const QDBusMessage reply = dbus.call(QStringLiteral("getWinId")); | 1121 | const QDBusMessage reply = dbus.call(QStringLiteral("getWinId")); | ||
1123 | 1122 | | |||
▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines |