- std::string batch = resource_descr.batch.c_str();
- if (batch == "pbs")
- _batch_line->setCurrentIndex(0);
- else if (batch == "lsf")
- _batch_line->setCurrentIndex(1);
- else if (batch == "sge")
- _batch_line->setCurrentIndex(2);
- else if (batch == "ssh_batch")
- _batch_line->setCurrentIndex(3);
- else if (batch == "ccc")
- _batch_line->setCurrentIndex(4);
- else if (batch == "slurm")
- _batch_line->setCurrentIndex(5);
- else if (batch == "ll")
- _batch_line->setCurrentIndex(6);
- else if (batch == "vishnu")
- _batch_line->setCurrentIndex(7);
- else if (batch == "oar")
- _batch_line->setCurrentIndex(8);
- else if (batch == "coorm")
- _batch_line->setCurrentIndex(9);
- else
- _batch_line->setCurrentIndex(-1);
+ for (int i=0 ; i<_batch_line->count() ; i++)
+ {
+ if (_batch_line->itemData(i).toString().toStdString() == resource_descr.batch)
+ {
+ _batch_line->setCurrentIndex(i);
+ }
+ }