reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 8fd20e77adcfda1f56852f46e5bd0db66a329421
parent b432a01c24e81bbca005c838bd1c7c1cfe3344d7
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sun,  4 Jun 2017 05:01:05 -0400

api: wait until commit==true to update AL contents in AddSetRepository

Diffstat:
Msrc/api.cpp | 8+++++---
Msrc/reapack.hpp | 1+
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/api.cpp b/src/api.cpp @@ -291,9 +291,9 @@ autoInstall: 0=manual, 1=when sychronizing, 2=obey user setting)", DEFINE_API(bool, AddSetRepository, ((const char*, name))((const char*, url)) ((bool, enable))((int, autoInstall))((bool, commit)) ((char*, errorOut))((int, errorOut_sz)), -R"(Add or modify a repository. Set url to nullptr (empty string in Lua) to keep the existing URL. Set commit to true for the last call to save the new list and update the GUI. +R"(Add or modify a repository. Set url to nullptr (or empty string in Lua) to keep the existing URL. Set commit to true for the last call to process the new list and update the GUI. -autoInstall: default is 2 (obey user setting).)", +autoInstall: usually set to 2 (obey user setting).)", { try { const Remote &existing = reapack->remote(name); @@ -316,7 +316,6 @@ autoInstall: default is 2 (obey user setting).)", return false; reapack->setRemoteEnabled(enable, existing); - tx->runTasks(); } reapack->config()->remotes.add(remote); @@ -336,6 +335,9 @@ autoInstall: default is 2 (obey user setting).)", reapack->refreshManager(); reapack->refreshBrowser(); reapack->config()->write(); + + if(reapack->hasTransaction()) + reapack->setupTransaction()->runTasks(); } return true; diff --git a/src/reapack.hpp b/src/reapack.hpp @@ -77,6 +77,7 @@ public: Remote remote(const std::string &name) const; + bool hasTransaction() const { return m_tx != nullptr; } Transaction *setupTransaction(); Config *config() const { return m_config; }