- Give code a round of indentation. Thank astyle, not me.
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@837 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
aaf8e068d3
commit
d3c7b46853
108 changed files with 3196 additions and 3180 deletions
|
@ -38,53 +38,53 @@ using namespace std;
|
|||
template class SG_DLLEXPORT Singleton<PluginManager>;
|
||||
|
||||
|
||||
std::vector<Module*>
|
||||
std::vector<Module*>
|
||||
PluginManager::get_module_list() const
|
||||
{
|
||||
return _modules;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
PluginManager::rescan_dirs()
|
||||
{
|
||||
{
|
||||
Module* module = NULL;
|
||||
|
||||
for_each(_modules.begin(), _modules.end(),
|
||||
memory::deletor<Module>());
|
||||
for_each(_modules.begin(), _modules.end(),
|
||||
memory::deletor<Module>());
|
||||
_modules.clear();
|
||||
|
||||
|
||||
GlobalPreferences& prefs = GlobalPreferences::get_instance();
|
||||
GlobalPreferences::dir_iterator it = prefs.modules_dir_begin();
|
||||
|
||||
|
||||
|
||||
Glib::PatternSpec shared_obj(Glib::ustring("*.") + G_MODULE_SUFFIX);
|
||||
|
||||
while(it != prefs.modules_dir_end())
|
||||
|
||||
while (it != prefs.modules_dir_end())
|
||||
{
|
||||
Glib::Dir dir(*it);
|
||||
|
||||
for(Glib::DirIterator dir_it = dir.begin(); dir_it != dir.end(); ++dir_it)
|
||||
for (Glib::DirIterator dir_it = dir.begin(); dir_it != dir.end(); ++dir_it)
|
||||
{
|
||||
// only attempt to load .so files
|
||||
if(shared_obj.match(*dir_it))
|
||||
if (shared_obj.match(*dir_it))
|
||||
{
|
||||
std::string module_path = Module::build_path(*it, *dir_it);
|
||||
std::string module_path = Module::build_path(*it, *dir_it);
|
||||
|
||||
std::cerr << "Attempting to load module at path " << module_path << std::endl;
|
||||
|
||||
try
|
||||
{
|
||||
module = new Module(module_path);
|
||||
std::cerr << "Attempting to load module at path " << module_path << std::endl;
|
||||
|
||||
try
|
||||
{
|
||||
module = new Module(module_path);
|
||||
_modules.push_back(module);
|
||||
std::cerr << "\tSuccess" << std::endl;
|
||||
}
|
||||
catch(InvalidPluginException e)
|
||||
{
|
||||
std::cerr << "\tFailed, invalid plugin: " << e.what() << std::endl;
|
||||
}
|
||||
std::cerr << "\tSuccess" << std::endl;
|
||||
}
|
||||
catch (InvalidPluginException e)
|
||||
{
|
||||
std::cerr << "\tFailed, invalid plugin: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue