Gui: show cpu architecture in version info instead of word size

Fix #15833
This commit is contained in:
Adrian Insaurralde Avalos
2024-10-28 11:06:25 -03:00
committed by Chris Hennes
parent a65d05c6e4
commit 9ab3bef651
2 changed files with 25 additions and 14 deletions

View File

@@ -45,7 +45,7 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<property name="sizeHint">
<size>
<width>430</width>
<height>17</height>
@@ -74,7 +74,7 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<property name="sizeHint">
<size>
<width>31</width>
<height>20</height>
@@ -97,7 +97,7 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<property name="sizeHint">
<size>
<width>31</width>
<height>20</height>
@@ -172,14 +172,14 @@
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelPlatform">
<widget class="QLabel" name="labelArchitecture">
<property name="text">
<string>Word size</string>
<string>Architecture</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="labelBuildPlatform">
<widget class="QLabel" name="labelBuildRunArchitecture">
<property name="text">
<string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style="font-weight:600;"&gt;Unknown&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@@ -231,7 +231,7 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
@@ -246,7 +246,7 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<property name="sizeHint">
<size>
<width>430</width>
<height>17</height>
@@ -371,7 +371,7 @@ p, li { white-space: pre-wrap; }
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<property name="sizeHint">
<size>
<width>160</width>
<height>31</height>

View File

@@ -410,10 +410,17 @@ void AboutDialog::setupLabels()
os.replace(QString::fromLatin1("Unknown"), prettyProductInfoWrapper());
ui->labelBuildOS->setText(os);
QString platform = ui->labelBuildPlatform->text();
platform.replace(QString::fromLatin1("Unknown"),
QString::fromLatin1("%1-bit").arg(QSysInfo::WordSize));
ui->labelBuildPlatform->setText(platform);
QString architecture = ui->labelBuildRunArchitecture->text();
if (QSysInfo::buildCpuArchitecture() == QSysInfo::currentCpuArchitecture()) {
architecture.replace(QString::fromLatin1("Unknown"), QSysInfo::buildCpuArchitecture());
}
else {
architecture.replace(
QString::fromLatin1("Unknown"),
QString::fromLatin1("%1 (running on: %2)")
.arg(QSysInfo::buildCpuArchitecture(), QSysInfo::currentCpuArchitecture()));
}
ui->labelBuildRunArchitecture->setText(architecture);
// branch name
it = config.find("BuildRevisionBranch");
@@ -665,7 +672,11 @@ void AboutDialog::copyToClipboard()
}
str << "OS: " << prettyProductInfoWrapper() << deskInfo << '\n';
str << "Word size of " << exe << ": " << QSysInfo::WordSize << "-bit\n";
if (QSysInfo::buildCpuArchitecture() == QSysInfo::currentCpuArchitecture()){
str << "Architecture: " << QSysInfo::buildCpuArchitecture() << "\n";
} else {
str << "Architecture: " << QSysInfo::buildCpuArchitecture() << "(running on: " << QSysInfo::currentCpuArchitecture() << ")\n";
}
str << "Version: " << major << "." << minor << "." << point << suffix << "." << build;
char *appimage = getenv("APPIMAGE");
if (appimage)