Skip to content

Commit 52458b2

Browse files
Add startDownloadNexusFileForGame
1 parent 91912f5 commit 52458b2

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

src/downloadmanager.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -1907,13 +1907,12 @@ int DownloadManager::startDownloadURLs(const QStringList& urls)
19071907
return m_ActiveDownloads.size() - 1;
19081908
}
19091909

1910-
int DownloadManager::startDownloadNexusFile(int modID, int fileID)
1910+
int DownloadManager::startDownloadNexusFile(const QString& gameName, int modID,
1911+
int fileID)
19111912
{
19121913
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));
1914+
addNXMDownload(
1915+
QString("nxm://%1/mods/%2/files/%3").arg(gameName).arg(modID).arg(fileID));
19171916
return newID;
19181917
}
19191918

src/downloadmanager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ class DownloadManager : public QObject
404404

405405
public: // IDownloadManager interface:
406406
int startDownloadURLs(const QStringList& urls);
407-
int startDownloadNexusFile(int modID, int fileID);
407+
int startDownloadNexusFile(const QString& gameName, int modID, int fileID);
408408
QString downloadPath(int id);
409409

410410
boost::signals2::connection

src/downloadmanagerproxy.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ int DownloadManagerProxy::startDownloadURLs(const QStringList& urls)
4343

4444
int DownloadManagerProxy::startDownloadNexusFile(int modID, int fileID)
4545
{
46-
return m_Proxied->startDownloadNexusFile(modID, fileID);
46+
return m_Proxied->startDownloadNexusFile(
47+
m_OrganizerProxy->managedGame()->gameNexusName(), modID, fileID);
48+
}
49+
50+
int DownloadManagerProxy::startDownloadNexusFileForGame(const QString& gameName,
51+
int modID, int fileID)
52+
{
53+
return m_Proxied->startDownloadNexusFile(gameName, modID, fileID);
4754
}
4855

4956
QString DownloadManagerProxy::downloadPath(int 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)