MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getSystemInformation

Method getSystemInformation

src/App/ProgramInformation.cpp:175–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void ProgramInformation::getSystemInformation(std::stringstream& str)
176{
177 auto sysenv = QProcessEnvironment::systemEnvironment();
178 const QString deskEnv = sysenv.value(QStringLiteral("XDG_CURRENT_DESKTOP"));
179 const QString deskSess = sysenv.value(QStringLiteral("DESKTOP_SESSION"));
180
181 QStringList deskInfoList;
182 QString deskInfo;
183
184 if (!deskEnv.isEmpty()) {
185 deskInfoList.append(deskEnv);
186 }
187 if (!deskSess.isEmpty()) {
188 deskInfoList.append(deskSess);
189 }
190
191 const QString sysType = QSysInfo::productType();
192 if (sysType != QLatin1String("windows") && sysType != QLatin1String("macos")) {
193 QString sessionType = sysenv.value(QStringLiteral("XDG_SESSION_TYPE"));
194 if (sessionType == QLatin1String("x11")) {
195 sessionType = QStringLiteral("xcb");
196 }
197 deskInfoList.append(sessionType);
198 }
199 if (!deskInfoList.isEmpty()) {
200 deskInfo = QLatin1String(" (") + deskInfoList.join(QLatin1String("/")) + QLatin1String(")");
201 }
202
203 str << "OS: " << prettyProductInfoWrapper() << deskInfo << '\n';
204 if (QSysInfo::buildCpuArchitecture() == QSysInfo::currentCpuArchitecture()) {
205 str << "Architecture: " << QSysInfo::buildCpuArchitecture() << "\n";
206 }
207 else {
208 str << "Architecture: " << QSysInfo::buildCpuArchitecture()
209 << "(running on: " << QSysInfo::currentCpuArchitecture() << ")\n";
210 }
211}
212
213void ProgramInformation::getPackageInformation(std::stringstream& str)
214{

Callers

nothing calls this directly

Calls 4

valueMethod · 0.45
isEmptyMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected