Connect instance list to model.
This commit is contained in:
parent
b84dfddd1b
commit
65faabeed4
7 changed files with 105 additions and 37 deletions
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue