mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-03 03:36:58 -04:00
made JsonApiServer an singleton through static method instance()
This commit is contained in:
parent
3b45fc5199
commit
d19d1685de
9 changed files with 129 additions and 95 deletions
|
@ -173,15 +173,16 @@ void p3ConfigMgr::addConfiguration(std::string file, pqiConfig *conf)
|
|||
}
|
||||
// Also check that the filename is not already registered for another config
|
||||
|
||||
for(std::list<pqiConfig*>::const_iterator it = mConfigs.begin(); it!= mConfigs.end(); ++it)
|
||||
for(std::list<pqiConfig*>::iterator it = mConfigs.begin(); it!= mConfigs.end();)
|
||||
if((*it)->filename == filename)
|
||||
{
|
||||
std::cerr << "!!!!!!!!!! Trying to register a config for file \"" << filename << "\" that is already registered" << std::endl;
|
||||
std::cerr << "!!!!!!!!!! Please correct the code !" << std::endl;
|
||||
return;
|
||||
std::cerr << "(WW) Registering a config for file \"" << filename << "\" that is already registered. Replacing previous component." << std::endl;
|
||||
it = mConfigs.erase(it);
|
||||
}
|
||||
else
|
||||
++it;
|
||||
|
||||
conf->setFilename(filename);
|
||||
conf->setFilename(filename);// (cyril) this is quite terrible. The constructor of pqiConfig should take the filename as parameter and hold the information.
|
||||
mConfigs.push_back(conf);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,13 +106,12 @@ void setHash(const RsFileHash& h);
|
|||
|
||||
RsMutex cfgMtx;
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* This sets the name of the pqi configuation file
|
||||
*/
|
||||
void setFilename(const std::string& name);
|
||||
|
||||
private:
|
||||
/**
|
||||
* @param an index for the Confind which contains list of configuarations that can be tracked
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue