commit e39b7f20e6466c3719425b00a941b5121e3eba75
parent 6300cb06cc175f9a6daacfe4636b368af94fb2bf
Author: cfillion <cfillion@users.noreply.github.com>
Date: Fri, 25 Aug 2017 18:54:27 -0400
browser: manager: re-sort list after changing row contents
Diffstat:
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/browser.cpp b/src/browser.cpp
@@ -1012,8 +1012,10 @@ void Browser::updateAction(const int index)
m_visibleEntries.erase(m_visibleEntries.begin() + index);
updateDisplayLabel();
}
- else
+ else {
m_list->replaceRow(index, makeRow(*entry));
+ m_list->sort(); // TODO: only re-sort if sorted by status column
+ }
if(m_actions.empty())
disable(m_applyBtn);
diff --git a/src/manager.cpp b/src/manager.cpp
@@ -364,6 +364,9 @@ void Manager::setMods(const ModsCallback &cb, const bool updateRow)
if(updateRow)
m_list->replaceRow(index, makeRow(remote));
}
+
+ if(updateRow)
+ m_list->sort();
}
void Manager::setRemoteEnabled(const bool enabled)
@@ -396,7 +399,7 @@ void Manager::setRemoteAutoInstall(const tribool &enabled)
mods->autoInstall = boost::none;
else
mods->autoInstall = enabled;
- }, true);
+ }, false);
}
tribool Manager::remoteAutoInstall(const Remote &remote) const
diff --git a/src/manager.hpp b/src/manager.hpp
@@ -59,7 +59,7 @@ private:
Remote getRemote(int index) const;
bool fillContextMenu(Menu &, int index) const;
- void setMods(const ModsCallback &, bool updateRow = false);
+ void setMods(const ModsCallback &, bool updateRow);
void setRemoteEnabled(bool);
bool isRemoteEnabled(const Remote &) const;
void setRemoteAutoInstall(const tribool &);