summaryrefslogtreecommitdiffstats
path: root/api/logic/net
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-05-03 21:09:36 +0200
committerPetr Mrázek <peterix@gmail.com>2017-05-03 21:09:36 +0200
commit0efa714ba55a33ea6dbcbd08b50c0b09675ce83b (patch)
treece808691e468d1a82a65dbcc9ed76cb29e59489e /api/logic/net
parent907aa367046bde6ad05893917cff11320019ddda (diff)
downloadMultiMC-0efa714ba55a33ea6dbcbd08b50c0b09675ce83b.tar
MultiMC-0efa714ba55a33ea6dbcbd08b50c0b09675ce83b.tar.gz
MultiMC-0efa714ba55a33ea6dbcbd08b50c0b09675ce83b.tar.lz
MultiMC-0efa714ba55a33ea6dbcbd08b50c0b09675ce83b.tar.xz
MultiMC-0efa714ba55a33ea6dbcbd08b50c0b09675ce83b.zip
NOISSUE replace std::shared_ptr with shared_qobject_ptr for all download tasks
Diffstat (limited to 'api/logic/net')
-rw-r--r--api/logic/net/Download.cpp6
-rw-r--r--api/logic/net/Download.h2
-rw-r--r--api/logic/net/NetAction.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/api/logic/net/Download.cpp b/api/logic/net/Download.cpp
index 97b03ac2..12c4d7e0 100644
--- a/api/logic/net/Download.cpp
+++ b/api/logic/net/Download.cpp
@@ -40,7 +40,7 @@ Download::Ptr Download::makeCached(QUrl url, MetaEntryPtr entry, Options options
auto cachedNode = new MetaCacheSink(entry, md5Node);
dl->m_sink.reset(cachedNode);
dl->m_target_path = entry->getFullPath();
- return std::shared_ptr<Download>(dl);
+ return dl;
}
Download::Ptr Download::makeByteArray(QUrl url, QByteArray *output, Options options)
@@ -49,7 +49,7 @@ Download::Ptr Download::makeByteArray(QUrl url, QByteArray *output, Options opti
dl->m_url = url;
dl->m_options = options;
dl->m_sink.reset(new ByteArraySink(output));
- return std::shared_ptr<Download>(dl);
+ return dl;
}
Download::Ptr Download::makeFile(QUrl url, QString path, Options options)
@@ -58,7 +58,7 @@ Download::Ptr Download::makeFile(QUrl url, QString path, Options options)
dl->m_url = url;
dl->m_options = options;
dl->m_sink.reset(new FileSink(path));
- return std::shared_ptr<Download>(dl);
+ return dl;
}
void Download::addValidator(Validator * v)
diff --git a/api/logic/net/Download.h b/api/logic/net/Download.h
index 0188a8ae..fdc83d5e 100644
--- a/api/logic/net/Download.h
+++ b/api/logic/net/Download.h
@@ -27,7 +27,7 @@ class MULTIMC_LOGIC_EXPORT Download : public NetAction
Q_OBJECT
public: /* types */
- typedef std::shared_ptr<class Download> Ptr;
+ typedef shared_qobject_ptr<class Download> Ptr;
enum class Option
{
NoOptions = 0,
diff --git a/api/logic/net/NetAction.h b/api/logic/net/NetAction.h
index bbd4a4be..667484d1 100644
--- a/api/logic/net/NetAction.h
+++ b/api/logic/net/NetAction.h
@@ -25,7 +25,7 @@
#include "multimc_logic_export.h"
-typedef std::shared_ptr<class NetAction> NetActionPtr;
+typedef shared_qobject_ptr<class NetAction> NetActionPtr;
class MULTIMC_LOGIC_EXPORT NetAction : public Task
{
Q_OBJECT