Skip to content
Snippets Groups Projects
Commit c3759608 authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

plugins: allow get plugin icon from manifest file

GitLab: jami-plugins#10
Change-Id: Ib18829baec30ec949512c2ce215470771ca0ed70
parent a04ed042
No related branches found
No related tags found
No related merge requests found
......@@ -82,8 +82,9 @@ checkManifestJsonContentValidity(const Json::Value& root)
std::string name = root.get("name", "").asString();
std::string description = root.get("description", "").asString();
std::string version = root.get("version", "").asString();
std::string iconPath = root.get("iconPath", "icon.png").asString();
if (!name.empty() || !version.empty()) {
return {{"name", name}, {"description", description}, {"version", version}};
return {{"name", name}, {"description", description}, {"version", version}, {"iconPath", iconPath}};
} else {
throw std::runtime_error("plugin manifest file: bad format");
}
......@@ -153,7 +154,8 @@ JamiPluginManager::getPluginDetails(const std::string& rootPath)
std::map<std::string, std::string> details = parseManifestFile(manifestPath(rootPath));
if (!details.empty()) {
details["iconPath"] = rootPath + DIR_SEPARATOR_CH + "data" + DIR_SEPARATOR_CH + "icon.png";
auto it = details.find("iconPath");
it->second.insert(0, rootPath + DIR_SEPARATOR_CH + "data" + DIR_SEPARATOR_CH);
details["soPath"] = rootPath + DIR_SEPARATOR_CH + LIB_PREFIX + details["name"] + LIB_TYPE;
detailsIt = pluginDetailsMap_.emplace(rootPath, std::move(details)).first;
return detailsIt->second;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment