From 9b3e91b53e769aec2622eb79509945c09fca8897 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Mon, 28 Dec 2020 06:01:43 -0500 Subject: renamed DownloadList::lessThan to lessThanPredicate and added a comment that it's used with the filter widget --- src/downloadlist.cpp | 2 +- src/downloadlist.h | 4 +++- src/downloadstab.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/downloadlist.cpp b/src/downloadlist.cpp index 3cfc1fea..a5c284e6 100644 --- a/src/downloadlist.cpp +++ b/src/downloadlist.cpp @@ -209,7 +209,7 @@ void DownloadList::update(int row) log::error("invalid row {} in download list, update failed", row); } -bool DownloadList::lessThan(const QModelIndex &left, const QModelIndex &right) +bool DownloadList::lessThanPredicate(const QModelIndex &left, const QModelIndex &right) { int leftIndex = left.row(); int rightIndex = right.row(); diff --git a/src/downloadlist.h b/src/downloadlist.h index c40bbac5..2171c013 100644 --- a/src/downloadlist.h +++ b/src/downloadlist.h @@ -85,7 +85,9 @@ public: **/ virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - bool lessThan(const QModelIndex &left, const QModelIndex &right); + // used in DownloadsTab as the sorting predicate for the filter widget + // + bool lessThanPredicate(const QModelIndex &left, const QModelIndex &right); public slots: diff --git a/src/downloadstab.cpp b/src/downloadstab.cpp index f5258724..a0602ede 100644 --- a/src/downloadstab.cpp +++ b/src/downloadstab.cpp @@ -22,7 +22,7 @@ DownloadsTab::DownloadsTab(OrganizerCore& core, Ui::MainWindow* mwui) m_filter.setEdit(ui.filter); m_filter.setList(ui.list); m_filter.setSortPredicate([sourceModel](auto&& left, auto&& right) { - return sourceModel->lessThan(left, right); + return sourceModel->lessThanPredicate(left, right); }); connect(ui.refresh, &QPushButton::clicked, [&]{ refresh(); }); -- cgit v1.3.1