[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:06:40 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=a634d6d
The following commit has been merged in the master branch:
commit a634d6d7291d712f8491332d4a2dc68edc80bdf4
Author: Martin Klapetek <mklapetek at kde.org>
Date: Wed May 20 17:54:59 2015 +0200
Don't create the Tp account itself
This is now handled by the Mission Control plugin instead
---
plugins/kaccounts/kaccounts-ui-provider.cpp | 89 +++++++++++++++--------------
plugins/kaccounts/kaccounts-ui-provider.h | 2 +-
2 files changed, 47 insertions(+), 44 deletions(-)
diff --git a/plugins/kaccounts/kaccounts-ui-provider.cpp b/plugins/kaccounts/kaccounts-ui-provider.cpp
index 54f4802..c6e6213 100644
--- a/plugins/kaccounts/kaccounts-ui-provider.cpp
+++ b/plugins/kaccounts/kaccounts-ui-provider.cpp
@@ -40,6 +40,7 @@
#include <TelepathyQt/PendingAccount>
#include <TelepathyQt/ProfileManager>
#include <TelepathyQt/PendingStringList>
+#include <TelepathyQt/AccountSet>
#include <KLocalizedString>
#include <KSharedConfig>
@@ -203,17 +204,17 @@ void KAccountsUiProvider::showNewAccountDialog()
void KAccountsUiProvider::showConfigureAccountDialog(const quint32 accountId)
{
- KSharedConfigPtr kaccountsConfig = KSharedConfig::openConfig(QStringLiteral("kaccounts-ktprc"));
- KConfigGroup ktpKaccountsGroup = kaccountsConfig->group(QStringLiteral("kaccounts-ktp"));
- QString accountUid = ktpKaccountsGroup.readEntry(QString::number(accountId));
+ Q_FOREACH (const Tp::AccountPtr &account, d->accountManager->validAccounts()->accounts()) {
+ if (account->uniqueIdentifier().endsWith(QString::number(accountId))) {
+ d->account = account;
+ }
+ }
- if (accountUid.isEmpty()) {
- qWarning() << "Empty accountUid, returning...";
+ if (!d->account) {
+ qWarning() << "Couldn't find account for" << accountId;
return;
}
- d->account = d->accountManager->accountForObjectPath(accountUid);
-
// Get the protocol's parameters and values.
Tp::ProtocolInfo protocolInfo = d->account->protocolInfo();
Tp::ProtocolParameterList parameters = protocolInfo.parameters();
@@ -300,16 +301,18 @@ void KAccountsUiProvider::onCreateAccountDialogAccepted()
values.remove(QLatin1String("password"));
}
- d->accountEditWidget->updateDisplayName();
- Tp::PendingAccount *pa = d->accountManager->createAccount(d->profile->cmName(),
- d->profile->protocolName(),
- d->accountEditWidget->displayName(),
- values,
- properties);
-
- connect(pa,
- SIGNAL(finished(Tp::PendingOperation*)),
- SLOT(onAccountCreated(Tp::PendingOperation*)));
+ onAccountCreated(values);
+
+// d->accountEditWidget->updateDisplayName();
+// Tp::PendingAccount *pa = d->accountManager->createAccount(d->profile->cmName(),
+// d->profile->protocolName(),
+// d->accountEditWidget->displayName(),
+// values,
+// properties);
+//
+// connect(pa,
+// SIGNAL(finished(Tp::PendingOperation*)),
+// SLOT(onAccountCreated(Tp::PendingOperation*)));
}
void KAccountsUiProvider::onCreateAccountDialogRejected()
@@ -317,33 +320,33 @@ void KAccountsUiProvider::onCreateAccountDialogRejected()
Q_EMIT error(QString());
}
-void KAccountsUiProvider::onAccountCreated(Tp::PendingOperation *op)
+void KAccountsUiProvider::onAccountCreated(const QVariantMap &data)
{
- if (op->isError()) {
- Q_EMIT feedbackMessage(i18n("Failed to create account"),
- i18n("Possibly not all required fields are valid"),
- KMessageWidget::Error);
- qWarning() << "Adding Account failed:" << op->errorName() << op->errorMessage();
- Q_EMIT error(op->errorMessage());
- return;
- }
-
- // Get the PendingAccount.
- Tp::PendingAccount *pendingAccount = qobject_cast<Tp::PendingAccount*>(op);
- if (!pendingAccount) {
- Q_EMIT feedbackMessage(i18n("Something went wrong with Telepathy"),
- QString(),
- KMessageWidget::Error);
- qWarning() << "Method called with wrong type.";
- Q_EMIT error(QStringLiteral("Something went wrong with Telepathy"));
- return;
- }
-
- Tp::AccountPtr account = pendingAccount->account();
- account->setServiceName(d->profile->serviceName());
- if (d->accountEditWidget->connectOnAdd()) {
- account->setRequestedPresence(Tp::Presence::available());
- }
+// if (op->isError()) {
+// Q_EMIT feedbackMessage(i18n("Failed to create account"),
+// i18n("Possibly not all required fields are valid"),
+// KMessageWidget::Error);
+// qWarning() << "Adding Account failed:" << op->errorName() << op->errorMessage();
+// Q_EMIT error(op->errorMessage());
+// return;
+// }
+//
+// // Get the PendingAccount.
+// Tp::PendingAccount *pendingAccount = qobject_cast<Tp::PendingAccount*>(op);
+// if (!pendingAccount) {
+// Q_EMIT feedbackMessage(i18n("Something went wrong with Telepathy"),
+// QString(),
+// KMessageWidget::Error);
+// qWarning() << "Method called with wrong type.";
+// Q_EMIT error(QStringLiteral("Something went wrong with Telepathy"));
+// return;
+// }
+//
+// Tp::AccountPtr account = pendingAccount->account();
+// account->setServiceName(d->profile->serviceName());
+// if (d->accountEditWidget->connectOnAdd()) {
+// account->setRequestedPresence(Tp::Presence::available());
+// }
QVariantMap values = d->accountEditWidget->parametersSet();
diff --git a/plugins/kaccounts/kaccounts-ui-provider.h b/plugins/kaccounts/kaccounts-ui-provider.h
index 88386cd..709f08c 100644
--- a/plugins/kaccounts/kaccounts-ui-provider.h
+++ b/plugins/kaccounts/kaccounts-ui-provider.h
@@ -52,7 +52,7 @@ Q_SIGNALS:
private Q_SLOTS:
void onProfileManagerReady(Tp::PendingOperation*);
void onConnectionManagerReady(Tp::PendingOperation*);
- void onAccountCreated(Tp::PendingOperation*);
+ void onAccountCreated(const QVariantMap &data);
void onCreateAccountDialogAccepted();
void onCreateAccountDialogRejected();
void onConfigureAccountDialogAccepted();
--
ktp-accounts-kcm packaging
More information about the pkg-kde-commits
mailing list