summaryrefslogtreecommitdiffstats
path: root/logic/OneSixUpdate.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-10-06 01:13:40 +0200
committerPetr Mrázek <peterix@gmail.com>2013-10-06 01:13:40 +0200
commitf83119ce7ec3d11a903901b8eff762d2b0a9f635 (patch)
tree5c30d7b9fff0f9417e7f2cd79d8ad9ea56d7f056 /logic/OneSixUpdate.cpp
parenteba9b3d759dbf6e402e91ab897059f1d274aef90 (diff)
downloadMultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.tar
MultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.tar.gz
MultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.tar.lz
MultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.tar.xz
MultiMC-f83119ce7ec3d11a903901b8eff762d2b0a9f635.zip
Added file logger
Diffstat (limited to 'logic/OneSixUpdate.cpp')
-rw-r--r--logic/OneSixUpdate.cpp25
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();