From 106ed49baecc60dbdf4844ed684df750e5caf3aa Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Sat, 26 Dec 2020 20:58:06 -0500
Subject: removed setUpdateDelay(false) calls, it's the default FilterWidget
for downloads tab
---
src/downloadlistwidget.cpp | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
(limited to 'src/downloadlistwidget.cpp')
diff --git a/src/downloadlistwidget.cpp b/src/downloadlistwidget.cpp
index 1bb13779..ad9ea63a 100644
--- a/src/downloadlistwidget.cpp
+++ b/src/downloadlistwidget.cpp
@@ -32,9 +32,23 @@ along with Mod Organizer. If not, see .
using namespace MOBase;
-void DownloadProgressDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+DownloadProgressDelegate::DownloadProgressDelegate(
+ DownloadManager* manager, DownloadListWidget* list)
+ : QStyledItemDelegate(list), m_Manager(manager), m_List(list)
{
- QModelIndex sourceIndex = m_SortProxy->mapToSource(index);
+}
+
+void DownloadProgressDelegate::paint(
+ QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ QModelIndex sourceIndex;
+
+ if (auto* proxy=dynamic_cast(m_List->model())) {
+ sourceIndex = proxy->mapToSource(index);
+ } else {
+ sourceIndex = index;
+ }
+
bool pendingDownload = (sourceIndex.row() >= m_Manager->numTotalDownloads());
if (sourceIndex.column() == DownloadList::COL_STATUS && !pendingDownload
&& m_Manager->getState(sourceIndex.row()) == DownloadManager::STATE_DOWNLOADING) {
--
cgit v1.3.1