[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:43 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=2ba06c3
The following commit has been merged in the master branch:
commit 2ba06c3fbc05a66b54e17ae030e8cc9c78f7dc47
Author: Dominik Schmidt <dev at dominik-schmidt.de>
Date: Wed Jan 12 01:39:16 2011 +0100
Add QSpinBox support
---
.../abstract-account-parameters-widget.cpp | 50 +++++++++++++++++++---
1 file changed, 44 insertions(+), 6 deletions(-)
diff --git a/src/KCMTelepathyAccounts/abstract-account-parameters-widget.cpp b/src/KCMTelepathyAccounts/abstract-account-parameters-widget.cpp
index b45e868..05b723b 100644
--- a/src/KCMTelepathyAccounts/abstract-account-parameters-widget.cpp
+++ b/src/KCMTelepathyAccounts/abstract-account-parameters-widget.cpp
@@ -26,6 +26,7 @@
#include <QLineEdit>
#include <QCheckBox>
#include <QComboBox>
+#include <QSpinBox>
class AbstractAccountParametersWidget::Private
@@ -72,20 +73,35 @@ QList<ProtocolParameterValue> AbstractAccountParametersWidget::parameterValues()
if(lineEdit)
{
parameters.append(ProtocolParameterValue(i.key(), lineEdit->text()));
+ ++i;
+ continue;
}
QCheckBox *checkBox = qobject_cast<QCheckBox*>(i.value());
if(checkBox)
{
parameters.append(ProtocolParameterValue(i.key(), checkBox->isChecked()));
+ ++i;
+ continue;
}
QComboBox *comboBox = qobject_cast<QComboBox*>(i.value());
if(comboBox)
{
parameters.append(ProtocolParameterValue(i.key(), comboBox->currentText()));
+ ++i;
+ continue;
}
+ QSpinBox *spinBox = qobject_cast<QSpinBox*>(i.value());
+ if(spinBox)
+ {
+ parameters.append(ProtocolParameterValue(i.key(), spinBox->value()));
+ ++i;
+ continue;
+ }
+
+ kDebug() << "WIDGET TYPE NOT SUPPORTED!";
++i;
}
@@ -128,7 +144,7 @@ void AbstractAccountParametersWidget::handleParameter(const Tp::ProtocolParamete
QWidget* dataWidget,
QList<QWidget*> labelWidgets)
{
- kDebug();
+ kDebug() << parameterName << parameterType;
Tp::ProtocolParameter foundParameter;
foreach(const Tp::ProtocolParameter ¶meter, parameters)
@@ -162,7 +178,7 @@ void AbstractAccountParametersWidget::prefillUI(const QVariantMap& values)
ParametersWidgetsMap::const_iterator i = internalParametersWidgetsMap()->constBegin();
while (i != internalParametersWidgetsMap()->constEnd()) {
-
+ kDebug() << "Search widget for " << i.key().name();
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(i.value());
if(lineEdit)
{
@@ -174,6 +190,8 @@ void AbstractAccountParametersWidget::prefillUI(const QVariantMap& values)
{
lineEdit->setText(i.key().defaultValue().toString());
}
+ ++i;
+ continue;
}
QCheckBox* checkBox = qobject_cast<QCheckBox*>(i.value());
@@ -181,12 +199,14 @@ void AbstractAccountParametersWidget::prefillUI(const QVariantMap& values)
{
if(values.value(i.key().name()).isValid())
{
- checkBox->setChecked(i.key().defaultValue().toBool());
+ checkBox->setChecked(values.value(i.key().name()).toBool());
}
else
{
- checkBox->setChecked(values.value(i.key().name()).toBool());
+ checkBox->setChecked(i.key().defaultValue().toBool());
}
+ ++i;
+ continue;
}
QComboBox* comboBox = qobject_cast<QComboBox*>(i.value());
@@ -194,14 +214,32 @@ void AbstractAccountParametersWidget::prefillUI(const QVariantMap& values)
{
if(values.value(i.key().name()).isValid())
{
- comboBox->setEditText(i.key().defaultValue().toString());
+ comboBox->setEditText(values.value(i.key().name()).toString());
}
else
{
- comboBox->setEditText(values.value(i.key().name()).toString());
+ comboBox->setEditText(i.key().defaultValue().toString());
+ }
+ ++i;
+ continue;
+ }
+
+ QSpinBox* spinBox = qobject_cast<QSpinBox*>(i.value());
+ if(spinBox)
+ {
+ if(values.value(i.key().name()).isValid())
+ {
+ spinBox->setValue(values.value(i.key().name()).toInt());
+ }
+ else
+ {
+ spinBox->setValue(i.key().defaultValue().toInt());
}
+ ++i;
+ continue;
}
+ kDebug() << "WIDGET TYPE UNKNOWN!";
++i;
}
}
--
ktp-accounts-kcm packaging
More information about the pkg-kde-commits
mailing list