blob: 06dad21f15bb637115b55f35fc9ef5f468390c30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#include "downloadmanagerproxy.h"
#include "proxyutils.h"
#include "organizerproxy.h"
using namespace MOBase;
using namespace MOShared;
DownloadManagerProxy::DownloadManagerProxy(OrganizerProxy* oproxy, DownloadManager* downloadManager) :
m_OrganizerProxy(oproxy), m_Proxied(downloadManager)
{
m_Connections.push_back(m_Proxied->onDownloadComplete(callSignalIfPluginActive(m_OrganizerProxy, m_DownloadComplete)));
m_Connections.push_back(m_Proxied->onDownloadFailed(callSignalIfPluginActive(m_OrganizerProxy, m_DownloadFailed)));
m_Connections.push_back(m_Proxied->onDownloadRemoved(callSignalIfPluginActive(m_OrganizerProxy, m_DownloadRemoved)));
m_Connections.push_back(m_Proxied->onDownloadPaused(callSignalIfPluginActive(m_OrganizerProxy, m_DownloadPaused)));
}
DownloadManagerProxy::~DownloadManagerProxy()
{
for (auto& conn : m_Connections) {
conn.disconnect();
}
}
int DownloadManagerProxy::startDownloadURLs(const QStringList& urls)
{
return m_Proxied->startDownloadURLs(urls);
}
int DownloadManagerProxy::startDownloadNexusFile(int modID, int fileID)
{
return m_Proxied->startDownloadNexusFile(modID, fileID);
}
QString DownloadManagerProxy::downloadPath(int id)
{
return m_Proxied->downloadPath(id);
}
bool DownloadManagerProxy::onDownloadComplete(const std::function<void(int)>& callback)
{
return m_DownloadComplete.connect(callback).connected();
}
bool DownloadManagerProxy::onDownloadPaused(const std::function<void(int)>& callback)
{
return m_DownloadPaused.connect(callback).connected();
}
bool DownloadManagerProxy::onDownloadFailed(const std::function<void(int)>& callback)
{
return m_DownloadFailed.connect(callback).connected();
}
bool DownloadManagerProxy::onDownloadRemoved(const std::function<void(int)>& callback)
{
return m_DownloadRemoved.connect(callback).connected();
}
|