summaryrefslogtreecommitdiffstats
path: root/logic/DerpVersion.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-01-23 21:31:41 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-01-23 21:31:41 +0100
commit156bc8f27656c115bf1b023cd4ebc5f629df3887 (patch)
tree79e7ff327148f0841d7184a3882d8c2e6938ef4a /logic/DerpVersion.cpp
parentc39d26f4453166603749826eee1a732c815047d0 (diff)
downloadMultiMC-156bc8f27656c115bf1b023cd4ebc5f629df3887.tar
MultiMC-156bc8f27656c115bf1b023cd4ebc5f629df3887.tar.gz
MultiMC-156bc8f27656c115bf1b023cd4ebc5f629df3887.tar.lz
MultiMC-156bc8f27656c115bf1b023cd4ebc5f629df3887.tar.xz
MultiMC-156bc8f27656c115bf1b023cd4ebc5f629df3887.zip
Forge works now too, and so does forge+liteloader
Diffstat (limited to 'logic/DerpVersion.cpp')
-rw-r--r--logic/DerpVersion.cpp47
1 files changed, 31 insertions, 16 deletions
diff --git a/logic/DerpVersion.cpp b/logic/DerpVersion.cpp
index cabb2b24..f4a8dd97 100644
--- a/logic/DerpVersion.cpp
+++ b/logic/DerpVersion.cpp
@@ -44,6 +44,26 @@ void DerpVersion::clear()
libraries.clear();
}
+void DerpVersion::dump() const
+{
+ qDebug().nospace() << "DerpVersion("
+ << "\n\tid=" << id
+ << "\n\ttime=" << time
+ << "\n\treleaseTime=" << releaseTime
+ << "\n\ttype=" << type
+ << "\n\tassets=" << assets
+ << "\n\tprocessArguments=" << processArguments
+ << "\n\tminecraftArguments=" << minecraftArguments
+ << "\n\tminimumLauncherVersion=" << minimumLauncherVersion
+ << "\n\tmainClass=" << mainClass
+ << "\n\tlibraries=";
+ for (auto lib : libraries)
+ {
+ qDebug().nospace() << "\n\t\t" << lib.get();
+ }
+ qDebug().nospace() << "\n)";
+}
+
QList<std::shared_ptr<DerpLibrary> > DerpVersion::getActiveNormalLibs()
{
QList<std::shared_ptr<DerpLibrary> > output;
@@ -70,6 +90,16 @@ QList<std::shared_ptr<DerpLibrary> > DerpVersion::getActiveNativeLibs()
return output;
}
+std::shared_ptr<DerpVersion> DerpVersion::fromJson(const QJsonObject &obj)
+{
+ std::shared_ptr<DerpVersion> version(new DerpVersion(0));
+ if (DerpVersionBuilder::read(version.get(), obj))
+ {
+ return version;
+ }
+ return 0;
+}
+
QVariant DerpVersion::data(const QModelIndex &index, int role) const
{
if (!index.isValid())
@@ -143,22 +173,7 @@ int DerpVersion::columnCount(const QModelIndex &parent) const
QDebug operator<<(QDebug &dbg, const DerpVersion *version)
{
- dbg.nospace() << "DerpVersion("
- << "\n\tid=" << version->id
- << "\n\ttime=" << version->time
- << "\n\treleaseTime=" << version->releaseTime
- << "\n\ttype=" << version->type
- << "\n\tassets=" << version->assets
- << "\n\tprocessArguments=" << version->processArguments
- << "\n\tminecraftArguments=" << version->minecraftArguments
- << "\n\tminimumLauncherVersion=" << version->minimumLauncherVersion
- << "\n\tmainClass=" << version->mainClass
- << "\n\tlibraries=";
- for (auto lib : version->libraries)
- {
- dbg.nospace() << "\n\t\t" << lib.get();
- }
- dbg.nospace() << "\n)";
+ version->dump();
return dbg.maybeSpace();
}
QDebug operator<<(QDebug &dbg, const DerpLibrary *library)