|
webpg-npapi 0.6.1
|
Restores the gpg.conf file from memory or the backup file. Definition at line 406 of file webpgPluginAPI.cpp. References getGPGConfigFilename(). Referenced by gpgDecryptVerify(), gpgGenSubKeyWorker(), and webpgPluginAPI(). {
std::string config_path = getGPGConfigFilename();
std::string tmp_config_path = config_path + "-webpg.save";
std::string restore_string;
std::string result = "gpg config restored from memory";
if (!original_gpg_config.length()) {
// We don't have the original file in memory, lets restore the backup
original_gpg_config = LoadFileAsString(tmp_config_path);
if (!original_gpg_config.length())
return "error restoring gpg_file from disk";
result = "gpg config restored from disk.";
}
std::ofstream gpg_file(config_path.c_str());
if (!gpg_file)
return "error restoring gpg_file from memory";
gpg_file << original_gpg_config;
gpg_file.close();
remove(tmp_config_path.c_str());
original_gpg_config = "";
return result;
}
Here is the call graph for this function:
![]() |
1.7.4