summaryrefslogtreecommitdiff
path: root/src/downloadlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/downloadlist.cpp')
-rw-r--r--src/downloadlist.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/downloadlist.cpp b/src/downloadlist.cpp
index fe021a27..d280cdb6 100644
--- a/src/downloadlist.cpp
+++ b/src/downloadlist.cpp
@@ -34,9 +34,10 @@ DownloadList::DownloadList(DownloadManager *manager, QObject *parent)
int DownloadList::rowCount(const QModelIndex&) const
{
- return m_Manager->numTotalDownloads();
+ return m_Manager->numTotalDownloads() + m_Manager->numPendingDownloads();
}
+
int DownloadList::columnCount(const QModelIndex&) const
{
return 3;
@@ -75,14 +76,18 @@ QVariant DownloadList::data(const QModelIndex &index, int role) const
if (role == Qt::DisplayRole) {
return index.row();
} else if (role == Qt::ToolTipRole) {
- QString text = m_Manager->getFileName(index.row()) + "\n";
- if (m_Manager->isInfoIncomplete(index.row())) {
- text += tr("Information missing, please select \"Query Info\" from the context menu to re-retrieve.");
+ if (index.row() < m_Manager->numTotalDownloads()) {
+ QString text = m_Manager->getFileName(index.row()) + "\n";
+ if (m_Manager->isInfoIncomplete(index.row())) {
+ text += tr("Information missing, please select \"Query Info\" from the context menu to re-retrieve.");
+ } else {
+ NexusInfo info = m_Manager->getNexusInfo(index.row());
+ text += QString("%1 (ID %2) %3").arg(info.m_ModName).arg(m_Manager->getModID(index.row())).arg(info.m_Version);
+ }
+ return text;
} else {
- NexusInfo info = m_Manager->getNexusInfo(index.row());
- text += QString("%1 (ID %2) %3").arg(info.m_ModName).arg(m_Manager->getModID(index.row())).arg(info.m_Version);
+ return tr("pending download");
}
- return text;
} else {
return QVariant();
}