mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
Fix transfer list architecture
Model returns string for DisplayRole. Text alignment is set by Model (using TextAlignmentRole). Delegate performs custom painting only where necessary (i.e. for Progress bar).
This commit is contained in:
@@ -26,8 +26,7 @@
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#ifndef TRANSFERLISTSORTMODEL_H
|
||||
#define TRANSFERLISTSORTMODEL_H
|
||||
#pragma once
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
#include "base/torrentfilter.h"
|
||||
@@ -37,9 +36,10 @@ class QStringList;
|
||||
class TransferListSortModel : public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(TransferListSortModel)
|
||||
|
||||
public:
|
||||
TransferListSortModel(QObject *parent = nullptr);
|
||||
explicit TransferListSortModel(QObject *parent = nullptr);
|
||||
|
||||
void setStatusFilter(TorrentFilter::Type filter);
|
||||
void setCategoryFilter(const QString &category);
|
||||
@@ -51,13 +51,9 @@ public:
|
||||
|
||||
private:
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
|
||||
bool lowerPositionThan(const QModelIndex &left, const QModelIndex &right) const;
|
||||
bool dateLessThan(int dateColumn, const QModelIndex &left, const QModelIndex &right, bool sortInvalidInBottom) const;
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
|
||||
bool matchFilter(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
bool lessThan_impl(const QModelIndex &left, const QModelIndex &right) const;
|
||||
|
||||
private:
|
||||
TorrentFilter m_filter;
|
||||
};
|
||||
|
||||
#endif // TRANSFERLISTSORTMODEL_H
|
||||
|
||||
Reference in New Issue
Block a user