diff --git a/libraries/platform/src/AndroidPlatform.cpp b/libraries/platform/src/AndroidPlatform.cpp index e998f6f938..58274df9f5 100644 --- a/libraries/platform/src/AndroidPlatform.cpp +++ b/libraries/platform/src/AndroidPlatform.cpp @@ -15,19 +15,19 @@ using namespace platform; void AndroidInstance::enumerateCpu() { json cpu; - cpu["cpuBrand"] = ""; - cpu["cpuModel"] = ""; - cpu["cpuClockSpeed"] = ""; - cpu["cpuNumCores"] = ""; + cpu[jsonKeys::cpuBrand] = ""; + cpu[jsonKeys::cpuModel] = ""; + cpu[jsonKeys::cpuClockSpeed] = ""; + cpu[jsonKeys::cpuNumCores] = ""; _cpu.push_back(cpu); } void AndroidInstance::enumerateGpu() { GPUIdent* ident = GPUIdent::getInstance(); json gpu = {}; - gpu["gpuName"] = ident->getName().toUtf8().constData(); - gpu["gpuMemory"] = ident->getMemory(); - gpu["gpuDriver"] = ident->getDriver().toUtf8().constData(); + gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); + gpu[jsonKeys::gpuMemory] = ident->getMemory(); + gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); _gpu.push_back(gpu); _display = ident->getOutput(); @@ -35,6 +35,6 @@ void AndroidInstance::enumerateGpu() { void AndroidInstance::enumerateMemory() { json ram = {}; - + ram[jsonKeys::totalMemory]=""; _memory.push_back(ram); } diff --git a/libraries/platform/src/LinuxPlatform.cpp b/libraries/platform/src/LinuxPlatform.cpp index 96c105826f..b22344e728 100644 --- a/libraries/platform/src/LinuxPlatform.cpp +++ b/libraries/platform/src/LinuxPlatform.cpp @@ -15,10 +15,10 @@ using namespace platform; void LinuxInstance::enumerateCpu() { json cpu = {}; - cpu["cpuBrand"] = ""; - cpu["cpuModel"] = ""; - cpu["cpuClockSpeed"] = ""; - cpu["cpuNumCores"] = ""; + cpu[jsonKeys::cpuBrand] = ""; + cpu[jsonKeys::cpuModel] = ""; + cpu[jsonKeys::cpuClockSpeed] = ""; + cpu[jsonKeys::cpuNumCores] = ""; _cpu.push_back(cpu); } @@ -26,9 +26,9 @@ void LinuxInstance::enumerateCpu() { void LinuxInstance::enumerateGpu() { GPUIdent* ident = GPUIdent::getInstance(); json gpu = {}; - gpu["gpuName"] = ident->getName().toUtf8().constData(); - gpu["gpuMemory"] = ident->getMemory(); - gpu["gpuDriver"] = ident->getDriver().toUtf8().constData(); + gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); + gpu[jsonKeys::gpuMemory] = ident->getMemory(); + gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); _gpu.push_back(gpu); _display = ident->getOutput(); @@ -36,7 +36,7 @@ void LinuxInstance::enumerateGpu() { void LinuxInstance::enumerateMemory() { json ram = {}; - + ram[jsonKeys::totalMemory]=""; _memory.push_back(ram); } diff --git a/libraries/platform/src/MACOSPlatform.cpp b/libraries/platform/src/MACOSPlatform.cpp index 172cd642aa..a215f46335 100644 --- a/libraries/platform/src/MACOSPlatform.cpp +++ b/libraries/platform/src/MACOSPlatform.cpp @@ -55,10 +55,10 @@ void MACOSInstance::enumerateCpu() { } } - cpu["cpuBrand"] = CPUBrandString; - cpu["cpuModel"] = CPUModelString; - cpu["cpuClockSpeed"] = CPUClockString; - cpu["cpuNumCores"] = std::thread::hardware_concurrency(); + cpu[jsonKeys::cpuBrand] = CPUBrandString; + cpu[jsonKeys::cpuModel] = CPUModelString; + cpu[jsonKeys::cpuClockSpeed] = CPUClockString; + cpu[jsonKeys::cpuNumCores] = std::thread::hardware_concurrency(); _cpu.push_back(cpu); } @@ -66,9 +66,9 @@ void MACOSInstance::enumerateCpu() { void MACOSInstance::enumerateGpu() { GPUIdent* ident = GPUIdent::getInstance(); json gpu = {}; - gpu["gpuName"] = ident->getName().toUtf8().constData(); - gpu["gpuMemory"] = ident->getMemory(); - gpu["gpuDriver"] = ident->getDriver().toUtf8().constData(); + gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); + gpu[jsonKeys::gpuMemory] = ident->getMemory(); + gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); _gpu.push_back(gpu); _display = ident->getOutput(); @@ -80,7 +80,7 @@ void MACOSInstance::enumerateMemory() { #ifdef Q_OS_MAC long pages = sysconf(_SC_PHYS_PAGES); long page_size = sysconf(_SC_PAGE_SIZE); - ram["totalMemory"] = pages * page_size;; + ram[jsonKeys::totalMemory] = pages * page_size;; #endif _memory.push_back(ram); } diff --git a/libraries/platform/src/WINPlatform.cpp b/libraries/platform/src/WINPlatform.cpp index 601a9d7290..f1ed146c93 100644 --- a/libraries/platform/src/WINPlatform.cpp +++ b/libraries/platform/src/WINPlatform.cpp @@ -46,10 +46,10 @@ void WINInstance::enumerateCpu() { } } - cpu["cpuBrand"] = CPUBrandString; - cpu["cpuModel"] = CPUModelString; - cpu["cpuClockSpeed"] = CPUClockString; - cpu["cpuNumCores"] = std::thread::hardware_concurrency(); + cpu[platform::json::cpuBrand] = CPUBrandString; + cpu[jsonKeys::cpuModel] = CPUModelString; + cpu[jsonKeys::cpuClockSpeed] = CPUClockString; + cpu[jsonKeys::cpuNumCores] = std::thread::hardware_concurrency(); #endif _cpu.push_back(cpu); @@ -60,9 +60,9 @@ void WINInstance::enumerateGpu() { GPUIdent* ident = GPUIdent::getInstance(); json gpu = {}; - gpu["gpuName"] = ident->getName().toUtf8().constData(); - gpu["gpuMemory"] = ident->getMemory(); - gpu["gpuDriver"] = ident->getDriver().toUtf8().constData(); + gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); + gpu[jsonKeys::gpuMemory] = ident->getMemory(); + gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); _gpu.push_back(gpu); _display = ident->getOutput(); diff --git a/libraries/platform/src/platformJsonKeys.h b/libraries/platform/src/platformJsonKeys.h index 633add2b7e..cc2832a584 100644 --- a/libraries/platform/src/platformJsonKeys.h +++ b/libraries/platform/src/platformJsonKeys.h @@ -11,22 +11,20 @@ namespace platform { namespace jsonKeys{ -#if 0 - static const char* cpuBrand { "cpuBrand"}; - static const char* cpuModel {"cpuModel"}; - static const char* cpuClockSpeed {"clockSpeed"}; - static const char* cpuNumCores { "numCores"}; - static const char* gpuName {"GpuName"}; - static const char* gpuMemory {"gpuMemory"}; - static const char* gpuDriver {"gpuDriver"}; - static const char* totalMemory {"totalMem"}; - static const char* displayDescription { "description"}; - static const char* displayName {"deviceName"}; - static const char* displayCoordsLeft {"coordinatesleft"}; - static const char* displayCoordsRight { "coordinatesright"}; - static const char* displayCoordsTop { "coordinatestop"}; - static const char* displayCoordsBottom { "coordinatesbottom"}; -#endif + const char* cpuBrand { "cpuBrand"}; + const char* cpuModel {"cpuModel"}; + const char* cpuClockSpeed {"clockSpeed"}; + const char* cpuNumCores { "numCores"}; + const char* gpuName {"GpuName"}; + const char* gpuMemory {"gpuMemory"}; + const char* gpuDriver {"gpuDriver"}; + const char* totalMemory {"totalMem"}; + const char* displayDescription { "description"}; + const char* displayName {"deviceName"}; + const char* displayCoordsLeft {"coordinatesleft"}; + const char* displayCoordsRight { "coordinatesright"}; + const char* displayCoordsTop { "coordinatestop"}; + const char* displayCoordsBottom { "coordinatesbottom"}; } } // namespace platform