mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-23 05:19:18 -06:00
Pass information about the operating system to the version reporter script (#1865)
This commit is contained in:
Submodule ext/ghoul updated: e295fd85c5...8d85f42fc3
@@ -180,6 +180,10 @@ void OpenSpaceEngine::initialize() {
|
||||
LTRACE("OpenSpaceEngine::initialize(begin)");
|
||||
|
||||
global::initialize();
|
||||
// Initialize the general capabilities component
|
||||
SysCap.addComponent(
|
||||
std::make_unique<ghoul::systemcapabilities::GeneralCapabilitiesComponent>()
|
||||
);
|
||||
|
||||
_printEvents = global::configuration->isPrintingEvents;
|
||||
|
||||
@@ -403,11 +407,8 @@ void OpenSpaceEngine::initializeGL() {
|
||||
glbinding::Binding::initialize(global::windowDelegate->openGLProcedureAddress);
|
||||
//glbinding::Binding::useCurrentContext();
|
||||
|
||||
LDEBUG("Adding system components");
|
||||
LDEBUG("Adding OpenGL capabilities components");
|
||||
// Detect and log OpenCL and OpenGL versions and available devices
|
||||
SysCap.addComponent(
|
||||
std::make_unique<ghoul::systemcapabilities::GeneralCapabilitiesComponent>()
|
||||
);
|
||||
SysCap.addComponent(
|
||||
std::make_unique<ghoul::systemcapabilities::OpenGLCapabilitiesComponent>()
|
||||
);
|
||||
|
||||
@@ -27,10 +27,12 @@
|
||||
#include <openspace/openspace.h>
|
||||
#include <ghoul/fmt.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/systemcapabilities/systemcapabilities.h>
|
||||
#include <ghoul/systemcapabilities/generalcapabilitiescomponent.h>
|
||||
#include <sstream>
|
||||
|
||||
namespace {
|
||||
constexpr const char* _loggerCat = "VersionChecker";
|
||||
constexpr const char _loggerCat[] = "VersionChecker";
|
||||
} // namespace
|
||||
|
||||
namespace openspace {
|
||||
@@ -40,9 +42,20 @@ VersionChecker::~VersionChecker() {
|
||||
}
|
||||
|
||||
void VersionChecker::requestLatestVersion(const std::string& url) {
|
||||
using GCC = ghoul::systemcapabilities::GeneralCapabilitiesComponent;
|
||||
std::string operatingSystem = SysCap.component<GCC>().operatingSystemString();
|
||||
|
||||
// Need to escape non-http characters when passing the operating system in the url
|
||||
for (size_t i = 0; i < operatingSystem.size(); i++) {
|
||||
if (operatingSystem[i] == ' ') {
|
||||
operatingSystem.erase(i, 1);
|
||||
operatingSystem.insert(i, "%20");
|
||||
}
|
||||
}
|
||||
|
||||
std::string fullUrl = fmt::format(
|
||||
"{}?client_version={}&commit_hash={}",
|
||||
url, OPENSPACE_VERSION_NUMBER, OPENSPACE_GIT_COMMIT
|
||||
"{}?client_version={}&commit_hash={}&operating_system={}",
|
||||
url, OPENSPACE_VERSION_NUMBER, OPENSPACE_GIT_COMMIT, operatingSystem
|
||||
);
|
||||
|
||||
if (_request) {
|
||||
|
||||
Reference in New Issue
Block a user