diff --git a/src/browser.hpp b/src/browser.hpp index a224ffe6..4c26af8d 100644 --- a/src/browser.hpp +++ b/src/browser.hpp @@ -44,6 +44,7 @@ class Browser : public Dialog { public: Browser(ReaPack *); void refresh(bool stale = false); + void populate(); protected: void onInit() override; @@ -98,7 +99,6 @@ class Browser : public Dialog { Entry makeEntry(const Package *, const Registry::Entry &) const; - void populate(); void transferActions(); bool match(const Entry &) const; void checkFilter(); diff --git a/src/reapack.cpp b/src/reapack.cpp index 197a1a3a..f93d507f 100644 --- a/src/reapack.cpp +++ b/src/reapack.cpp @@ -506,11 +506,17 @@ Transaction *ReaPack::setupTransaction() }); m_tx->setCleanupHandler([=] { + // refresh only once all onFinish slots were ran + if(m_browser) { + // don't reload indexes unless they were modified + if(m_tx->updatedIndexes()) + m_browser->refresh(); + else + m_browser->populate(); + } + delete m_tx; m_tx = nullptr; - - // refresh only once all onFinish slots were ran - refreshBrowser(); }); return m_tx; diff --git a/src/transaction.hpp b/src/transaction.hpp index d87ca208..0c6cce33 100644 --- a/src/transaction.hpp +++ b/src/transaction.hpp @@ -61,6 +61,7 @@ class Transaction { bool isCancelled() const { return m_isCancelled; } const Receipt &receipt() const { return m_receipt; } size_t taskCount() const { return m_tasks.size(); } + bool updatedIndexes() const { return !m_remotes.empty(); } DownloadQueue *downloadQueue() { return &m_downloadQueue; }