1 #include "abstractpropertytype.h"
4 void ListPropertyType::append(AbstractPropertyType *property)
6 mList.push_back(property->copy());
10 ListPropertyType::ListPropertyType()
15 ListPropertyType::ListPropertyType(AbstractPropertyType *property)
20 ListPropertyType::ListPropertyType(ListPropertyType &other)
22 std::list<AbstractPropertyType*> l = other.list();
23 for(auto itr = l.begin(); itr != l.end(); itr++)
30 ListPropertyType::~ListPropertyType()
36 uint ListPropertyType::count()
42 AbstractPropertyType *ListPropertyType::copy()
44 return new ListPropertyType(*this);
48 std::string ListPropertyType::toString() const
50 std::string str = "[";
52 for(auto itr = mList.begin(); itr != mList.end(); itr++)
57 AbstractPropertyType* t = *itr;
68 void ListPropertyType::fromString(std::string)
70 /// TODO: try to use VehicleProperty::getPropertyType... here
74 GVariant *ListPropertyType::toVariant()
76 GVariantBuilder params;
77 g_variant_builder_init(¶ms, G_VARIANT_TYPE_ARRAY);
79 for(auto itr = mList.begin(); itr != mList.end(); itr++)
81 AbstractPropertyType* t = *itr;
82 g_variant_builder_add_value(¶ms, t->toVariant());
85 GVariant* var = g_variant_builder_end(¶ms);
91 void ListPropertyType::fromVariant(GVariant *v)