From 506a42daf34fc6791e5cf1319bf51da2b4a4ef3b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 31 Jul 2018 02:00:27 +0200 Subject: Cleanup trigger_script_by_name() debug/error messages --- gtk2_ardour/editor_actions.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'gtk2_ardour/editor_actions.cc') diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index fded7e6fae..e5af91d132 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -758,12 +758,14 @@ Editor::trigger_script_by_name (const std::string script_name) script_path = (*s)->path; if (!Glib::file_test (script_path, Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR)) { +#ifndef NDEBUG cerr << "Lua Script action: path to " << script_path << " does not appear to be valid" << endl; +#endif return; } LuaState lua; - lua.Print.connect (&_lua_print); //ToDo + lua.Print.connect (&_lua_print); lua.sandbox (false); lua_State* L = lua.getState(); LuaInstance::register_classes (L); @@ -774,9 +776,6 @@ Editor::trigger_script_by_name (const std::string script_name) lua.do_file (script_path); luabridge::LuaRef args (luabridge::newTable (L)); - //ToDo: args? - // args["how_many"] = count; - try { luabridge::LuaRef fn = luabridge::getGlobal (L, "factory"); if (fn.isFunction()) { @@ -787,12 +786,12 @@ Editor::trigger_script_by_name (const std::string script_name) } catch (...) { cerr << "Lua script failed: " << script_path << endl; } - - continue; //script found; we're done + return; } } - +#ifndef NDEBUG cerr << "Lua script was not found: " << script_name << endl; +#endif } void -- cgit v1.2.3