[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:57:34 UTC 2016


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

The following commit has been merged in the master branch:
commit 070be9ba049c2be4b8f76b0d18cd55f77f0316fe
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Mon Jul 27 21:27:15 2009 +0000

    Write the code for registering/returning the protocols provided by the plugin. This should probably be done with some kind of factory, but we can do without that for now ;).
    
    svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=1003226
---
 .../abstract-account-ui-plugin.cpp                 | 47 ++++++++++++++++++++--
 .../abstract-account-ui-plugin.h                   | 15 ++++++-
 2 files changed, 58 insertions(+), 4 deletions(-)

diff --git a/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.cpp b/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.cpp
index 1971c33..8aec3a8 100644
--- a/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.cpp
+++ b/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.cpp
@@ -18,17 +18,58 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
 #include "abstract-account-ui-plugin.h"
 
+#include <KDebug>
+
+class AbstractAccountUiPlugin::Private
+{
+public:
+    Private()
+    {
+        kDebug();
+    }
+
+    QMap<QString, QString> providedProtocols;
+};
+
+
 AbstractAccountUiPlugin::AbstractAccountUiPlugin(QObject *parent)
-        : QObject(parent)
+        : QObject(parent),
+          d(new Private)
 {
-    // TODO: Implement me!
+    kDebug();
+
+    delete d;
 }
 
 AbstractAccountUiPlugin::~AbstractAccountUiPlugin()
 {
+    kDebug();
+
     // TODO: Implement me!
 }
 
+const QMap<QString, QString> &AbstractAccountUiPlugin::providedProtocols() const
+{
+    return d->providedProtocols;
+}
+
+void AbstractAccountUiPlugin::registerProvidedProtocol(const QString &connectionManager,
+                                                       const QString &protocol)
+{
+    kDebug();
+
+    // Check the protocol is not already entered
+    foreach (const QString &value, d->providedProtocols.values(connectionManager)) {
+        if (value == protocol) {
+            kWarning() << "Tried to add connection manager:" << connectionManager
+                       << "and protocol:" << protocol << "combination twice.";
+            return;
+        }
+    }
+
+    // Pair is not already added. Add it.
+    d->providedProtocols.insertMulti(connectionManager, protocol);
+}
+
diff --git a/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.h b/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.h
index cb48568..af1528f 100644
--- a/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.h
+++ b/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.h
@@ -21,9 +21,13 @@
 #ifndef LIB_KCM_TELEPATHY_ACCOUNTS_ABSTRACT_ACCOUNT_UI_PLUGIN_H
 #define LIB_KCM_TELEPATHY_ACCOUNTS_ABSTRACT_ACCOUNT_UI_PLUGIN_H
 
+#include <kdemacros.h>
+
+#include <QtCore/QMap>
 #include <QtCore/QObject>
+#include <QtCore/QString>
 
-class AbstractAccountUiPlugin : public QObject
+class KDE_EXPORT AbstractAccountUiPlugin : public QObject
 {
     Q_OBJECT
     Q_DISABLE_COPY(AbstractAccountUiPlugin);
@@ -31,6 +35,15 @@ class AbstractAccountUiPlugin : public QObject
 public:
     AbstractAccountUiPlugin(QObject *parent = 0);
     virtual ~AbstractAccountUiPlugin();
+
+    virtual const QMap<QString, QString> &providedProtocols() const;
+
+protected:
+    virtual void registerProvidedProtocol(const QString &connectionManager, const QString &protocol);
+
+private:
+    class Private;
+    Private * const d;
 };
 
 

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list