Changeset - 25b4659dd6fe
[Not reviewed]
0 2 0
Jan Kaluza - 10 years ago 2015-11-13 07:47:58
jkaluza@redhat.com
Fix FormUtils compilation with swiften2
2 files changed with 7 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/formutils.cpp
Show inline comments
 
@@ -136,7 +136,7 @@ createTextFixedField(const std::string &value) {
 
#if HAVE_SWIFTEN_3
 
	FormField::ref field = boost::make_shared<FormField>(FormField::FixedType, value);
 
#else
 
	FixedFormField::ref field = FixedFormField::create(value)
 
	FixedFormField::ref field = FixedFormField::create(value);
 
#endif
 
	return field;
 
}
 
@@ -170,24 +170,24 @@ std::string fieldValue(Swift::FormField::ref field) {
 
#if HAVE_SWIFTEN_3
 
	return field->getValues()[0];
 
#else
 
	TextSingleFormField::ref textSingle = boost::dynamic_pointer_cast<TextSingleFormField>(*it);
 
	TextSingleFormField::ref textSingle = boost::dynamic_pointer_cast<TextSingleFormField>(field);
 
	if (textSingle) {
 
		return textSingle->getValue();
 
	}
 

	
 
	TextPrivateFormField::ref textPrivate = boost::dynamic_pointer_cast<TextPrivateFormField>(*it);
 
	TextPrivateFormField::ref textPrivate = boost::dynamic_pointer_cast<TextPrivateFormField>(field);
 
	if (textPrivate) {
 
		return textPrivate->getValue();
 
	}
 

	
 
	ListSingleFormField::ref listSingle = boost::dynamic_pointer_cast<ListSingleFormField>(*it);
 
	ListSingleFormField::ref listSingle = boost::dynamic_pointer_cast<ListSingleFormField>(field);
 
	if (listSingle) {
 
		return listSingle->getValue();
 
	}
 

	
 
	BooleanFormField::ref boolean = boost::dynamic_pointer_cast<BooleanFormField>(*it);
 
	BooleanFormField::ref boolean = boost::dynamic_pointer_cast<BooleanFormField>(field);
 
	if (boolean) {
 
		return boolen->getValue() ? "1" : "0";
 
		return boolean->getValue() ? "1" : "0";
 
	}
 
	
 
	return "";
 
@@ -220,7 +220,7 @@ std::string fieldValue(Swift::Form::ref form, const std::string &key, const std:
 

	
 
		BooleanFormField::ref boolean = boost::dynamic_pointer_cast<BooleanFormField>(*it);
 
		if (boolean && boolean->getName() == key) {
 
			return boolen->getValue() ? "1" : "0";
 
			return boolean->getValue() ? "1" : "0";
 
		}
 
#endif
 
	}
src/settingsadhoccommand.cpp
Show inline comments
 
@@ -58,9 +58,6 @@ boost::shared_ptr<Swift::Command> SettingsAdHocCommand::getForm() {
 
		return response;
 
	}
 

	
 
	boost::shared_ptr<Swift::Command> response(new Swift::Command("settings", m_id, Swift::Command::Executing));
 
	boost::shared_ptr<Swift::Form> form(new Swift::Form());
 

	
 
	std::string value;
 
	int type = (int) TYPE_BOOLEAN;
 

	
0 comments (0 inline, 0 general)