mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-16 13:02:27 -04:00
improved plugin management to allow services to be used, and config pages to be added
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4960 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
fbce07eab0
commit
2c6a2b4ee7
5 changed files with 29 additions and 14 deletions
|
@ -198,6 +198,7 @@ bool RsPluginManager::loadPlugin(const std::string& plugin_name)
|
|||
PluginInfo pf ;
|
||||
pf.plugin = NULL ;
|
||||
pf.file_name = plugin_name ;
|
||||
pf.info_string = "" ;
|
||||
std::cerr << " -> hashing." << std::endl;
|
||||
uint64_t size ;
|
||||
|
||||
|
@ -232,9 +233,10 @@ bool RsPluginManager::loadPlugin(const std::string& plugin_name)
|
|||
|
||||
if(handle == NULL)
|
||||
{
|
||||
std::cerr << " Cannot open plugin: " << dlerror() << std::endl ;
|
||||
const char *val = dlerror() ;
|
||||
std::cerr << " Cannot open plugin: " << val << std::endl ;
|
||||
pinfo.status = PLUGIN_STATUS_DLOPEN_ERROR ;
|
||||
pinfo.info_string = dlerror() ;
|
||||
pinfo.info_string = val ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
|
@ -331,7 +333,13 @@ void RsPluginManager::addConfigurations(p3ConfigMgr *ConfigMgr)
|
|||
for(uint32_t i=0;i<_plugins.size();++i)
|
||||
if(_plugins[i].plugin != NULL && _plugins[i].plugin->configurationFileName().length() > 0)
|
||||
{
|
||||
ConfigMgr->addConfiguration(_plugins[i].plugin->configurationFileName(), _plugins[i].plugin->rs_cache_service());
|
||||
if( _plugins[i].plugin->rs_cache_service() != NULL)
|
||||
ConfigMgr->addConfiguration(_plugins[i].plugin->configurationFileName(), _plugins[i].plugin->rs_cache_service());
|
||||
else if(_plugins[i].plugin->rs_pqi_service() != NULL)
|
||||
ConfigMgr->addConfiguration(_plugins[i].plugin->configurationFileName(), _plugins[i].plugin->rs_pqi_service());
|
||||
else
|
||||
continue ;
|
||||
|
||||
std::cerr << " Added configuration for plugin " << _plugins[i].plugin->getPluginName() << ", with file " << _plugins[i].plugin->configurationFileName() << std::endl;
|
||||
}
|
||||
}
|
||||
|
@ -401,3 +409,8 @@ RsCacheService::RsCacheService(uint16_t service_type,uint32_t config_type,uint32
|
|||
{
|
||||
}
|
||||
|
||||
RsPQIService::RsPQIService(uint16_t service_type,uint32_t config_type,uint32_t tick_delay_in_seconds, RsPluginHandler* pgHandler)
|
||||
: p3Service(service_type),p3Config(config_type)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue