- 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_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
- _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);
+ }
+ }