summaryrefslogtreecommitdiffstats
path: root/logic/lists/MinecraftVersionList.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/lists/MinecraftVersionList.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/lists/MinecraftVersionList.cpp')
-rw-r--r--logic/lists/MinecraftVersionList.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/logic/lists/MinecraftVersionList.cpp b/logic/lists/MinecraftVersionList.cpp
index 35f7251e..36611165 100644
--- a/logic/lists/MinecraftVersionList.cpp
+++ b/logic/lists/MinecraftVersionList.cpp
@@ -16,8 +16,6 @@
#include "MinecraftVersionList.h"
#include <MultiMC.h>
-#include <QDebug>
-
#include <QtXml>
#include <QJsonDocument>
@@ -62,8 +60,8 @@ int MinecraftVersionList::count() const
bool cmpVersions(BaseVersionPtr first, BaseVersionPtr second)
{
- auto left = first.dynamicCast<MinecraftVersion>();
- auto right = second.dynamicCast<MinecraftVersion>();
+ auto left = std::dynamic_pointer_cast<MinecraftVersion>(first);
+ auto right = std::dynamic_pointer_cast<MinecraftVersion>(second);
return left->timestamp > right->timestamp;
}
@@ -78,7 +76,7 @@ BaseVersionPtr MinecraftVersionList::getLatestStable() const
{
for (int i = 0; i < m_vlist.length(); i++)
{
- auto ver = m_vlist.at(i).dynamicCast<MinecraftVersion>();
+ auto ver =std::dynamic_pointer_cast<MinecraftVersion>(m_vlist.at(i));
if (ver->is_latest && !ver->is_snapshot)
{
return m_vlist.at(i);
@@ -272,7 +270,7 @@ void MCVListLoadTask::list_downloaded()
QString dlUrl = QString(MCVLIST_URLBASE) + versionID + "/";
// Now, we construct the version object and add it to the list.
- QSharedPointer<MinecraftVersion> mcVersion(new MinecraftVersion());
+ std::shared_ptr<MinecraftVersion> mcVersion(new MinecraftVersion());
mcVersion->m_name = mcVersion->m_descriptor = versionID;
mcVersion->timestamp = versionTime.toMSecsSinceEpoch();
mcVersion->download_url = dlUrl;