Bug fixes

This commit is contained in:
Carl Klemm 2019-06-13 00:05:10 +02:00
parent 3cbe947408
commit f6aaebafc6
5 changed files with 20 additions and 5 deletions

View file

@ -128,6 +128,12 @@ bool Item::removeActor(Actor* actor)
return false;
}
void Item::removeAllActors()
{
for(unsigned int i = 0; i < actors_.size(); i++) delete actors_[i];
actors_.clear();
}
std::vector< Actor* >& Item::getActors()
{
return actors_;

View file

@ -59,6 +59,7 @@ public:
bool hasActors();
void addActor(Actor* actor);
bool removeActor(Actor* actor);
void removeAllActors();
bool actorsActive() const;
void setActorsActive(bool in);
void informValue(uint8_t value);

View file

@ -91,7 +91,6 @@ void ItemStore::load(const QJsonObject& json, Microcontroller * const micro)
if(itemsArray[i].isObject())
{
const QJsonObject itemObject = itemsArray[i].toObject();
if(!itemObject["Name"].isObject()) qDebug()<<"no name";
std::shared_ptr<Relay> newItem;
if(itemObject["Type"].toString("") == "Relay")
{