commit 1d03085dab4c14851c89244bc68a4eb5361fe06e
parent 0f4df3df5a3a0d08343010ab4701bc57b628e341
Author: cfillion <cfillion@users.noreply.github.com>
Date: Tue, 24 Oct 2017 05:28:16 -0400
Revert "browser: fix 0e172bc73d5f071f6f8d55d40727dbf600e0f734 when in the Queued tab"
This reverts commit c5d3ee003940b8965a8e8d3a76822bcda4994b14.
Diffstat:
2 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/src/browser.cpp b/src/browser.cpp
@@ -29,8 +29,6 @@
#include "transaction.hpp"
#include "win32.hpp"
-#include <numeric>
-
using namespace std;
enum Timers { TIMER_FILTER = 1, TIMER_ABOUT };
@@ -756,22 +754,16 @@ void Browser::updateAction(const int index)
void Browser::selectionDo(const function<void (int)> &func)
{
- listDo(func, m_list->selection());
-}
-
-void Browser::listDo(const function<void (int)> &func, const vector<int> &indexes)
-{
ListView::BeginEdit edit(m_list);
int lastSize = m_list->rowCount();
int offset = 0;
- // assumes the index vector is sorted
- for(const int index : indexes) {
+ for(const int index : m_list->selection()) {
func(index - offset);
// handle row removal
- const int newSize = m_list->rowCount();
+ int newSize = m_list->rowCount();
if(newSize < lastSize)
offset++;
lastSize = newSize;
@@ -846,13 +838,11 @@ bool Browser::apply()
}
if(!tx->runTasks()) {
- // This is an asynchronous transaction.
- // Updating the state column of all rows (not just visible ones since the
- // hidden rows can be filtered into view again by user at any time) right away
- // to give visual feedback.
- vector<int> fullList(m_list->rowCount());
- iota(fullList.begin(), fullList.end(), 0);
- listDo(bind(&Browser::updateAction, this, _1), fullList);
+ // this is an asynchronous transaction
+ // update the state column right away to give visual feedback
+ ListView::BeginEdit edit(m_list);
+ for(int i = 0, count = m_list->rowCount(); i < count; ++i)
+ updateAction(i);
}
return true;
diff --git a/src/browser.hpp b/src/browser.hpp
@@ -107,7 +107,6 @@ private:
void resetActions(int index);
void updateAction(const int index);
void selectionDo(const std::function<void (int)> &);
- void listDo(const std::function<void (int)> &, const std::vector<int> &);
View currentView() const;
void copy();
bool confirm() const;