59 | 59 |
#include <TelepathyQt/PendingComposite>
|
60 | 60 |
#include <TelepathyQt/ConnectionManager>
|
61 | 61 |
|
62 | |
#ifdef HAVE_TPLOGGERQT
|
63 | |
#include <TelepathyLoggerQt4/LogManager>
|
64 | |
#include <TelepathyLoggerQt4/Init>
|
65 | |
#include <TelepathyLoggerQt4/PendingOperation>
|
66 | |
#endif
|
|
62 |
#include <KTp/Logger/log-manager.h>
|
67 | 63 |
|
68 | 64 |
K_PLUGIN_FACTORY(KCMTelepathyAccountsFactory, registerPlugin<KCMTelepathyAccounts>();)
|
69 | 65 |
K_EXPORT_PLUGIN(KCMTelepathyAccountsFactory("kcm_ktp_accounts", "kcm_ktp_accounts"))
|
|
90 | 86 |
|
91 | 87 |
// The first thing we must do is register Telepathy DBus Types.
|
92 | 88 |
Tp::registerTypes();
|
93 | |
#ifdef HAVE_TPLOGGERQT
|
94 | |
Tpl::init();
|
95 | |
#endif
|
96 | 89 |
|
97 | 90 |
// Start setting up the Telepathy AccountManager.
|
98 | 91 |
Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
|
|
412 | 405 |
dialog->setButtonGuiItem(KDialog::Yes, KGuiItem(i18n("Remove Account"), QLatin1String("edit-delete")));
|
413 | 406 |
bool removeLogs = false;
|
414 | 407 |
|
415 | |
// Don't show the 'Remove logs' checkbox when we don't support TpLogger
|
416 | |
#ifdef HAVE_TPLOGGERQT
|
417 | 408 |
const QString msg = i18n("Remove conversations logs");
|
418 | |
#else
|
419 | |
const QString msg;
|
420 | |
#endif
|
421 | |
|
422 | 409 |
if (KMessageBox::createKMessageBox(dialog, QMessageBox::Warning, i18n("Are you sure you want to remove the account \"%1\"?", accountName),
|
423 | 410 |
QStringList(), msg , &removeLogs,
|
424 | 411 |
KMessageBox::Dangerous | KMessageBox::Notify) == KDialog::Yes) {
|
|
428 | 415 |
return;
|
429 | 416 |
}
|
430 | 417 |
|
431 | |
#ifdef HAVE_TPLOGGERQT
|
432 | 418 |
if (removeLogs) {
|
433 | |
Tpl::LogManagerPtr logManager = Tpl::LogManager::instance();
|
434 | |
logManager->clearAccountHistory(account);
|
|
419 |
KTp::LogManager *logManager = KTp::LogManager::instance();
|
|
420 |
logManager->clearAccountLogs(account);
|
435 | 421 |
}
|
436 | |
#endif
|
437 | 422 |
|
438 | 423 |
QList<Tp::PendingOperation*> ops;
|
439 | 424 |
ops.append(KTp::WalletUtils::removeAccountPassword(account));
|