From 25b4659dd6fe98d56ef9137ba43d61039defa329 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Fri, 13 Nov 2015 07:47:58 +0100 Subject: [PATCH] Fix FormUtils compilation with swiften2 --- src/formutils.cpp | 14 +++++++------- src/settingsadhoccommand.cpp | 3 --- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/formutils.cpp b/src/formutils.cpp index 42346a46..e72319ea 100644 --- a/src/formutils.cpp +++ b/src/formutils.cpp @@ -136,7 +136,7 @@ createTextFixedField(const std::string &value) { #if HAVE_SWIFTEN_3 FormField::ref field = boost::make_shared(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(*it); + TextSingleFormField::ref textSingle = boost::dynamic_pointer_cast(field); if (textSingle) { return textSingle->getValue(); } - TextPrivateFormField::ref textPrivate = boost::dynamic_pointer_cast(*it); + TextPrivateFormField::ref textPrivate = boost::dynamic_pointer_cast(field); if (textPrivate) { return textPrivate->getValue(); } - ListSingleFormField::ref listSingle = boost::dynamic_pointer_cast(*it); + ListSingleFormField::ref listSingle = boost::dynamic_pointer_cast(field); if (listSingle) { return listSingle->getValue(); } - BooleanFormField::ref boolean = boost::dynamic_pointer_cast(*it); + BooleanFormField::ref boolean = boost::dynamic_pointer_cast(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(*it); if (boolean && boolean->getName() == key) { - return boolen->getValue() ? "1" : "0"; + return boolean->getValue() ? "1" : "0"; } #endif } diff --git a/src/settingsadhoccommand.cpp b/src/settingsadhoccommand.cpp index d888a3b3..287330b2 100644 --- a/src/settingsadhoccommand.cpp +++ b/src/settingsadhoccommand.cpp @@ -58,9 +58,6 @@ boost::shared_ptr SettingsAdHocCommand::getForm() { return response; } - boost::shared_ptr response(new Swift::Command("settings", m_id, Swift::Command::Executing)); - boost::shared_ptr form(new Swift::Form()); - std::string value; int type = (int) TYPE_BOOLEAN;