Connect instance list to model.

This commit is contained in:
Petr Mrázek
2013-03-18 23:00:46 +01:00
parent b84dfddd1b
commit 65faabeed4
7 changed files with 105 additions and 37 deletions

View File

@ -57,23 +57,6 @@ public:
this->instId = instId;
}
private:
InstancePtr findInstance(QString instId)
{
QListIterator<InstancePtr> iter(instances);
InstancePtr inst;
while(iter.hasNext())
{
inst = iter.next();
if (inst->id() == instId)
break;
}
if (inst->id() != instId)
return InstancePtr();
else
return iter.peekPrevious();
}
private slots:
void onTerminated()
{
@ -117,7 +100,7 @@ public:
instances.loadList();
std::cout << "Launching Instance '" << qPrintable(instId) << "'" << std::endl;
instance = findInstance(instId);
instance = instances.getInstanceById(instId);
if (instance.isNull())
{
std::cout << "Could not find instance requested. note that you have to specify the ID, not the NAME" << std::endl;