- plants["default"] = new Plant(plant_filename);
- plants["default"]->signal_finished().connect(SigC::bind(
- SigC::slot_class(*this, &Server::on_plant_finished),
- "default"));
- plants["default"]->run();
+ if (plants.find(name) == plants.end()) { // No existe
+ plants[name] = new Plant(filename);
+ plants[name]->signal_finished().connect(SigC::bind(
+ SigC::slot_class(*this, &Server::on_plant_finished),
+ name.c_str()));
+ plants[name]->run();
+ return true;
+ }
+ return false;