Browse Source

improve CPU string + GitLab CI

1.6.x
Syping 3 years ago
parent
commit
541a7d18bd
  1. 9
      .gitlab-ci.yml
  2. 4
      TelemetryClass.cpp

9
.gitlab-ci.yml

@ -1,4 +1,8 @@
stages:
- build
Windows Portable:
stage: build
image: syping/qt5-static-mingw:5.9.6
variables:
BUILD_SCRIPT: "windows_build.sh"
@ -6,11 +10,12 @@ Windows Portable:
script:
- .gitlab/gitlab.sh
artifacts:
name: "gta5view-${CI_COMMIT_SHA:0:8}_portable"
name: "gta5view-{$CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA:0:8}_portable"
paths:
- "gta5view-*.exe"
Windows Installer:
stage: build
image: syping/qt5-shared-mingw:5.9.6
variables:
BUILD_SCRIPT: "wininstall_build.sh"
@ -18,6 +23,6 @@ Windows Installer:
script:
- .gitlab/gitlab.sh
artifacts:
name: "gta5view-${CI_COMMIT_SHA:0:8}_setup"
name: "gta5view-{$CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA:0:8}_setup"
paths:
- "gta5view-*.exe"

4
TelemetryClass.cpp

@ -239,7 +239,7 @@ QJsonDocument TelemetryClass::getSystemHardware()
else if (i == 0x80000003) { memcpy(CPUBrandString + 16, CPUInfo, sizeof(CPUInfo)); }
else if (i == 0x80000004) { memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo)); }
}
jsonObject["CPUName"] = QString(CPUBrandString).trimmed();
jsonObject["CPUName"] = QString::fromLatin1(CPUBrandString).simplified();
SYSTEM_INFO sysInfo;
GetSystemInfo(&sysInfo);
jsonObject["CPUThreads"] = QString::number(sysInfo.dwNumberOfProcessors);
@ -265,7 +265,7 @@ QJsonDocument TelemetryClass::getSystemHardware()
QByteArray cpuData = cpuInfoBuffer.readLine();
if (cpuData.left(toFind.length()) == toFind)
{
jsonObject["CPUName"] = QString::fromUtf8(cpuData).split(':').at(1).trimmed();
jsonObject["CPUName"] = QString::fromUtf8(cpuData).split(':').at(1).simplified();
break;
}
}

Loading…
Cancel
Save