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


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

The following commit has been merged in the master branch:
commit 7d0fe168fb9b676e379d84d0cb936f18bf4e98e8
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Fri Jul 24 12:16:54 2009 +0000

    Fix bug where the item editing widgets got the wrong values in them.
    
    svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=1001879
---
 src/parameter-edit-delegate.cpp | 10 ++++++++--
 src/parameter-item.cpp          |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/parameter-edit-delegate.cpp b/src/parameter-edit-delegate.cpp
index 6968ef9..4894fbc 100644
--- a/src/parameter-edit-delegate.cpp
+++ b/src/parameter-edit-delegate.cpp
@@ -90,18 +90,24 @@ void ParameterEditDelegate::updateItemWidgets(const QList<QWidget*> widgets,
     // FIXME: Support int/uint types with appropriate validation.
     if (index.model()->data(index, ParameterEditModel::TypeRole).type() == QVariant::Bool) {
         // Bool type. Draw a checkbox.
-        checkBox->setChecked(index.model()->data(index, ParameterEditModel::ValueRole).toBool());
         checkBox->move((right / 2) + margin, (option.rect.height() - checkBox->size().height()) / 2);
         checkBox->show();
         checkBox->setFocus(Qt::OtherFocusReason);
+        // NB: We must update the value of the widget AFTER setting it as focused, otherwise
+        // focusedItem() returns the wrong value and we end up setting the data of the wrong item
+        // in the model.
+        checkBox->setChecked(index.model()->data(index, ParameterEditModel::ValueRole).toBool());
     } else {
         // For any other type, treat it as a string type.
         // FIXME: Support asterisking out the entry in secret parameters
-        lineEdit->setText(index.model()->data(index, ParameterEditModel::ValueRole).toString());
         lineEdit->move((right / 2) + margin, (option.rect.height() - lineEdit->size().height()) / 2);
         lineEdit->resize(QSize(((right - (4 * margin)) / 2), lineEdit->size().height()));
         lineEdit->show();
         lineEdit->setFocus(Qt::OtherFocusReason);
+        // NB: We must update the value of the widget AFTER setting it as focused, otherwise
+        // focusedItem() returns the wrong value and we end up setting the data of the wrong item
+        // in the model.
+        lineEdit->setText(index.model()->data(index, ParameterEditModel::ValueRole).toString());
     }
 }
 
diff --git a/src/parameter-item.cpp b/src/parameter-item.cpp
index d58cfe0..91ee8c5 100644
--- a/src/parameter-item.cpp
+++ b/src/parameter-item.cpp
@@ -29,7 +29,7 @@ ParameterItem::ParameterItem(Tp::ProtocolParameter *parameter,
    m_parameter(parameter),
    m_originalValue(originalValue)
 {
-    kDebug() << "New parameter:" << parameter->name() << "of type:" << parameter->type();
+    kDebug() << "New parameter:" << parameter->name() << "of type:" << parameter->type() << "with value:" << m_originalValue;
 
     // To begin with, the current value is the original value.
     m_currentValue = m_originalValue;

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list