From 4dc3538a7d14dd0f1aaa2e6c172745b63e251c86 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 4 Jan 2014 15:57:14 +0100 Subject: - nxmhandler will now ask before registering itself - downloads from nexus are now displayed before file information is retrieved - logging from the ui is now a bit more informative - download list now scrolls to bottom automatically --- src/downloadlist.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/downloadlist.cpp') 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(); } -- cgit v1.3.1