Commit 2951ccb2 authored by Adrien Béraud's avatar Adrien Béraud

plugins: cleanup

Change-Id: I57ea8db1cf5b2c28e000bc66db41c0b8224f9b7b
parent 3487a68d
......@@ -379,14 +379,14 @@ std::map<std::string, std::string> JamiPluginManager::getPluginUserPreferencesVa
std::map<std::string, std::string> rmap;
// If file is accessible
if(file.good()) {
if (file.good()) {
std::lock_guard<std::mutex> guard(fileutils::getFileLock(preferencesValuesFilePath));
// Get file size
std::string str;
file.seekg(0, std::ios::end);
size_t fileSize = static_cast<size_t>(file.tellg());
// If not empty
if(fileSize > 0) {
if (fileSize > 0) {
// Read whole file content and put it in the string str
str.reserve(static_cast<size_t>(file.tellg()));
file.seekg(0, std::ios::beg);
......@@ -439,17 +439,12 @@ std::map<std::string, std::string> JamiPluginManager::getPluginPreferencesValues
std::map<std::string, std::string> rmap;
std::vector<std::map<std::string,std::string>> preferences = getPluginPreferences(rootPath);
for (int i = 0; i < preferences.size(); i++)
{
rmap[preferences[i]["key"]]=preferences[i]["defaultValue"];
for (size_t i = 0; i < preferences.size(); i++) {
rmap[preferences[i]["key"]] = preferences[i]["defaultValue"];
}
std::map<std::string, std::string> pluginUserPreferencesMap = getPluginUserPreferencesValuesMap(rootPath);
for (const auto& pair : pluginUserPreferencesMap)
{
rmap[pair.first]=pair.second;
for (const auto& pair : getPluginUserPreferencesValuesMap(rootPath)) {
rmap[pair.first] = pair.second;
}
return rmap;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment