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


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

The following commit has been merged in the master branch:
commit a68aa196d11a7e4845f25676a2761c6d75f0ef37
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Mon Jul 27 13:42:47 2009 +0000

    Add a singleton Dictionary class which will contain a list of common parameter names to enable translation of them.]
    
    svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=1003002
---
 src/CMakeLists.txt                      |  1 +
 src/{protocol-item.h => dictionary.cpp} | 54 ++++++++++++++++++++-------------
 src/{integer-edit.h => dictionary.h}    | 33 +++++++++-----------
 3 files changed, 49 insertions(+), 39 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5a1f29e..e7bdaea 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,6 +19,7 @@ set (telepathy_accounts_kcm_SRCS
      parameter-item.cpp
      integer-edit.cpp
      unsigned-integer-edit.cpp
+     dictionary.cpp
 )
 
 kde4_add_ui_files (telepathy_accounts_kcm_SRCS
diff --git a/src/protocol-item.h b/src/dictionary.cpp
similarity index 54%
copy from src/protocol-item.h
copy to src/dictionary.cpp
index f2e9ee5..f404b16 100644
--- a/src/protocol-item.h
+++ b/src/dictionary.cpp
@@ -1,5 +1,5 @@
 /*
- * This file is part of telepathy-accounts-kcm
+ * This file is part of Kopete
  *
  * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
  *
@@ -18,34 +18,46 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef TELEPATHY_ACCOUNTS_KCM_PROTOCOL_ITEM_H
-#define TELEPATHY_ACCOUNTS_KCM_PROTOCOL_ITEM_H
+#include "dictionary.h"
 
-#include <QtCore/QObject>
+#include <KDebug>
+#include <KLocale>
 
-#include <TelepathyQt4/ConnectionManager>
+Dictionary* Dictionary::s_self = 0;
 
-class ConnectionManagerItem;
-
-class ProtocolItem : public QObject
+Dictionary::Dictionary()
 {
-    Q_OBJECT
-    Q_DISABLE_COPY(ProtocolItem);
+    kDebug();
+
+    // Set up the singleton instance
+    s_self = this;
+
+    // TODO: Populate the dictionary
+}
 
-public:
-    explicit ProtocolItem(const QString &protocol,
-                          ConnectionManagerItem *parent = 0);
-    virtual ~ProtocolItem();
+Dictionary::~Dictionary()
+{
+    kDebug();
 
-    QString protocol() const;
+    // Delete the singleton instance of this class
+    s_self = 0;
+}
 
-    Tp::ProtocolParameterList mandatoryParameters() const;
-    Tp::ProtocolParameterList optionalParameters() const;
+Dictionary *Dictionary::instance()
+{
+    kDebug();
 
-private:
-    QString m_protocol;
-};
+    // Construct the singleton if hasn't been already
+    if (!s_self) {
+        s_self = new Dictionary;
+    }
 
+    // Return the singleton instance of this class
+    return s_self;
+}
 
-#endif // header guard
+QString Dictionary::string(const QString &key) const
+{
+    return m_strings.value(key);
+}
 
diff --git a/src/integer-edit.h b/src/dictionary.h
similarity index 61%
copy from src/integer-edit.h
copy to src/dictionary.h
index 85f5cac..fabb9eb 100644
--- a/src/integer-edit.h
+++ b/src/dictionary.h
@@ -1,5 +1,5 @@
-/*
- * This file is part of telepathy-accounts-kcm
+ /*
+ * This file is part of Kopete
  *
  * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
  *
@@ -18,31 +18,28 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef TELEPATHY_ACCOUNTS_KCM_INTEGER_EDIT_H
-#define TELEPATHY_ACCOUNTS_KCM_INTEGER_EDIT_H
+#ifndef TELEPATHY_ACCOUNTS_KCM_DICTIONARY_H
+#define TELEPATHY_ACCOUNTS_KCM_DICTIONARY_H
 
-#include <QtGui/QLineEdit>
+#include <QtCore/QMap>
+#include <QtCore/QString>
 
-class IntegerEdit : public QLineEdit
+class Dictionary
 {
-    Q_OBJECT
-
 public:
-    explicit IntegerEdit(QWidget *parent = 0);
-    virtual ~IntegerEdit();
+    static Dictionary *instance();
 
-    void setValue(int integer);
+    virtual ~Dictionary();
 
-protected:
-    void keyPressEvent(QKeyEvent *event);
+    QString string(const QString &key) const;
 
-Q_SIGNALS:
-    void integerChanged(int integer);
+private:
+    Dictionary();
+    static Dictionary *s_self;
 
-private Q_SLOTS:
-    void onTextChanged(const QString &text);
+    QMap<QString, QString> m_strings;
 };
 
 
-#endif // header guard
+#endif  // Header guard
 

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list