Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-core / trunk / src / synfig / module.cpp
index d70622f..5d64003 100644 (file)
@@ -1,8 +1,8 @@
 /* === S Y N F I G ========================================================= */
-/*!    \file module.cpp
+/*!    \file synfig/module.cpp
 **     \brief writeme
 **
-**     $Id: module.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**     $Id$
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
@@ -69,7 +69,8 @@ Module::subsys_init(const String &prefix)
        }
 
        lt_dladdsearchdir(".");
-       lt_dladdsearchdir("~/.synfig/modules");
+       if(getenv("HOME"))
+               lt_dladdsearchdir(strprintf("%s/.synfig/modules", getenv("HOME")).c_str());
        lt_dladdsearchdir((prefix+"/lib/synfig/modules").c_str());
 #ifdef LIBDIR
        lt_dladdsearchdir(LIBDIR"/synfig/modules");
@@ -95,10 +96,15 @@ Module::subsys_stop()
        return true;
 }
 
-bool
-register_default_modules()
+void
+Module::register_default_modules(ProgressCallback *callback)
 {
-       return true;
+       #define REGISTER_MODULE(module) if (!Register(module, callback)) \
+                                                                               throw std::runtime_error(strprintf(_("Unable to load module '%s'"), module))
+       REGISTER_MODULE("lyr_freetype");
+       REGISTER_MODULE("mod_geometry");
+       REGISTER_MODULE("mod_gradient");
+       REGISTER_MODULE("mod_particle");
 }
 
 Module::Book&
@@ -184,5 +190,5 @@ synfig::Module::Register(const String &module_name, ProgressCallback *callback)
        if(callback)callback->task(strprintf(_("Success for \"%s\""),module_name.c_str()));
 
 #endif
-       return false;
+       return true;
 }