summaryrefslogtreecommitdiff
path: root/src/downloadlistwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/downloadlistwidget.cpp')
-rw-r--r--src/downloadlistwidget.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/downloadlistwidget.cpp b/src/downloadlistwidget.cpp
index 68dd2adf..953cdacd 100644
--- a/src/downloadlistwidget.cpp
+++ b/src/downloadlistwidget.cpp
@@ -40,8 +40,13 @@ DownloadListWidget::~DownloadListWidget()
}
-DownloadListWidgetDelegate::DownloadListWidgetDelegate(DownloadManager *manager, QTreeView *view, QObject *parent)
- : QItemDelegate(parent), m_Manager(manager), m_ItemWidget(new DownloadListWidget), m_ContextRow(0), m_View(view)
+DownloadListWidgetDelegate::DownloadListWidgetDelegate(DownloadManager *manager, bool metaDisplay, QTreeView *view, QObject *parent)
+ : QItemDelegate(parent)
+ , m_Manager(manager)
+ , m_MetaDisplay(metaDisplay)
+ , m_ItemWidget(new DownloadListWidget)
+ , m_ContextRow(0)
+ , m_View(view)
{
m_NameLabel = m_ItemWidget->findChild<QLabel*>("nameLabel");
m_SizeLabel = m_ItemWidget->findChild<QLabel*>("sizeLabel");
@@ -95,7 +100,7 @@ void DownloadListWidgetDelegate::paintPendingDownload(int downloadIndex) const
void DownloadListWidgetDelegate::paintRegularDownload(int downloadIndex) const
{
- QString name = m_Manager->getFileName(downloadIndex);
+ QString name = m_MetaDisplay ? m_Manager->getDisplayName(downloadIndex) : m_Manager->getFileName(downloadIndex);
if (name.length() > 53) {
name.truncate(50);
name.append("...");