mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-17 10:31:05 -04:00
added new individual config saving system
global signature file format will be converted git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3514 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
831c73dd9d
commit
52e0d2a095
9 changed files with 830 additions and 24 deletions
|
@ -150,6 +150,8 @@ void setHash(std::string h);
|
|||
|
||||
RsMutex cfgMtx;
|
||||
|
||||
static bool globalConfigType;
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
|
@ -168,10 +170,13 @@ void setHash(std::string h);
|
|||
std::string filename;
|
||||
std::string hash;
|
||||
|
||||
|
||||
friend class p3ConfigMgr;
|
||||
/* so it can access:
|
||||
* setFilename() and HasConfigChanged()
|
||||
*/
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -223,8 +228,45 @@ class p3ConfigMgr
|
|||
*/
|
||||
void completeConfiguration();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* this checks for the global config file and signature and determines class's mode of operation
|
||||
* @return global file rs-v0.#.cfg and rs-v0.#.sgn are present
|
||||
* @deprecated
|
||||
*/
|
||||
bool checkForGlobalSigConfig();
|
||||
|
||||
/**
|
||||
* removes theoldconfiguration type
|
||||
* @deprecated
|
||||
*/
|
||||
void removeOldConfigType();
|
||||
|
||||
/**
|
||||
* to save old style global-signature configuration files
|
||||
* @deprecated
|
||||
*/
|
||||
void globalSaveConfig();
|
||||
|
||||
/**
|
||||
* to load up old style global-signature config files
|
||||
* @deprecated
|
||||
*/
|
||||
void globalLoadConfig();
|
||||
|
||||
/**
|
||||
* saves configuration of pqiconfigs in object configs
|
||||
*/
|
||||
void saveConfig();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void loadConfig();
|
||||
|
||||
/**
|
||||
* checks if signature and configuration file's signature matches
|
||||
* @return false if signature file does not match configuration file's signature
|
||||
|
@ -251,10 +293,13 @@ const std::string metasigfname;
|
|||
|
||||
RsMutex cfgMtx; /* below is protected */
|
||||
|
||||
bool oldConfigType;
|
||||
bool mConfigSaveActive;
|
||||
std::map<uint32_t, pqiConfig *> configs;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***************************************************************************************************/
|
||||
|
||||
|
||||
|
@ -272,6 +317,7 @@ class p3Config: public pqiConfig
|
|||
virtual bool loadConfiguration(std::string &loadHash);
|
||||
virtual bool saveConfiguration();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
/* Key Functions to be overloaded for Full Configuration */
|
||||
|
@ -311,6 +357,13 @@ bool backedUpFileSave(const std::string& fname, const std::string& fname_backup,
|
|||
*/
|
||||
bool getHashAttempt(const std::string& loadHash, std::string& hashstr, const std::string& fname, std::list<RsItem *>& load);
|
||||
|
||||
bool loadConfig();
|
||||
bool saveConfig();
|
||||
|
||||
bool loadGlobalConfig(std::string& hash);
|
||||
bool saveGlobalConfig();
|
||||
|
||||
bool loadAttempt(const std::string&,const std::string&, std::list<RsItem *>& load);
|
||||
|
||||
}; /* end of p3Config */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue