2000 GET!! Changed how the Lua factory is registered.

Originally committed to SVN as r2000.
This commit is contained in:
Rodrigo Braz Monteiro 2008-03-09 21:36:24 +00:00
parent f8d7c69c15
commit 777242fce3
2 changed files with 7 additions and 4 deletions

View File

@ -255,15 +255,17 @@ namespace Automation4 {
// Factory class for Lua scripts // Factory class for Lua scripts
class LuaScriptFactory : public ScriptFactory { class LuaScriptFactory : public ScriptFactory {
public: public:
LuaScriptFactory() LuaScriptFactory() { }
~LuaScriptFactory() { }
void RegisterFactory ()
{ {
engine_name = _T("Lua"); engine_name = _T("Lua");
filename_pattern = _T("*.lua"); filename_pattern = _T("*.lua");
Register(this); Register(this);
} }
~LuaScriptFactory() { }
virtual Script* Produce(const wxString &filename) const virtual Script* Produce(const wxString &filename) const
{ {
// Just check if file extension is .lua // Just check if file extension is .lua

View File

@ -82,7 +82,8 @@ void PluginManager::RegisterBuiltInPlugins() {
// Automation languages // Automation languages
#ifdef WITH_AUTO4_LUA #ifdef WITH_AUTO4_LUA
new Automation4::LuaScriptFactory(); Automation4::LuaScriptFactory *lua = new Automation4::LuaScriptFactory();
lua->RegisterFactory();
#endif #endif
#ifdef WITH_PERL #ifdef WITH_PERL
Automation4::PerlScriptFactory *perl = new Automation4::PerlScriptFactory(); Automation4::PerlScriptFactory *perl = new Automation4::PerlScriptFactory();