commit a819bf6cfbb79098d3ecdb6639ed46b44f430ab2
parent 1d03085dab4c14851c89244bc68a4eb5361fe06e
Author: cfillion <cfillion@users.noreply.github.com>
Date: Tue, 24 Oct 2017 05:32:26 -0400
browser: clear the list right away when applying an asynchronous transaction while in the Queued tab
(better implementation than 0e172bc73d5f071f6f8d55d40727dbf600e0f734)
Diffstat:
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/browser.cpp b/src/browser.cpp
@@ -816,11 +816,7 @@ bool Browser::apply()
if(!tx)
return false;
- std::list<Entry *> actions;
- swap(actions, m_actions);
- disable(m_applyBtn);
-
- for(Entry *entry : actions) {
+ for(Entry *entry : m_actions) {
if(entry->target) {
const Version *target = *entry->target;
@@ -837,12 +833,22 @@ bool Browser::apply()
}
}
+ m_actions.clear();
+ disable(m_applyBtn);
+
if(!tx->runTasks()) {
- // this is an asynchronous transaction
- // update the state column right away to give visual feedback
+ // 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.
ListView::BeginEdit edit(m_list);
- for(int i = 0, count = m_list->rowCount(); i < count; ++i)
- updateAction(i);
+
+ if(currentView() == QueuedView)
+ m_list->clear();
+ else {
+ for(int i = 0, count = m_list->rowCount(); i < count; ++i)
+ m_list->row(i)->setCell(0, getEntry(i)->displayState());
+ }
}
return true;