diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-10-06 01:13:40 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-10-06 01:13:40 +0200 |
commit | f83119ce7ec3d11a903901b8eff762d2b0a9f635 (patch) | |
tree | 5c30d7b9fff0f9417e7f2cd79d8ad9ea56d7f056 /logic/OneSixVersion.cpp | |
parent | eba9b3d759dbf6e402e91ab897059f1d274aef90 (diff) | |
download | MultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.tar MultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.tar.gz MultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.tar.lz MultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.tar.xz MultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.zip |
Added file logger
Diffstat (limited to 'logic/OneSixVersion.cpp')
-rw-r--r-- | logic/OneSixVersion.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/logic/OneSixVersion.cpp b/logic/OneSixVersion.cpp index 64a47562..f7efedf9 100644 --- a/logic/OneSixVersion.cpp +++ b/logic/OneSixVersion.cpp @@ -2,8 +2,8 @@ #include "OneSixLibrary.h" #include "OneSixRule.h" -QSharedPointer<OneSixVersion> fromJsonV4(QJsonObject root, - QSharedPointer<OneSixVersion> fullVersion) +std::shared_ptr<OneSixVersion> fromJsonV4(QJsonObject root, + std::shared_ptr<OneSixVersion> fullVersion) { fullVersion->id = root.value("id").toString(); @@ -64,7 +64,7 @@ QSharedPointer<OneSixVersion> fromJsonV4(QJsonObject root, auto nameVal = libObj.value("name"); if (!nameVal.isString()) continue; - QSharedPointer<OneSixLibrary> library(new OneSixLibrary(nameVal.toString())); + std::shared_ptr<OneSixLibrary> library(new OneSixLibrary(nameVal.toString())); auto urlVal = libObj.value("url"); if (urlVal.isString()) @@ -129,9 +129,9 @@ QSharedPointer<OneSixVersion> fromJsonV4(QJsonObject root, return fullVersion; } -QSharedPointer<OneSixVersion> OneSixVersion::fromJson(QJsonObject root) +std::shared_ptr<OneSixVersion> OneSixVersion::fromJson(QJsonObject root) { - QSharedPointer<OneSixVersion> readVersion(new OneSixVersion()); + std::shared_ptr<OneSixVersion> readVersion(new OneSixVersion()); int launcher_ver = readVersion->minimumLauncherVersion = root.value("minimumLauncherVersion").toDouble(); @@ -140,16 +140,16 @@ QSharedPointer<OneSixVersion> OneSixVersion::fromJson(QJsonObject root) return fromJsonV4(root, readVersion); else { - return QSharedPointer<OneSixVersion>(); + return std::shared_ptr<OneSixVersion>(); } } -QSharedPointer<OneSixVersion> OneSixVersion::fromFile(QString filepath) +std::shared_ptr<OneSixVersion> OneSixVersion::fromFile(QString filepath) { QFile file(filepath); if (!file.open(QIODevice::ReadOnly)) { - return QSharedPointer<OneSixVersion>(); + return std::shared_ptr<OneSixVersion>(); } auto data = file.readAll(); @@ -158,12 +158,12 @@ QSharedPointer<OneSixVersion> OneSixVersion::fromFile(QString filepath) if (jsonError.error != QJsonParseError::NoError) { - return QSharedPointer<OneSixVersion>(); + return std::shared_ptr<OneSixVersion>(); } if (!jsonDoc.isObject()) { - return QSharedPointer<OneSixVersion>(); + return std::shared_ptr<OneSixVersion>(); } QJsonObject root = jsonDoc.object(); auto version = fromJson(root); @@ -202,9 +202,9 @@ bool OneSixVersion::toOriginalFile() return file.commit(); } -QList<QSharedPointer<OneSixLibrary>> OneSixVersion::getActiveNormalLibs() +QList<std::shared_ptr<OneSixLibrary>> OneSixVersion::getActiveNormalLibs() { - QList<QSharedPointer<OneSixLibrary>> output; + QList<std::shared_ptr<OneSixLibrary>> output; for (auto lib : libraries) { if (lib->isActive() && !lib->isNative()) @@ -215,9 +215,9 @@ QList<QSharedPointer<OneSixLibrary>> OneSixVersion::getActiveNormalLibs() return output; } -QList<QSharedPointer<OneSixLibrary>> OneSixVersion::getActiveNativeLibs() +QList<std::shared_ptr<OneSixLibrary>> OneSixVersion::getActiveNativeLibs() { - QList<QSharedPointer<OneSixLibrary>> output; + QList<std::shared_ptr<OneSixLibrary>> output; for (auto lib : libraries) { if (lib->isActive() && lib->isNative()) |