summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterabout.cpp
diff options
context:
space:
mode:
authorHoward Stearns <howard.stearns@gmail.com>2021-12-22 09:06:34 -0800
committerHoward Stearns <howard.stearns@gmail.com>2022-01-06 15:43:05 -0800
commitcac54c8760789a7b806c67c35e27037546f75181 (patch)
tree18d7e7fc9bfa99a288197695fcd67d385641cfbb /indra/newview/llfloaterabout.cpp
parent0a873cd95547f003878c6d00d0883ff792f4a865 (diff)
SL-13297 - Create LLLicenseInfo and use it in LLAppViewer::getViewerInfo and LLFloaterAbout::postBuild.
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();