Connect instance list to model.
This commit is contained in:
19
main.cpp
19
main.cpp
@ -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;
|
||||
|
Reference in New Issue
Block a user