Skip to content

Commit 630adb6

Browse files
Add startDownloadNexusFileForGame
1 parent 91912f5 commit 630adb6

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

src/downloadmanager.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -1908,12 +1908,16 @@ int DownloadManager::startDownloadURLs(const QStringList& urls)
19081908
}
19091909

19101910
int DownloadManager::startDownloadNexusFile(int modID, int fileID)
1911+
{
1912+
return startDownloadNexusFileForGame(m_ManagedGame->gameShortName(), modID, fileID);
1913+
}
1914+
1915+
int DownloadManager::startDownloadNexusFileForGame(const QString& gameName, int modID,
1916+
int fileID)
19111917
{
19121918
int newID = m_ActiveDownloads.size();
1913-
addNXMDownload(QString("nxm://%1/mods/%2/files/%3")
1914-
.arg(m_ManagedGame->gameShortName())
1915-
.arg(modID)
1916-
.arg(fileID));
1919+
addNXMDownload(
1920+
QString("nxm://%1/mods/%2/files/%3").arg(gameName).arg(modID).arg(fileID));
19171921
return newID;
19181922
}
19191923

src/downloadmanager.h

+1
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ class DownloadManager : public QObject
405405
public: // IDownloadManager interface:
406406
int startDownloadURLs(const QStringList& urls);
407407
int startDownloadNexusFile(int modID, int fileID);
408+
int startDownloadNexusFileForGame(const QString& gameName, int modID, int fileID);
408409
QString downloadPath(int id);
409410

410411
boost::signals2::connection

src/downloadmanagerproxy.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ int DownloadManagerProxy::startDownloadNexusFile(int modID, int fileID)
4646
return m_Proxied->startDownloadNexusFile(modID, fileID);
4747
}
4848

49+
int DownloadManagerProxy::startDownloadNexusFileForGame(const QString& gameName,
50+
int modID, int fileID)
51+
{
52+
return m_Proxied->startDownloadNexusFileForGame(gameName, modID, fileID);
53+
}
54+
4955
QString DownloadManagerProxy::downloadPath(int id)
5056
{
5157
return m_Proxied->downloadPath(id);

src/downloadmanagerproxy.h

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class DownloadManagerProxy : public MOBase::IDownloadManager
1515

1616
int startDownloadURLs(const QStringList& urls) override;
1717
int startDownloadNexusFile(int modID, int fileID) override;
18+
int startDownloadNexusFileForGame(const QString& gameName, int modID,
19+
int fileID) override;
1820
QString downloadPath(int id) override;
1921

2022
bool onDownloadComplete(const std::function<void(int)>& callback) override;

0 commit comments

Comments
 (0)