diff options
author | Sky <git@bunnies.cc> | 2013-10-06 01:13:20 +0100 |
---|---|---|
committer | Sky <git@bunnies.cc> | 2013-10-06 01:13:20 +0100 |
commit | 7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c (patch) | |
tree | 53ea703d11a525442d6ebf575bd22f840c5b4e8d /logic/OneSixUpdate.cpp | |
parent | 2398acc9e490ce124aa621c19156c89ef87591f1 (diff) | |
parent | f83119ce7ec3d11a903901b8eff762d2b0a9f635 (diff) | |
download | PrismLauncher-7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c.tar.gz PrismLauncher-7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c.tar.bz2 PrismLauncher-7aeea14a027f8cf28615f73f4fda1ffffc2cdc3c.zip |
Merge branch 'develop' of https://github.com/MultiMC/MultiMC5 into develop
Diffstat (limited to 'logic/OneSixUpdate.cpp')
-rw-r--r-- | logic/OneSixUpdate.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp index 41d8f599..008995ae 100644 --- a/logic/OneSixUpdate.cpp +++ b/logic/OneSixUpdate.cpp @@ -22,8 +22,6 @@ #include <QTextStream> #include <QDataStream> -#include <QDebug> - #include "BaseInstance.h" #include "lists/MinecraftVersionList.h" #include "OneSixVersion.h" @@ -49,8 +47,8 @@ void OneSixUpdate::executeTask() } // Get a pointer to the version object that corresponds to the instance's version. - targetVersion = - MMC->minecraftlist()->findVersion(intendedVersion).dynamicCast<MinecraftVersion>(); + targetVersion = std::dynamic_pointer_cast<MinecraftVersion>( + MMC->minecraftlist()->findVersion(intendedVersion)); if (targetVersion == nullptr) { // don't do anything if it was invalid @@ -77,10 +75,9 @@ void OneSixUpdate::versionFileStart() auto job = new DownloadJob("Version index"); job->addByteArrayDownload(QUrl(urlstr)); specificVersionDownloadJob.reset(job); - connect(specificVersionDownloadJob.data(), SIGNAL(succeeded()), - SLOT(versionFileFinished())); - connect(specificVersionDownloadJob.data(), SIGNAL(failed()), SLOT(versionFileFailed())); - connect(specificVersionDownloadJob.data(), SIGNAL(progress(qint64, qint64)), + connect(specificVersionDownloadJob.get(), SIGNAL(succeeded()), SLOT(versionFileFinished())); + connect(specificVersionDownloadJob.get(), SIGNAL(failed()), SLOT(versionFileFailed())); + connect(specificVersionDownloadJob.get(), SIGNAL(progress(qint64, qint64)), SIGNAL(progress(qint64, qint64))); specificVersionDownloadJob->start(); } @@ -103,7 +100,7 @@ void OneSixUpdate::versionFileFinished() emitFailed("Can't open " + version1 + " for writing."); return; } - auto data = DlJob.dynamicCast<ByteArrayDownload>()->m_data; + auto data = std::dynamic_pointer_cast<ByteArrayDownload>(DlJob)->m_data; qint64 actual = 0; if ((actual = vfile1.write(data)) != data.size()) { @@ -149,7 +146,7 @@ void OneSixUpdate::jarlibStart() return; } - QSharedPointer<OneSixVersion> version = inst->getFullVersion(); + std::shared_ptr<OneSixVersion> version = inst->getFullVersion(); // download the right jar, save it in versions/$version/$version.jar QString urlstr("http://s3.amazonaws.com/Minecraft.Download/versions/"); @@ -171,15 +168,15 @@ void OneSixUpdate::jarlibStart() auto entry = metacache->resolveEntry("libraries", lib->storagePath()); if (entry->stale) { - if(lib->hint() == "forge-pack-xz") + if (lib->hint() == "forge-pack-xz") jarlibDownloadJob->addForgeXzDownload(download_path, entry); else jarlibDownloadJob->addCacheDownload(download_path, entry); } } - connect(jarlibDownloadJob.data(), SIGNAL(succeeded()), SLOT(jarlibFinished())); - connect(jarlibDownloadJob.data(), SIGNAL(failed()), SLOT(jarlibFailed())); - connect(jarlibDownloadJob.data(), SIGNAL(progress(qint64, qint64)), + connect(jarlibDownloadJob.get(), SIGNAL(succeeded()), SLOT(jarlibFinished())); + connect(jarlibDownloadJob.get(), SIGNAL(failed()), SLOT(jarlibFailed())); + connect(jarlibDownloadJob.get(), SIGNAL(progress(qint64, qint64)), SIGNAL(progress(qint64, qint64))); jarlibDownloadJob->start(); |