From 5a908442d646b5f3dbf7d22fc2331c8cc2b0d15a Mon Sep 17 00:00:00 2001 From: Tannin Date: Mon, 11 May 2015 21:37:12 +0200 Subject: dropping an url on the download widget now attempts to download the url --- src/downloadmanager.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/downloadmanager.cpp') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 81732f4d..e48d6bf1 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -358,7 +358,6 @@ bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs, DownloadInfo *newDownload = DownloadInfo::createNew(fileInfo, URLs); QString baseName = fileName; - if (!fileInfo->fileName.isEmpty()) { baseName = fileInfo->fileName; } else { @@ -368,7 +367,6 @@ bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs, baseName = dispoName; } } - if (QFile::exists(m_OutputDirectory + "/" + baseName) && (QMessageBox::question(nullptr, tr("Download again?"), tr("A file with the same name has already been downloaded. " "Do you want to download it again? The new file will receive a different name."), @@ -377,11 +375,9 @@ bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs, delete newDownload; return false; } - newDownload->setName(getDownloadFileName(baseName), false); startDownload(reply, newDownload, false); - // emit update(-1); return true; } @@ -1234,7 +1230,8 @@ bool DownloadManager::ServerByPreference(const std::map &preferred int DownloadManager::startDownloadURLs(const QStringList &urls) { - addDownload(urls, -1, -1, nullptr); + ModRepositoryFileInfo info; + addDownload(urls, -1, -1, &info); return m_ActiveDownloads.size() - 1; } -- cgit v1.3.1