From c4431ee90f3f1daac0a12b35bfa3378d5c570eaa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Tue, 27 Aug 2013 20:03:41 +0200
Subject: Fix crash in form widget.

Change-Id: I0f8d1a4710bbb7d25d6e1e4515e1e1a18bf300b1

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;
-- 
cgit v0.10.2-6-g49f6