From cc2bd152568a4f1164a0a4ba5e6232e77e7c9945 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sat, 7 Apr 2018 22:18:45 -0500 Subject: Fix for re-downloading a mod already downloading --- src/downloadmanager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/downloadmanager.cpp') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index a4fde093..c0d7fbf3 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -460,7 +460,14 @@ void DownloadManager::addNXMDownload(const QString &url) return; } + if (m_PendingDownloads.contains(std::pair(nxmInfo.modId(), nxmInfo.fileId()))) { + qDebug("download requested is already started (mod: %s, file: %s)", qPrintable(nxmInfo.modId()), qPrintable(nxmInfo.fileId())); + QMessageBox::information(nullptr, tr("Already Started"), tr("A download for this mod file has already been started."), QMessageBox::Ok); + return; + } + emit aboutToUpdate(); + m_PendingDownloads.append(std::make_pair(nxmInfo.modId(), nxmInfo.fileId())); emit update(-1); -- cgit v1.3.1