From 2db33523a1c8497657963a88f70fe1726cbf8fc9 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 23 Apr 2014 23:59:30 +0200 Subject: - added an option to show meta info on downloads instead of filenames - MO will now cancel if user tries to run MO vfs-injected - when saving the MO ini file it is now written to a tmp file first and then overwritten - updated to link against boost python 1.55 --- src/downloadlistwidget.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/downloadlistwidget.cpp') 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("nameLabel"); m_SizeLabel = m_ItemWidget->findChild("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("..."); -- cgit v1.3.1