From 65faabeed48584c461ca21d784c3f1d46f67f832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 18 Mar 2013 23:00:46 +0100 Subject: Connect instance list to model. --- main.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index cf193ff0..7c82d6d8 100644 --- a/main.cpp +++ b/main.cpp @@ -57,23 +57,6 @@ public: this->instId = instId; } -private: - InstancePtr findInstance(QString instId) - { - QListIterator 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; -- cgit v1.2.3