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


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

The following commit has been merged in the master branch:
commit e3356c3c5f86366d3353b6c8678e121d88f1c72f
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Fri Jan 14 20:14:05 2011 +0000

    Renamed dataChanged() signal from the account list delegate.
---
 src/accounts-list-delegate.cpp |  2 +-
 src/accounts-list-delegate.h   |  2 +-
 src/kcm-telepathy-accounts.cpp | 17 ++++++++++++-----
 src/kcm-telepathy-accounts.h   |  2 +-
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/accounts-list-delegate.cpp b/src/accounts-list-delegate.cpp
index 2d03e48..fb0afbd 100644
--- a/src/accounts-list-delegate.cpp
+++ b/src/accounts-list-delegate.cpp
@@ -47,7 +47,7 @@ void AccountsListDelegate::updateItemWidgets(const QList<QWidget *> widgets, con
 void AccountsListDelegate::onCheckBoxToggled(bool checked)
 {
     QModelIndex index = focusedIndex();
-    emit dataChanged(index, QVariant((checked ? Qt::Checked : Qt::Unchecked)), Qt::CheckStateRole);
+    emit itemChecked(index, checked);
 }
 
 
diff --git a/src/accounts-list-delegate.h b/src/accounts-list-delegate.h
index be06118..64e783f 100644
--- a/src/accounts-list-delegate.h
+++ b/src/accounts-list-delegate.h
@@ -17,7 +17,7 @@ public:
     void updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const;
 
 signals:
-    void dataChanged(const QModelIndex &index, const QVariant &value, int role);
+    void itemChecked(const QModelIndex &index, bool checked);
 
 public slots:
 
diff --git a/src/kcm-telepathy-accounts.cpp b/src/kcm-telepathy-accounts.cpp
index bdbb356..f9935bd 100644
--- a/src/kcm-telepathy-accounts.cpp
+++ b/src/kcm-telepathy-accounts.cpp
@@ -77,13 +77,13 @@ KCMTelepathyAccounts::KCMTelepathyAccounts(QWidget *parent, const QVariantList&
     m_ui->editAccountButton->setIcon(KIcon("configure"));
     m_ui->removeAccountButton->setIcon(KIcon("edit-delete"));
   
-    AccountsListDelegate* delegate = new AccountsListDelegate(m_accountsListView, this);
+    AccountsListDelegate* delegate = new AccountsListDelegate(m_ui->accountsListView, this);
     m_ui->accountsListView->setItemDelegate(delegate);
 
 
     connect(delegate,
-            SIGNAL(dataChanged(QModelIndex,QVariant,int)),
-            SLOT(onAccountModelChange(QModelIndex,QVariant,int)));
+            SIGNAL(itemChecked(QModelIndex, bool)),
+            SLOT(onAccountEnabledChanged(QModelIndex, bool)));
     connect(m_ui->addAccountButton,
             SIGNAL(clicked()),
             SLOT(onAddAccountClicked()));
@@ -117,9 +117,16 @@ void KCMTelepathyAccounts::load()
     return;
 }
 
-void KCMTelepathyAccounts::onAccountModelChange(const QModelIndex &index, const QVariant &value, int role)
+void KCMTelepathyAccounts::onAccountEnabledChanged(const QModelIndex &index, bool enabled)
 {
-    m_accountsListModel->setData(index, value, role);
+    QVariant value;
+    if (enabled) {
+        value = QVariant(Qt::Checked);
+    }
+    else {
+        value = QVariant(Qt::Unchecked);
+    }
+    m_accountsListModel->setData(index, value, Qt::CheckStateRole);
 }
 
 void KCMTelepathyAccounts::onAccountManagerReady(Tp::PendingOperation *op)
diff --git a/src/kcm-telepathy-accounts.h b/src/kcm-telepathy-accounts.h
index 16ab70c..ee56a6b 100644
--- a/src/kcm-telepathy-accounts.h
+++ b/src/kcm-telepathy-accounts.h
@@ -54,7 +54,7 @@ private Q_SLOTS:
     void onAccountManagerReady(Tp::PendingOperation *op);
     void onAccountCreated(const Tp::AccountPtr &account);
 
-    void onAccountModelChange(const QModelIndex &index, const QVariant &value, int role);
+    void onAccountEnabledChanged(const QModelIndex &index, bool enabled);
 
     void onSelectedItemChanged();
     void onAddAccountClicked();

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list