summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterabout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterabout.cpp')
-rw-r--r--indra/newview/llfloaterabout.cpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 1fbd198019..60c7a737b2 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -44,6 +44,7 @@
#include "llviewerstats.h"
#include "llviewerregion.h"
#include "llversioninfo.h"
+#include "lllicenseinfo.h"
#include "llweb.h"
// Linden library includes
@@ -178,26 +179,21 @@ BOOL LLFloaterAbout::postBuild()
contrib_names_widget->setEnabled(FALSE);
contrib_names_widget->startOfDoc();
- // Get the Versions and Copyrights, created at build time
- std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt");
- llifstream licenses_file;
- licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */
- if (licenses_file.is_open())
- {
- std::string license_line;
- licenses_widget->clear();
- while ( std::getline(licenses_file, license_line) )
- {
- licenses_widget->appendText(license_line+"\n", FALSE,
- LLStyle::Params() .color(about_color));
- }
- licenses_file.close();
- }
- else
- {
- // this case will use the (out of date) hard coded value from the XUI
- LL_INFOS("AboutInit") << "Could not read licenses file at " << licenses_path << LL_ENDL;
- }
+ auto& license_info(LLLicenseInfo::instance());
+ if (!license_info.empty())
+ {
+ // Although the iteration is fine if empty(), we only want to clear if not empty().
+ // That then uses the (out of date) hard coded value from the XUI.
+ licenses_widget->clear();
+ for (const auto& library : license_info)
+ {
+ const std::string& name = library.first;
+ const LLLicenseInfo::LibraryData& data = library.second;
+ std::string license_line = name + ": " + data.version + "\n" + data.copyrights + "\n\n";
+ licenses_widget->appendText(license_line, FALSE,
+ LLStyle::Params() .color(about_color));
+ }
+ }
licenses_widget->setEnabled(FALSE);
licenses_widget->startOfDoc();