[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:00:28 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=4a4889e
The following commit has been merged in the master branch:
commit 4a4889e571fb5b27c864dde14193dbdf50c710ad
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date: Wed Oct 26 22:25:51 2011 +0200
Update common repository and use WalletInterface from there
---
src/CMakeLists.txt | 2 +-
src/add-account-assistant.cpp | 4 +-
src/common | 2 +-
src/edit-account-dialog.cpp | 6 +--
src/kcm-telepathy-accounts.cpp | 4 +-
src/wallet-interface.cpp | 101 -----------------------------------------
src/wallet-interface.h | 56 -----------------------
7 files changed, 9 insertions(+), 166 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 221c70f..67de5e1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,6 +8,7 @@ project (telepathy-accounts-kcm)
set (telepathy_accounts_kcm_SRCS
common/error-dictionary.cpp
+ common/wallet-interface.cpp
kcm-telepathy-accounts.cpp
accounts-list-model.cpp
account-item.cpp
@@ -15,7 +16,6 @@ set (telepathy_accounts_kcm_SRCS
edit-account-dialog.cpp
salut-enable-dialog.cpp
accounts-list-delegate.cpp
- wallet-interface.cpp
)
kde4_add_ui_files (telepathy_accounts_kcm_SRCS
diff --git a/src/add-account-assistant.cpp b/src/add-account-assistant.cpp
index 59108e5..ec4ebc9 100644
--- a/src/add-account-assistant.cpp
+++ b/src/add-account-assistant.cpp
@@ -22,7 +22,7 @@
#include "add-account-assistant.h"
-#include "wallet-interface.h"
+#include "common/wallet-interface.h"
#include "KCMTelepathyAccounts/abstract-account-parameters-widget.h"
#include "KCMTelepathyAccounts/abstract-account-ui.h"
@@ -248,7 +248,7 @@ void AddAccountAssistant::onAccountCreated(Tp::PendingOperation *op)
//save password to KWallet if needed
QVariantMap values = d->accountEditWidget->parametersSet();
if (values.contains(QLatin1String("password"))) {
- WalletInterface wallet(this->effectiveWinId());
+ KTelepathy::WalletInterface wallet(this->effectiveWinId());
wallet.setPassword(account, values["password"].toString());
}
diff --git a/src/common b/src/common
index b748bcf..c0b6bc9 160000
--- a/src/common
+++ b/src/common
@@ -1 +1 @@
-Subproject commit b748bcfeff92a3f356735341f28663793959e446
+Subproject commit c0b6bc91daab6c4992a38191db471513546af25e
diff --git a/src/edit-account-dialog.cpp b/src/edit-account-dialog.cpp
index aeca24a..0602c00 100644
--- a/src/edit-account-dialog.cpp
+++ b/src/edit-account-dialog.cpp
@@ -21,7 +21,7 @@
#include "edit-account-dialog.h"
-#include "wallet-interface.h"
+#include "common/wallet-interface.h"
#include "KCMTelepathyAccounts/dictionary.h"
#include "KCMTelepathyAccounts/abstract-account-parameters-widget.h"
@@ -74,7 +74,7 @@ EditAccountDialog::EditAccountDialog(AccountItem *item, QWidget *parent)
//update the parameter model with the password from kwallet (if applicable)
Tp::ProtocolParameter passwordParameter = parameterModel->parameter(QLatin1String("password"));
- WalletInterface wallet(this->effectiveWinId());
+ KTelepathy::WalletInterface wallet(this->effectiveWinId());
if (passwordParameter.isValid() && wallet.hasPassword(d->item->account())) {
QModelIndex index = parameterModel->indexForParameter(passwordParameter);
QString password = wallet.password(d->item->account());
@@ -149,7 +149,7 @@ void EditAccountDialog::onParametersUpdated(Tp::PendingOperation *op)
QVariantMap values = d->widget->parametersSet();
if (values.contains(QLatin1String("password"))) {
- WalletInterface wallet(this->effectiveWinId());
+ KTelepathy::WalletInterface wallet(this->effectiveWinId());
wallet.setPassword(d->item->account(), values["password"].toString());
}
diff --git a/src/kcm-telepathy-accounts.cpp b/src/kcm-telepathy-accounts.cpp
index c0511f5..7840a58 100644
--- a/src/kcm-telepathy-accounts.cpp
+++ b/src/kcm-telepathy-accounts.cpp
@@ -28,7 +28,7 @@
#include "edit-account-dialog.h"
#include "salut-enable-dialog.h"
#include "accounts-list-delegate.h"
-#include "wallet-interface.h"
+#include "common/wallet-interface.h"
#include <QLabel>
#include <QSortFilterProxyModel>
@@ -310,7 +310,7 @@ void KCMTelepathyAccounts::onRemoveAccountClicked()
QString(), KMessageBox::Notify | KMessageBox::Dangerous) == KMessageBox::Continue)
{
AccountItem *item = m_accountsListModel->itemForIndex(m_currentModel->mapToSource(index));
- WalletInterface wallet(this->effectiveWinId());
+ KTelepathy::WalletInterface wallet(this->effectiveWinId());
wallet.removePassword(item->account());
m_accountsListModel->removeAccount(m_currentModel->mapToSource(index));
diff --git a/src/wallet-interface.cpp b/src/wallet-interface.cpp
deleted file mode 100644
index 70ff92c..0000000
--- a/src/wallet-interface.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * This file is part of telepathy-accounts-kcm
- *
- * Copyright (C) 2011 David Edmundson <kde at davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "wallet-interface.h"
-
-#include <KDebug>
-
-
-const QLatin1String WalletInterface::s_folderName = QLatin1String("telepathy-kde");
-
-
-WalletInterface::WalletInterface(WId winId):
- m_wallet(KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), winId))
-{
-}
-
-WalletInterface::~WalletInterface()
-{
-}
-
-bool WalletInterface::hasPassword(const Tp::AccountPtr &account)
-{
- if (m_wallet.isNull()) {
- return false;
- }
-
- if (m_wallet->hasFolder(s_folderName)) {
- m_wallet->setFolder(s_folderName);
- if (m_wallet->hasEntry(account->uniqueIdentifier())) {
- return true;
- }
- }
- return false;
-}
-
-QString WalletInterface::password(const Tp::AccountPtr &account)
-{
- if (m_wallet.isNull()) {
- return QString();
- }
-
- m_wallet->setFolder(s_folderName);
-
- QString password;
-
- if (m_wallet->hasEntry(account->uniqueIdentifier())) {
- int rc = m_wallet->readPassword(account->uniqueIdentifier(), password);
- if (rc != 0) {
- password.clear();
- kWarning() << "failed to read password from KWallet";
- }
- }
- return password;
-}
-
-void WalletInterface::setPassword(const Tp::AccountPtr &account, const QString &password)
-{
- if (m_wallet.isNull()) {
- return;
- }
-
- if (! m_wallet->hasFolder(s_folderName)) {
- m_wallet->createFolder(s_folderName);
- }
-
- m_wallet->setFolder(s_folderName);
- m_wallet->writePassword(account->uniqueIdentifier(), password);
- //sync normally happens on close, but in this case we need it to happen /now/ as it needs to be synced before the auth-client starts
- m_wallet->sync();
-}
-
-void WalletInterface::removePassword(const Tp::AccountPtr &account)
-{
- if (m_wallet.isNull()) {
- return;
- }
-
- if (! m_wallet->hasFolder(s_folderName)) {
- return;
- }
-
- m_wallet->setFolder(s_folderName);
- m_wallet->removeEntry(account->uniqueIdentifier());
-}
diff --git a/src/wallet-interface.h b/src/wallet-interface.h
deleted file mode 100644
index f5b0cf6..0000000
--- a/src/wallet-interface.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This file is part of telepathy-accounts-kcm
- *
- * Copyright (C) 2011 David Edmundson <kde at davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef WALLETINTERFACE_H
-#define WALLETINTERFACE_H
-
-#include <TelepathyQt4/Account>
-
-#include <KWallet/Wallet>
-
-#include <QScopedPointer>
-
-class WalletInterface
-{
-public:
-
- WalletInterface(WId winId);
- virtual ~WalletInterface();
-
- /** Returns true if a password is stored for this acount*/
- bool hasPassword(const Tp::AccountPtr &account);
-
- /** Returns the stored password*/
- QString password(const Tp::AccountPtr &account);
-
- /** Set the password entry for the given account to a new password*/
- void setPassword(const Tp::AccountPtr &account, const QString &password);
-
- /** Remove the entry from kwallet*/
- void removePassword(const Tp::AccountPtr &account);
-
-private:
- static const QLatin1String s_folderName;
-
- QScopedPointer<KWallet::Wallet> m_wallet;
-
-};
-
-#endif // WALLETINTERFACE_H
--
ktp-accounts-kcm packaging
More information about the pkg-kde-commits
mailing list