From f83119ce7ec3d11a903901b8eff762d2b0a9f635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 6 Oct 2013 01:13:40 +0200 Subject: Added file logger --- logic/lists/ForgeVersionList.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'logic/lists/ForgeVersionList.cpp') diff --git a/logic/lists/ForgeVersionList.cpp b/logic/lists/ForgeVersionList.cpp index ac1a4ef5..9b698135 100644 --- a/logic/lists/ForgeVersionList.cpp +++ b/logic/lists/ForgeVersionList.cpp @@ -18,11 +18,11 @@ #include "MultiMC.h" #include - #include - #include +#include + #define JSON_URL "http://files.minecraftforge.net/minecraftforge/json" ForgeVersionList::ForgeVersionList(QObject *parent) : BaseVersionList(parent) @@ -62,7 +62,7 @@ QVariant ForgeVersionList::data(const QModelIndex &index, int role) const if (index.row() > count()) return QVariant(); - auto version = m_vlist[index.row()].dynamicCast(); + auto version = std::dynamic_pointer_cast(m_vlist[index.row()]); switch (role) { case Qt::DisplayRole: @@ -164,9 +164,9 @@ void ForgeListLoadTask::executeTask() auto forgeListEntry = MMC->metacache()->resolveEntry("minecraftforge", "list.json"); job->addCacheDownload(QUrl(JSON_URL), forgeListEntry); listJob.reset(job); - connect(listJob.data(), SIGNAL(succeeded()), SLOT(list_downloaded())); - connect(listJob.data(), SIGNAL(failed()), SLOT(list_failed())); - connect(listJob.data(), SIGNAL(progress(qint64, qint64)), SIGNAL(progress(qint64, qint64))); + connect(listJob.get(), SIGNAL(succeeded()), SLOT(list_downloaded())); + connect(listJob.get(), SIGNAL(failed()), SLOT(list_failed())); + connect(listJob.get(), SIGNAL(progress(qint64, qint64)), SIGNAL(progress(qint64, qint64))); listJob->start(); } @@ -176,10 +176,10 @@ void ForgeListLoadTask::list_failed() auto reply = DlJob->m_reply; if(reply) { - qDebug() << "Getting forge version list failed: " << reply->errorString(); + QLOG_ERROR() << "Getting forge version list failed: " << reply->errorString(); } else - qDebug() << "Getting forge version list failed for reasons unknown."; + QLOG_ERROR() << "Getting forge version list failed for reasons unknown."; } void ForgeListLoadTask::list_downloaded() @@ -187,7 +187,7 @@ void ForgeListLoadTask::list_downloaded() QByteArray data; { auto DlJob = listJob->first(); - auto filename = DlJob.dynamicCast()->m_target_path; + auto filename = std::dynamic_pointer_cast(DlJob)->m_target_path; QFile listFile(filename); if(!listFile.open(QIODevice::ReadOnly)) return; @@ -272,7 +272,7 @@ void ForgeListLoadTask::list_downloaded() if (valid) { // Now, we construct the version object and add it to the list. - QSharedPointer fVersion(new ForgeVersion()); + std::shared_ptr fVersion(new ForgeVersion()); fVersion->universal_url = url; fVersion->changelog_url = changelog_url; fVersion->installer_url = installer_url; -- cgit v1.2.3