diff options
| author | Tannin <devnull@localhost> | 2013-08-24 22:50:00 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-08-24 22:50:00 +0200 |
| commit | e91eebefbea450a447b44a81dcabcc6ac8000a48 (patch) | |
| tree | 25a6e1674f859249699d8242b7a611ae9d627890 /src/downloadmanager.cpp | |
| parent | 87f4e2df260e502bce61783a66e062af1b46e789 (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.cpp | 10 |
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 { |
