GUI: system information: include more environment variables

This commit is contained in:
Moritz Bunkus 2021-03-03 11:15:17 +01:00
parent 039533e756
commit 5dfa723d15
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85

View File

@ -114,6 +114,18 @@ gatherScreenInfo(QStringList &info) {
#endif #endif
} }
void
gatherEnvironmentVariables(QStringList &info) {
info << Q("") << Q("## Environment variables") << Q("");
auto keys = QStringList{} << Q("QT_AUTO_SCREEN_SCALE_FACTOR") << Q("QT_SCALE_FACTOR") << Q("QT_SCREEN_SCALE_FACTORS") << Q("QT_DEVICE_PIXEL_RATIO")
<< Q("MTX_LOGGER") << Q("MTX_DEBUG") << Q("MKVTOOLNIX_DEBUG") << Q("MKVMERGE_DEBUG");
keys.sort();
for (auto const &name : keys)
info << Q("* `%1=%2`").arg(name).arg(Q(mtx::sys::get_environment_variable(to_utf8(name))));
}
void void
gatherQtInfo(QStringList &info) { gatherQtInfo(QStringList &info) {
info << Q("") << Q("# Qt") << Q(""); info << Q("") << Q("# Qt") << Q("");
@ -129,11 +141,6 @@ gatherQtInfo(QStringList &info) {
info << Q("* Compiler: unknown"); info << Q("* Compiler: unknown");
#endif #endif
info << Q("") << Q("## Environment variables") << Q("");
auto keys = QStringList{} << Q("QT_AUTO_SCREEN_SCALE_FACTOR") << Q("QT_SCALE_FACTOR") << Q("QT_SCREEN_SCALE_FACTORS") << Q("QT_DEVICE_PIXEL_RATIO");
for (auto const &name : keys)
info << Q("* `%1=%2`").arg(name).arg(Q(mtx::sys::get_environment_variable(to_utf8(name))));
} }
} // anonymous namespace } // anonymous namespace
@ -148,6 +155,8 @@ gatherSystemInformation() {
gatherOperatingSystemInfo(info); gatherOperatingSystemInfo(info);
gatherScreenInfo(info); gatherScreenInfo(info);
gatherEnvironmentVariables(info);
gatherQtInfo(info); gatherQtInfo(info);
return info.join(Q("\n")); return info.join(Q("\n"));