diff options
| author | Tannin <devnull@localhost> | 2014-01-04 15:57:14 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-01-04 15:57:14 +0100 |
| commit | 4dc3538a7d14dd0f1aaa2e6c172745b63e251c86 (patch) | |
| tree | 2242c92482306c5710b00dfb212cce11456e776d /src/downloadlist.cpp | |
| parent | 14ac234daf1680b0685f6bea3e74aa09dfcf38ef (diff) | |
- 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
Diffstat (limited to 'src/downloadlist.cpp')
| -rw-r--r-- | src/downloadlist.cpp | 19 |
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(); } |
