summaryrefslogtreecommitdiffstats
path: root/application/WonkoGui.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-03-11 01:39:45 +0100
committerPetr Mrázek <peterix@gmail.com>2017-04-07 00:20:01 +0200
commitab868df50eb6f9f3958bdc0a7ab9199dcdf46b3c (patch)
tree0dfb9713e99f5d89d75e05e2ceb4b1378a2aa6b3 /application/WonkoGui.cpp
parent1fbe03f982f130bf675b7f94dd9c06aee62da54f (diff)
downloadMultiMC-ab868df50eb6f9f3958bdc0a7ab9199dcdf46b3c.tar
MultiMC-ab868df50eb6f9f3958bdc0a7ab9199dcdf46b3c.tar.gz
MultiMC-ab868df50eb6f9f3958bdc0a7ab9199dcdf46b3c.tar.lz
MultiMC-ab868df50eb6f9f3958bdc0a7ab9199dcdf46b3c.tar.xz
MultiMC-ab868df50eb6f9f3958bdc0a7ab9199dcdf46b3c.zip
NOISSUE Wonko is the new Meta
And then Wonko was the Meta.
Diffstat (limited to 'application/WonkoGui.cpp')
-rw-r--r--application/WonkoGui.cpp74
1 files changed, 0 insertions, 74 deletions
diff --git a/application/WonkoGui.cpp b/application/WonkoGui.cpp
deleted file mode 100644
index 4d376fdc..00000000
--- a/application/WonkoGui.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "WonkoGui.h"
-
-#include "dialogs/ProgressDialog.h"
-#include "wonko/WonkoIndex.h"
-#include "wonko/WonkoVersionList.h"
-#include "wonko/WonkoVersion.h"
-#include "Env.h"
-
-WonkoIndexPtr Wonko::ensureIndexLoaded(QWidget *parent)
-{
- if (!ENV.wonkoIndex()->isLocalLoaded())
- {
- ProgressDialog(parent).execWithTask(ENV.wonkoIndex()->localUpdateTask());
- if (!ENV.wonkoIndex()->isRemoteLoaded() && ENV.wonkoIndex()->lists().size() == 0)
- {
- ProgressDialog(parent).execWithTask(ENV.wonkoIndex()->remoteUpdateTask());
- }
- }
- return ENV.wonkoIndex();
-}
-
-WonkoVersionListPtr Wonko::ensureVersionListExists(const QString &uid, QWidget *parent)
-{
- ensureIndexLoaded(parent);
- if (!ENV.wonkoIndex()->isRemoteLoaded() && !ENV.wonkoIndex()->hasUid(uid))
- {
- ProgressDialog(parent).execWithTask(ENV.wonkoIndex()->remoteUpdateTask());
- }
- return ENV.wonkoIndex()->getList(uid);
-}
-WonkoVersionListPtr Wonko::ensureVersionListLoaded(const QString &uid, QWidget *parent)
-{
- WonkoVersionListPtr list = ensureVersionListExists(uid, parent);
- if (!list)
- {
- return nullptr;
- }
- if (!list->isLocalLoaded())
- {
- ProgressDialog(parent).execWithTask(list->localUpdateTask());
- if (!list->isLocalLoaded())
- {
- ProgressDialog(parent).execWithTask(list->remoteUpdateTask());
- }
- }
- return list->isComplete() ? list : nullptr;
-}
-
-WonkoVersionPtr Wonko::ensureVersionExists(const QString &uid, const QString &version, QWidget *parent)
-{
- WonkoVersionListPtr list = ensureVersionListLoaded(uid, parent);
- if (!list)
- {
- return nullptr;
- }
- return list->getVersion(version);
-}
-WonkoVersionPtr Wonko::ensureVersionLoaded(const QString &uid, const QString &version, QWidget *parent, const UpdateType update)
-{
- WonkoVersionPtr vptr = ensureVersionExists(uid, version, parent);
- if (!vptr)
- {
- return nullptr;
- }
- if (!vptr->isLocalLoaded() || update == AlwaysUpdate)
- {
- ProgressDialog(parent).execWithTask(vptr->localUpdateTask());
- if (!vptr->isLocalLoaded() || update == AlwaysUpdate)
- {
- ProgressDialog(parent).execWithTask(vptr->remoteUpdateTask());
- }
- }
- return vptr->isComplete() ? vptr : nullptr;
-}