MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getVerboseAddOnsInfo

Method getVerboseAddOnsInfo

src/App/ProgramInformation.cpp:338–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338void ProgramInformation::getVerboseAddOnsInfo(
339 std::stringstream& str,
340 const std::map<std::string, std::string>& mConfig)
341{
342 // Add installed module information:
343 const auto modDir = fs::path(Application::getUserAppDataDir()) / "Mod";
344 std::vector<std::string> addons;
345 if (fs::exists(modDir) && fs::is_directory(modDir)) {
346 for (const auto& mod : fs::directory_iterator(modDir)) {
347 if (!fs::is_directory(mod)) {
348 continue; // Ignore files, only show directories
349 }
350 auto dirName = mod.path().string();
351 auto moduleInfo = getModuleInfoString(dirName);
352 if (!moduleInfo.empty()) {
353 addons.push_back(std::move(moduleInfo));
354 }
355 }
356 }
357 const auto additionalModules = getValueOrEmpty(mConfig, "AdditionalModulePaths");
358
359 if (!additionalModules.empty()) {
360 boost::char_separator<char> sep(";");
361 boost::tokenizer<boost::char_separator<char>> mods(additionalModules, sep);
362 for (const auto& mod : mods) {
363 auto moduleInfo = getModuleInfoString(mod);
364 if (!moduleInfo.empty()) {
365 addons.push_back(std::move(moduleInfo));
366 }
367 }
368 }
369
370 std::sort(addons.begin(), addons.end());
371 if (!addons.empty()) {
372 str << "Installed mods:\n";
373 for (const auto& addon : addons) {
374 str << addon;
375 }
376 }
377}

Callers

nothing calls this directly

Calls 8

getModuleInfoStringFunction · 0.85
pathMethod · 0.80
moveFunction · 0.50
stringMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected