[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:36 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=a15ef1a
The following commit has been merged in the master branch:
commit a15ef1abd0b0ee0cf2d0b532819d3422e11f6886
Author: George Goldberg <grundleborg at googlemail.com>
Date: Mon Jul 27 21:27:29 2009 +0000
Fill out the AbstractAccountUi class with methods for storage/retrieval of the supported parameters.
svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=1003228
---
.../abstract-account-ui.cpp | 45 +++++++++++++++++++++-
src/libkcmtelepathyaccounts/abstract-account-ui.h | 9 +++++
2 files changed, 53 insertions(+), 1 deletion(-)
diff --git a/src/libkcmtelepathyaccounts/abstract-account-ui.cpp b/src/libkcmtelepathyaccounts/abstract-account-ui.cpp
index 21d854c..9663ea9 100644
--- a/src/libkcmtelepathyaccounts/abstract-account-ui.cpp
+++ b/src/libkcmtelepathyaccounts/abstract-account-ui.cpp
@@ -29,6 +29,9 @@ public:
{
kDebug();
}
+
+ QMap<QString, QVariant::Type> supportedMandatoryParameters;
+ QMap<QString, QVariant::Type> supportedOptionalParameters;
};
AbstractAccountUi::AbstractAccountUi(QObject *parent)
@@ -41,8 +44,48 @@ AbstractAccountUi::AbstractAccountUi(QObject *parent)
AbstractAccountUi::~AbstractAccountUi()
{
kDebug();
+
+ delete d;
}
+const QMap<QString, QVariant::Type> &AbstractAccountUi::supportedMandatoryParameters() const
+{
+ return d->supportedMandatoryParameters;
+}
-#include "abstract-account-ui.h"
+const QMap<QString, QVariant::Type> &AbstractAccountUi::supportedOptionalParameters() const
+{
+ return d->supportedOptionalParameters;
+}
+
+void AbstractAccountUi::registerSupportedMandatoryParameter(const QString &name, QVariant::Type type)
+{
+ // Check that the parameter is not already in the list
+ foreach (QVariant::Type t, d->supportedMandatoryParameters.values(name)) {
+ if (t == type) {
+ kWarning() << "Parameter:" << name << "of type:" << type << "is already added.";
+ return;
+ }
+ }
+
+ // Add the parameter to the list.
+ d->supportedMandatoryParameters.insertMulti(name, type);
+}
+
+void AbstractAccountUi::registerSupportedOptionalParameter(const QString &name, QVariant::Type type)
+{
+ // Check that the parameter is not already in the list
+ foreach (QVariant::Type t, d->supportedOptionalParameters.values(name)) {
+ if (t == type) {
+ kWarning() << "Parameter:" << name << "of type:" << type << "is already added.";
+ return;
+ }
+ }
+
+ // Add the parameter to the list.
+ d->supportedOptionalParameters.insertMulti(name, type);
+}
+
+
+#include "abstract-account-ui.moc"
diff --git a/src/libkcmtelepathyaccounts/abstract-account-ui.h b/src/libkcmtelepathyaccounts/abstract-account-ui.h
index a0afa51..ed59378 100644
--- a/src/libkcmtelepathyaccounts/abstract-account-ui.h
+++ b/src/libkcmtelepathyaccounts/abstract-account-ui.h
@@ -23,7 +23,9 @@
#include <kdemacros.h>
+#include <QtCore/QMap>
#include <QtCore/QObject>
+#include <QtCore/QVariant>
class KDE_EXPORT AbstractAccountUi : public QObject
{
@@ -34,6 +36,13 @@ public:
AbstractAccountUi(QObject *parent = 0);
virtual ~AbstractAccountUi();
+ virtual const QMap<QString, QVariant::Type> &supportedMandatoryParameters() const;
+ virtual const QMap<QString, QVariant::Type> &supportedOptionalParameters() const;
+
+protected:
+ virtual void registerSupportedMandatoryParameter(const QString &name, QVariant::Type type);
+ virtual void registerSupportedOptionalParameter(const QString &name, QVariant::Type type);
+
private:
class Private;
Private * const d;
--
ktp-accounts-kcm packaging
More information about the pkg-kde-commits
mailing list