[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5

Maximiliano Curia maxy at moszumanska.debian.org
Fri May 27 23:58:34 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=56219ac

The following commit has been merged in the master branch:
commit 56219ac460403bf62a4a62509f5ad8bee26e3c44
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Sat Jan 8 21:41:05 2011 +0000

    Refactor AccountEditWidget to pass ProtocolInfo rather than several QStrings seperately.
    This simplifies bits of code and reduces the chance of sending garbage data to the account edit widget.
    Also gives the account edit access to the protocol icon.
---
 src/KCMTelepathyAccounts/account-edit-widget.cpp | 10 ++++------
 src/KCMTelepathyAccounts/account-edit-widget.h   |  4 +---
 src/KCMTelepathyAccounts/protocol-item.cpp       |  6 +++---
 src/KCMTelepathyAccounts/protocol-item.h         |  3 +--
 src/add-account-assistant.cpp                    |  8 +-------
 src/edit-account-dialog.cpp                      |  7 ++-----
 6 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/src/KCMTelepathyAccounts/account-edit-widget.cpp b/src/KCMTelepathyAccounts/account-edit-widget.cpp
index b2afd2f..1bd635b 100644
--- a/src/KCMTelepathyAccounts/account-edit-widget.cpp
+++ b/src/KCMTelepathyAccounts/account-edit-widget.cpp
@@ -51,9 +51,7 @@ public:
     QList<ProtocolParameterValue> advancedParameterValues;
 };
 
-AccountEditWidget::AccountEditWidget(const QString &connectionManager,
-                                     const QString &protocol,
-                                     const Tp::ProtocolParameterList &parameters,
+AccountEditWidget::AccountEditWidget(const Tp::ProtocolInfo &info,
                                      const QVariantMap &parameterValues,
                                      QWidget *parent)
         : QWidget(parent),
@@ -69,9 +67,9 @@ AccountEditWidget::AccountEditWidget(const QString &connectionManager,
     QHBoxLayout* layout = new QHBoxLayout(d->ui.centralWidget);
     layout->setContentsMargins(0,0,0,0);
 
-    d->connectionManager = connectionManager;
-    d->protocol = protocol;
-    d->parameters = parameters;
+    d->connectionManager = info.cmName();
+    d->protocol = info.name();
+    d->parameters = info.parameters();
     d->parameterValues = parameterValues;
 
     connect(d->ui.advancedButton, SIGNAL(clicked()),
diff --git a/src/KCMTelepathyAccounts/account-edit-widget.h b/src/KCMTelepathyAccounts/account-edit-widget.h
index 8724820..9e8ac68 100644
--- a/src/KCMTelepathyAccounts/account-edit-widget.h
+++ b/src/KCMTelepathyAccounts/account-edit-widget.h
@@ -35,9 +35,7 @@ class KDE_EXPORT AccountEditWidget : public QWidget
     Q_OBJECT
 
 public:
-    explicit AccountEditWidget(const QString &connectionManager,
-                               const QString &protocol,
-                               const Tp::ProtocolParameterList &parameters,
+    explicit AccountEditWidget(const Tp::ProtocolInfo &info,
                                const QVariantMap &parameterValues = QVariantMap(),
                                QWidget *parent = 0);
     virtual ~AccountEditWidget();
diff --git a/src/KCMTelepathyAccounts/protocol-item.cpp b/src/KCMTelepathyAccounts/protocol-item.cpp
index 49f588d..2a68443 100644
--- a/src/KCMTelepathyAccounts/protocol-item.cpp
+++ b/src/KCMTelepathyAccounts/protocol-item.cpp
@@ -54,7 +54,7 @@ QString ProtocolItem::localizedName() const
     return m_localizedName;
 }
 
-Tp::ProtocolParameterList ProtocolItem::parameters() const
+Tp::ProtocolInfo ProtocolItem::protocolInfo() const
 {
     kDebug();
 
@@ -65,9 +65,9 @@ Tp::ProtocolParameterList ProtocolItem::parameters() const
 
     foreach (const Tp::ProtocolInfo &info, cm->protocols()) {
         if (info.name() == m_protocol)
-            return info.parameters();
+            return info;
     }
-    return Tp::ProtocolParameterList();
+    return Tp::ProtocolInfo();
 }
 
 #include "protocol-item.moc"
diff --git a/src/KCMTelepathyAccounts/protocol-item.h b/src/KCMTelepathyAccounts/protocol-item.h
index 90b96ee..759956e 100644
--- a/src/KCMTelepathyAccounts/protocol-item.h
+++ b/src/KCMTelepathyAccounts/protocol-item.h
@@ -41,8 +41,7 @@ public:
 
     QString protocol() const;
     QString localizedName() const;
-
-    Tp::ProtocolParameterList parameters() const;
+    Tp::ProtocolInfo protocolInfo() const;
 
 private:
     QString m_protocol;
diff --git a/src/add-account-assistant.cpp b/src/add-account-assistant.cpp
index 6b7647f..184cf93 100644
--- a/src/add-account-assistant.cpp
+++ b/src/add-account-assistant.cpp
@@ -121,10 +121,6 @@ void AddAccountAssistant::next()
             kWarning() << "cmItem is invalid.";
         }
 
-        QString connectionManager = cmItem->connectionManager()->name();
-        QString protocol = item->protocol();
-        Tp::ProtocolParameterList parameters = item->parameters();
-
         // Delete the widgets for the next page if they already exist
         if (d->accountEditWidget) {
             d->accountEditWidget->deleteLater();
@@ -132,9 +128,7 @@ void AddAccountAssistant::next()
         }
 
         // Set up the account edit widget
-        d->accountEditWidget = new AccountEditWidget(connectionManager,
-                                                     protocol,
-                                                     parameters,
+        d->accountEditWidget = new AccountEditWidget(item->protocolInfo(),
                                                      QVariantMap(),
                                                      d->pageTwoWidget);
         d->pageTwoWidget->layout()->addWidget(d->accountEditWidget);
diff --git a/src/edit-account-dialog.cpp b/src/edit-account-dialog.cpp
index 27b0e73..b787dac 100644
--- a/src/edit-account-dialog.cpp
+++ b/src/edit-account-dialog.cpp
@@ -58,17 +58,14 @@ EditAccountDialog::EditAccountDialog(AccountItem *item, QWidget *parent)
 
     // Get the protocol's parameters and values.
     Tp::ProtocolInfo protocolInfo = d->item->account()->protocolInfo();
-    Tp::ProtocolParameterList protocolParameters = protocolInfo.parameters();
     QVariantMap parameterValues = d->item->account()->parameters();
 
     // Set up the interface
-    d->widget = new AccountEditWidget(d->item->account()->cmName(),
-                                      d->item->account()->protocolName(),
-                                      protocolParameters,
+    d->widget = new AccountEditWidget(protocolInfo,
                                       parameterValues,
                                       this);
     setMainWidget(d->widget);
-    resize(400, 480);
+//    resize(400, 480);
 }
 
 EditAccountDialog::~EditAccountDialog()

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list