summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-08-27 18:03:41 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-08-27 18:28:36 (GMT)
commitc4431ee90f3f1daac0a12b35bfa3378d5c570eaa (patch)
tree962d4bdab86899789e6ce7e9262c4c0638a2cedb /Swift
parent00284e5f4445a7bbab482196901c5927ea7d5488 (diff)
downloadswift-c4431ee90f3f1daac0a12b35bfa3378d5c570eaa.zip
swift-c4431ee90f3f1daac0a12b35bfa3378d5c570eaa.tar.bz2
Fix crash in form widget.
Change-Id: I0f8d1a4710bbb7d25d6e1e4515e1e1a18bf300b1
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtFormWidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Swift/QtUI/QtFormWidget.cpp b/Swift/QtUI/QtFormWidget.cpp
index 9b213cf..117696d 100644
--- a/Swift/QtUI/QtFormWidget.cpp
+++ b/Swift/QtUI/QtFormWidget.cpp
@@ -60,7 +60,7 @@ QListWidget* QtFormWidget::createList(FormField::ref field) {
std::vector<bool> selected;
foreach (FormField::Option option, field->getOptions()) {
listWidget->addItem(option.label.c_str());
- if (field->getType() == FormField::ListMultiType) {
+ if (field->getType() == FormField::ListSingleType) {
selected.push_back(!field->getValues().empty() && option.value == field->getValues()[0]);
}
else if (field->getType() == FormField::ListMultiType) {
@@ -170,7 +170,7 @@ Form::ref QtFormWidget::getCompletedForm() {
resultField->addValue(field->getOptions()[listWidget->row(item)].value);
}
}
- field->setName(field->getName());
+ resultField->setName(field->getName());
result->addField(resultField);
}
return result;