Changeset View
Changeset View
Standalone View
Standalone View
kaccounts/kaccounts-ktp-plugin.cpp
Show All 26 Lines | |||||
27 | #include <TelepathyQt/PendingVariant> | 27 | #include <TelepathyQt/PendingVariant> | ||
28 | #include <TelepathyQt/AccountSet> | 28 | #include <TelepathyQt/AccountSet> | ||
29 | #include <TelepathyQt/AccountInterfaceStorageInterface> | 29 | #include <TelepathyQt/AccountInterfaceStorageInterface> | ||
30 | #include <TelepathyQt/Utils> | 30 | #include <TelepathyQt/Utils> | ||
31 | #include <TelepathyQt/PendingVariantMap> | 31 | #include <TelepathyQt/PendingVariantMap> | ||
32 | 32 | | |||
33 | #include <KSharedConfig> | 33 | #include <KSharedConfig> | ||
34 | #include <KConfigGroup> | 34 | #include <KConfigGroup> | ||
35 | #include <KPluginFactory> | ||||
35 | 36 | | |||
36 | #include <QTimer> | 37 | #include <QTimer> | ||
37 | #include <QStandardPaths> | 38 | #include <QStandardPaths> | ||
38 | #include <QDir> | 39 | #include <QDir> | ||
39 | #include <QDBusConnection> | 40 | #include <QDBusConnection> | ||
40 | 41 | | |||
41 | #include <KTp/Logger/log-manager.h> | 42 | #include <KTp/Logger/log-manager.h> | ||
42 | 43 | | |||
Show All 12 Lines | |||||
55 | 56 | | |||
56 | static QStringList s_knownProviders{QStringLiteral("haze-icq"), | 57 | static QStringList s_knownProviders{QStringLiteral("haze-icq"), | ||
57 | QStringLiteral("jabber"), | 58 | QStringLiteral("jabber"), | ||
58 | QStringLiteral("kde-talk"), | 59 | QStringLiteral("kde-talk"), | ||
59 | QStringLiteral("haze-sametime"), | 60 | QStringLiteral("haze-sametime"), | ||
60 | QStringLiteral("haze-yahoo"), | 61 | QStringLiteral("haze-yahoo"), | ||
61 | QStringLiteral("haze-gadugadu")}; | 62 | QStringLiteral("haze-gadugadu")}; | ||
62 | 63 | | |||
64 | K_PLUGIN_CLASS_WITH_JSON(KAccountsKTpPlugin, "kaccountsplugin.json") | ||||
65 | | ||||
63 | class KAccountsKTpPlugin::Private { | 66 | class KAccountsKTpPlugin::Private { | ||
64 | public: | 67 | public: | ||
65 | Private(KAccountsKTpPlugin *qq) { q = qq; migrationRef = 0; }; | 68 | Private(KAccountsKTpPlugin *qq) { q = qq; migrationRef = 0; }; | ||
66 | Tp::AccountPtr tpAccountForAccountId(const Accounts::AccountId accountId); | 69 | Tp::AccountPtr tpAccountForAccountId(const Accounts::AccountId accountId); | ||
67 | void migrateTelepathyAccounts(); | 70 | void migrateTelepathyAccounts(); | ||
68 | void migrateLogs(const QString &tpAccountId, const Accounts::AccountId accountId); | 71 | void migrateLogs(const QString &tpAccountId, const Accounts::AccountId accountId); | ||
69 | void derefMigrationCount(); | 72 | void derefMigrationCount(); | ||
70 | 73 | | |||
▲ Show 20 Lines • Show All 248 Lines • ▼ Show 20 Line(s) | 306 | if (migrationRef == 0) { | |||
319 | generalGroup.sync(); | 322 | generalGroup.sync(); | ||
320 | 323 | | |||
321 | qDebug() << "Migration done"; | 324 | qDebug() << "Migration done"; | ||
322 | } | 325 | } | ||
323 | } | 326 | } | ||
324 | 327 | | |||
325 | //--------------------------------------------------------------------------------------- | 328 | //--------------------------------------------------------------------------------------- | ||
326 | 329 | | |||
327 | KAccountsKTpPlugin::KAccountsKTpPlugin(QObject *parent) | 330 | KAccountsKTpPlugin::KAccountsKTpPlugin(QObject *parent, const QVariantList &args) | ||
328 | : KAccountsDPlugin(parent), | 331 | : KAccountsDPlugin(parent, args), | ||
329 | d(new Private(this)) | 332 | d(new Private(this)) | ||
330 | { | 333 | { | ||
331 | d->kaccountsConfig = KSharedConfig::openConfig(QStringLiteral("kaccounts-ktprc")); | 334 | d->kaccountsConfig = KSharedConfig::openConfig(QStringLiteral("kaccounts-ktprc")); | ||
332 | 335 | | |||
333 | Tp::registerTypes(); | 336 | Tp::registerTypes(); | ||
334 | 337 | | |||
335 | // Start setting up the Telepathy AccountManager. | 338 | // Start setting up the Telepathy AccountManager. | ||
336 | Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(), | 339 | Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(), | ||
Show All 38 Lines | 376 | { | |||
375 | Q_UNUSED(service); | 378 | Q_UNUSED(service); | ||
376 | } | 379 | } | ||
377 | 380 | | |||
378 | void KAccountsKTpPlugin::onServiceDisabled(const Accounts::AccountId accountId, const Accounts::Service &service) | 381 | void KAccountsKTpPlugin::onServiceDisabled(const Accounts::AccountId accountId, const Accounts::Service &service) | ||
379 | { | 382 | { | ||
380 | Q_UNUSED(accountId); | 383 | Q_UNUSED(accountId); | ||
381 | Q_UNUSED(service); | 384 | Q_UNUSED(service); | ||
382 | } | 385 | } | ||
386 | | ||||
387 | #include "kaccounts-ktp-plugin.moc" |