summaryrefslogtreecommitdiffstats
path: root/logic/OneSixLibrary.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-09-22 14:03:05 +0200
committerPetr Mrázek <peterix@gmail.com>2013-09-22 14:03:05 +0200
commit1bed5e4023f503cb95a914c1e6886e045b7f34e2 (patch)
tree6c2a2eb34b93bdd24e7db1f9378b231084c0b27a /logic/OneSixLibrary.h
parent930b07afd4229e952d0cd47ca62cd94235499a0c (diff)
parent9d03a9c1e3b9c24a4146adedb2971591d23b037a (diff)
downloadMultiMC-1bed5e4023f503cb95a914c1e6886e045b7f34e2.tar
MultiMC-1bed5e4023f503cb95a914c1e6886e045b7f34e2.tar.gz
MultiMC-1bed5e4023f503cb95a914c1e6886e045b7f34e2.tar.lz
MultiMC-1bed5e4023f503cb95a914c1e6886e045b7f34e2.tar.xz
MultiMC-1bed5e4023f503cb95a914c1e6886e045b7f34e2.zip
Merge branch 'feature_onesix_forge' into develop
Diffstat (limited to 'logic/OneSixLibrary.h')
-rw-r--r--logic/OneSixLibrary.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/logic/OneSixLibrary.h b/logic/OneSixLibrary.h
index ac16d3d3..f3106483 100644
--- a/logic/OneSixLibrary.h
+++ b/logic/OneSixLibrary.h
@@ -3,6 +3,7 @@
#include <QStringList>
#include <QMap>
#include <QSharedPointer>
+#include <QJsonObject>
#include "OpSys.h"
class Rule;
@@ -12,9 +13,13 @@ class OneSixLibrary
private:
// basic values used internally (so far)
QString m_name;
- QString m_base_url;
+ QString m_base_url = "https://s3.amazonaws.com/Minecraft.Download/libraries/";
QList<QSharedPointer<Rule> > m_rules;
-
+
+ // custom values
+ /// absolute URL. takes precedence over m_download_path, if defined
+ QString m_absolute_url;
+
// derived values used for real things
/// a decent name fit for display
QString m_decentname;
@@ -25,11 +30,11 @@ private:
/// where to store the lib locally
QString m_storage_path;
/// where to download the lib from
- QString m_download_path;
+ QString m_download_url;
/// is this lib actually active on the current OS?
- bool m_is_active;
+ bool m_is_active = false;
/// is the library a native?
- bool m_is_native;
+ bool m_is_native = false;
/// native suffixes per OS
QMap<OpSys, QString> m_native_suffixes;
public:
@@ -39,12 +44,11 @@ public:
/// Constructor
OneSixLibrary(QString name)
{
- m_is_native = false;
- m_is_active = false;
m_name = name;
- m_base_url = "https://s3.amazonaws.com/Minecraft.Download/libraries/";
}
+ QJsonObject toJson();
+
/**
* finalize the library, processing the input values into derived values and state
*
@@ -84,7 +88,11 @@ public:
/// Returns true if the library is native
bool isNative();
/// Get the URL to download the library from
- QString downloadPath();
+ QString downloadUrl();
/// Get the relative path where the library should be saved
QString storagePath();
+
+ /// set an absolute URL for the library. This is an MMC extension.
+ void setAbsoluteUrl(QString absolute_url);
+ QString absoluteUrl();
};