summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-03-18 23:00:46 +0100
committerPetr Mrázek <peterix@gmail.com>2013-03-18 23:00:46 +0100
commit65faabeed48584c461ca21d784c3f1d46f67f832 (patch)
treee814006279d0c56246e61e5c8f3bd29bc0e1c541 /main.cpp
parentb84dfddd1b24e82dccb5a20d9c30570d26846e76 (diff)
downloadMultiMC-65faabeed48584c461ca21d784c3f1d46f67f832.tar
MultiMC-65faabeed48584c461ca21d784c3f1d46f67f832.tar.gz
MultiMC-65faabeed48584c461ca21d784c3f1d46f67f832.tar.lz
MultiMC-65faabeed48584c461ca21d784c3f1d46f67f832.tar.xz
MultiMC-65faabeed48584c461ca21d784c3f1d46f67f832.zip
Connect instance list to model.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp19
1 files changed, 1 insertions, 18 deletions
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<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;