[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:24 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=e6103b5
The following commit has been merged in the master branch:
commit e6103b571749b60ea70c0015e5df566f49db4c6d
Author: George Goldberg <grundleborg at googlemail.com>
Date: Thu Jul 23 12:34:13 2009 +0000
Add a ParameterEditModel for the ParameterEditWidget.
svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=1001485
---
src/CMakeLists.txt | 1 +
src/parameter-edit-model.cpp | 72 ++++++++++++++++++++++
...ccounts-list-model.h => parameter-edit-model.h} | 27 +++-----
3 files changed, 80 insertions(+), 20 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 36a82db..2efdb21 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -15,6 +15,7 @@ set (telepathy_accounts_kcm_SRCS
protocol-item.cpp
parameter-edit-widget.cpp
parameter-edit-delegate.cpp
+ parameter-edit-model.cpp
)
kde4_add_ui_files (telepathy_accounts_kcm_SRCS
diff --git a/src/parameter-edit-model.cpp b/src/parameter-edit-model.cpp
new file mode 100644
index 0000000..95cad8e
--- /dev/null
+++ b/src/parameter-edit-model.cpp
@@ -0,0 +1,72 @@
+/*
+ * This file is part of telepathy-accounts-kcm
+ *
+ * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "parameter-edit-model.h"
+
+#include <KDebug>
+
+ParameterEditModel::ParameterEditModel(QObject *parent)
+ : QAbstractListModel(parent)
+{
+ kDebug();
+
+ // TODO: Implement me!
+}
+
+ParameterEditModel::~ParameterEditModel()
+{
+ kDebug();
+
+ // TODO: Implement me!
+}
+
+int ParameterEditModel::rowCount(const QModelIndex &index) const
+{
+ // If the index is the root item, then return the row count.
+ if (index == QModelIndex()) {
+ // return m_protocolItems.size();
+ }
+
+ // Otherwise, return 0 (as this is a list model, so all items
+ // are children of the root item).
+ return 0;
+}
+
+QVariant ParameterEditModel::data(const QModelIndex &index, int role) const
+{
+ // FIXME: This is a basic implementation just so I can see what's going
+ // on while developing this code further. Needs expanding.
+ QVariant data;
+
+ switch(role)
+ {
+ case Qt::DisplayRole:
+// data = QVariant(m_protocolItems.at(index.row())->protocol());
+ break;
+ default:
+ break;
+ }
+
+ return data;
+}
+
+
+#include "parameter-edit-model.moc"
+
diff --git a/src/accounts-list-model.h b/src/parameter-edit-model.h
similarity index 64%
copy from src/accounts-list-model.h
copy to src/parameter-edit-model.h
index cdffda8..010a0af 100644
--- a/src/accounts-list-model.h
+++ b/src/parameter-edit-model.h
@@ -18,35 +18,22 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef TELEPATHY_ACCOUNTS_KCM_ACCOUNTS_LIST_MODEL_H
-#define TELEPATHY_ACCOUNTS_KCM_ACCOUNTS_LIST_MODEL_H
+#ifndef TELEPATHY_ACCOUNTS_KCM_PARAMETER_EDIT_MODEL_H
+#define TELEPATHY_ACCOUNTS_KCM_PARAMETER_EDIT_MODEL_H
#include <QtCore/QAbstractListModel>
-#include <TelepathyQt4/Account>
-
-class AccountItem;
-
-class AccountsListModel : public QAbstractListModel
+class ParameterEditModel : public QAbstractListModel
{
Q_OBJECT
- Q_DISABLE_COPY(AccountsListModel);
+ Q_DISABLE_COPY(ParameterEditModel);
public:
- explicit AccountsListModel(QObject *parent = 0);
- virtual ~AccountsListModel();
+ explicit ParameterEditModel(QObject *parent = 0);
+ virtual ~ParameterEditModel();
+
virtual int rowCount(const QModelIndex &index) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
- void addAccount(const Tp::AccountPtr &account);
-
-private Q_SLOTS:
- void onAccountItemReady();
- void onAccountItemRemoved();
- void onAccountItemUpdated();
-
-private:
- QList<AccountItem*> m_unreadyAccounts;
- QList<AccountItem*> m_readyAccounts;
};
--
ktp-accounts-kcm packaging
More information about the pkg-kde-commits
mailing list