diff options
author | Andrew <forkk@forkk.net> | 2013-03-08 13:56:26 -0600 |
---|---|---|
committer | Andrew <forkk@forkk.net> | 2013-03-08 13:56:26 -0600 |
commit | 2d6e785e4ee8a8b837fe84f83972ec23a09564af (patch) | |
tree | 6afdac6e06f1ba8ae5c29f62b5a4a9bc1b696b12 /libmultimc/src | |
parent | 69040f923b0344de214d6f1fc4553d223df7d2d6 (diff) | |
download | MultiMC-2d6e785e4ee8a8b837fe84f83972ec23a09564af.tar MultiMC-2d6e785e4ee8a8b837fe84f83972ec23a09564af.tar.gz MultiMC-2d6e785e4ee8a8b837fe84f83972ec23a09564af.tar.lz MultiMC-2d6e785e4ee8a8b837fe84f83972ec23a09564af.tar.xz MultiMC-2d6e785e4ee8a8b837fe84f83972ec23a09564af.zip |
Implemented version lists.
Diffstat (limited to 'libmultimc/src')
-rw-r--r-- | libmultimc/src/instversionlist.cpp | 17 | ||||
-rw-r--r-- | libmultimc/src/task.cpp | 5 |
2 files changed, 19 insertions, 3 deletions
diff --git a/libmultimc/src/instversionlist.cpp b/libmultimc/src/instversionlist.cpp index e171cfa5..301b9969 100644 --- a/libmultimc/src/instversionlist.cpp +++ b/libmultimc/src/instversionlist.cpp @@ -13,9 +13,20 @@ * limitations under the License. */ -#include "include/instversionlist.h" +#include "instversionlist.h" +#include "instversion.h" -InstVersionList::InstVersionList() : - QObject(NULL) +InstVersionList::InstVersionList(QObject *parent) : + QObject(parent) { } + +const InstVersion *InstVersionList::findVersion(const QString &descriptor) +{ + for (int i = 0; i < count(); i++) + { + if (at(i)->descriptor() == descriptor) + return at(i); + } + return NULL; +} diff --git a/libmultimc/src/task.cpp b/libmultimc/src/task.cpp index d581a1dd..3e30827b 100644 --- a/libmultimc/src/task.cpp +++ b/libmultimc/src/task.cpp @@ -37,6 +37,11 @@ int Task::getProgress() const return progress; } +void Task::calcProgress(int parts, int whole) +{ + setProgress((int)((((float)parts) / ((float)whole))*100)); // Not sure if C++ or LISP... +} + void Task::setProgress(int progress) { this->progress = progress; |