summaryrefslogtreecommitdiff
path: root/src/downloadmanager.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-08-24 22:50:00 +0200
committerTannin <devnull@localhost>2013-08-24 22:50:00 +0200
commite91eebefbea450a447b44a81dcabcc6ac8000a48 (patch)
tree25a6e1674f859249699d8242b7a611ae9d627890 /src/downloadmanager.cpp
parent87f4e2df260e502bce61783a66e062af1b46e789 (diff)
- download size is now displayed
- multiple esps/mods can now be enabled/disabled at once using space - bugfix: fomod installer didn't compile because of changes to condition checking - bugfix: broken inverse virtual name resolution in case of non-default mod directory
Diffstat (limited to 'src/downloadmanager.cpp')
-rw-r--r--src/downloadmanager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index 07048ada..ca6744aa 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -97,6 +97,7 @@ DownloadManager::DownloadInfo *DownloadManager::DownloadInfo::createFromMeta(con
info->m_DownloadID = s_NextDownloadID++;
info->m_Output.setFileName(filePath);
+ info->m_TotalSize = QFileInfo(filePath).size();
info->m_ModID = metaFile.value("modID", 0).toInt();
info->m_FileID = metaFile.value("fileID", 0).toInt();
info->m_CurrentUrl = 0;
@@ -596,6 +597,15 @@ QString DownloadManager::getFileName(int index) const
return m_ActiveDownloads.at(index)->m_FileName;
}
+qint64 DownloadManager::getFileSize(int index) const
+{
+ if ((index < 0) || (index >= m_ActiveDownloads.size())) {
+ throw MyException(tr("invalid index"));
+ }
+
+ return m_ActiveDownloads.at(index)->m_TotalSize;
+}
+
int DownloadManager::getProgress(int index) const
{