Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add startDownloadNexusFileForGame #2181

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/downloadmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1907,13 +1907,12 @@ int DownloadManager::startDownloadURLs(const QStringList& urls)
return m_ActiveDownloads.size() - 1;
}

int DownloadManager::startDownloadNexusFile(int modID, int fileID)
int DownloadManager::startDownloadNexusFile(const QString& gameName, int modID,
int fileID)
{
int newID = m_ActiveDownloads.size();
addNXMDownload(QString("nxm://%1/mods/%2/files/%3")
.arg(m_ManagedGame->gameShortName())
.arg(modID)
.arg(fileID));
addNXMDownload(
QString("nxm://%1/mods/%2/files/%3").arg(gameName).arg(modID).arg(fileID));
return newID;
}

Expand Down
2 changes: 1 addition & 1 deletion src/downloadmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class DownloadManager : public QObject

public: // IDownloadManager interface:
int startDownloadURLs(const QStringList& urls);
int startDownloadNexusFile(int modID, int fileID);
int startDownloadNexusFile(const QString& gameName, int modID, int fileID);
QString downloadPath(int id);

boost::signals2::connection
Expand Down
9 changes: 8 additions & 1 deletion src/downloadmanagerproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ int DownloadManagerProxy::startDownloadURLs(const QStringList& urls)

int DownloadManagerProxy::startDownloadNexusFile(int modID, int fileID)
{
return m_Proxied->startDownloadNexusFile(modID, fileID);
return m_Proxied->startDownloadNexusFile(
m_OrganizerProxy->managedGame()->gameNexusName(), modID, fileID);
}

int DownloadManagerProxy::startDownloadNexusFileForGame(const QString& gameName,
int modID, int fileID)
{
return m_Proxied->startDownloadNexusFile(gameName, modID, fileID);
}

QString DownloadManagerProxy::downloadPath(int id)
Expand Down
2 changes: 2 additions & 0 deletions src/downloadmanagerproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class DownloadManagerProxy : public MOBase::IDownloadManager

int startDownloadURLs(const QStringList& urls) override;
int startDownloadNexusFile(int modID, int fileID) override;
int startDownloadNexusFileForGame(const QString& gameName, int modID,
int fileID) override;
QString downloadPath(int id) override;

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