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


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

The following commit has been merged in the master branch:
commit 5a11946c09f74874c292ad92c20694d1a95ef690
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Wed Jul 29 15:59:04 2009 +0000

    Add a method to get the AbstractAccountUi from the PluginManager.
    
    svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=1004213
---
 .../abstract-account-ui-plugin.h                   |  2 +-
 src/plugin-manager.cpp                             | 23 ++++++++++++++++++++++
 src/plugin-manager.h                               |  3 +++
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.h b/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.h
index 00b3af1..41de753 100644
--- a/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.h
+++ b/src/libkcmtelepathyaccounts/abstract-account-ui-plugin.h
@@ -40,7 +40,7 @@ public:
 
     virtual const QMap<QString, QString> &providedProtocols() const;
 
-    virtual AbstractAccountUi* accountUi(const QString *connectionManager, const QString &protocol) = 0;
+    virtual AbstractAccountUi* accountUi(const QString &connectionManager, const QString &protocol) = 0;
 
 protected:
     virtual void registerProvidedProtocol(const QString &connectionManager, const QString &protocol);
diff --git a/src/plugin-manager.cpp b/src/plugin-manager.cpp
index 5840ecf..47efbe3 100644
--- a/src/plugin-manager.cpp
+++ b/src/plugin-manager.cpp
@@ -21,6 +21,7 @@
 #include "plugin-manager.h"
 
 #include "libkcmtelepathyaccounts/abstract-account-ui-plugin.h"
+#include "libkcmtelepathyaccounts/abstract-account-ui.h"
 
 #include <KDebug>
 #include <KServiceTypeTrader>
@@ -86,3 +87,25 @@ void PluginManager::loadPlugins()
        }
     }
 }
+
+AbstractAccountUi *PluginManager::accountUiForProtocol(const QString &connectionManager,
+                                                       const QString &protocol)
+{
+    kDebug();
+
+    // Loop through all the plugins seeing if they provide an AccountUi for the connection manager
+    // and protocol combination we were provided with.
+
+    foreach (AbstractAccountUiPlugin *plugin, m_plugins) {
+        AbstractAccountUi *ui = plugin->accountUi(connectionManager, protocol);
+
+        // FIXME: Bug https://bugs.kde.org/201797 - we should check here to see which plugin
+        // provides the closest match for the desired parameters in the case that more than one
+        // plugin provides a UI for this protocol/cm pair.
+        if (ui) {
+            return ui;
+        }
+    }
+
+    return 0;
+}
diff --git a/src/plugin-manager.h b/src/plugin-manager.h
index 85515b5..f4378d5 100644
--- a/src/plugin-manager.h
+++ b/src/plugin-manager.h
@@ -24,6 +24,7 @@
 #include <QtCore/QList>
 #include <QtCore/QObject>
 
+class AbstractAccountUi;
 class AbstractAccountUiPlugin;
 
 class PluginManager : public QObject
@@ -36,6 +37,8 @@ public:
 
     virtual ~PluginManager();
 
+    AbstractAccountUi *accountUiForProtocol(const QString &connectionManager, const QString &protocol);
+
 private:
     explicit PluginManager(QObject *parent = 0);
     static PluginManager *s_self;

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list