commit 0dcc91292ef2d857be6aa25109810ab00f3d5459
parent 10dd8776b8b470e58247c15b30a5584e8e7ebac4
Author: cfillion <cfillion@users.noreply.github.com>
Date: Tue, 20 Sep 2016 00:47:12 -0400
small refactoring to help avoid bugs in the future
Diffstat:
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/transaction.cpp b/src/transaction.cpp
@@ -298,7 +298,7 @@ void Transaction::registerQueued()
switch(reg.file.type) {
case Package::ScriptType:
- registerScript(reg);
+ registerScript(reg, m_regQueue.size() == 1);
break;
default:
break;
@@ -308,7 +308,7 @@ void Transaction::registerQueued()
}
}
-void Transaction::registerScript(const HostTicket ®)
+void Transaction::registerScript(const HostTicket ®, const bool isLast)
{
enum Section { MainSection = 0, MidiEditorSection = 32060 };
@@ -325,8 +325,6 @@ void Transaction::registerScript(const HostTicket ®)
section = MainSection;
const string &fullPath = Path::prefixRoot(reg.file.path).join();
- const bool isLast = m_regQueue.size() == 1;
-
if(!AddRemoveReaScript(reg.add, section, fullPath.c_str(), isLast) && reg.add) {
m_receipt.addError({"This script could not be registered in REAPER.",
reg.file.path.join()});
diff --git a/src/transaction.hpp b/src/transaction.hpp
@@ -87,7 +87,7 @@ private:
void synchronize(const Package *, const InstallOpts &);
bool allFilesExists(const std::set<Path> &) const;
void registerQueued();
- void registerScript(const HostTicket &);
+ void registerScript(const HostTicket &, bool isLast);
void inhibit(const Remote &);
bool commitTasks();
void finish();