From e91eebefbea450a447b44a81dcabcc6ac8000a48 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 24 Aug 2013 22:50:00 +0200 Subject: - 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 --- src/downloadmanager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/downloadmanager.cpp') 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 { -- cgit v1.3.1