fix: About version label and disable stale QML disk cache (1.0.5 pkgrel 7)

Replace QString.arg() with string concatenation in AboutDialog. Disable QML
disk cache so flatpak updates do not keep old compiled QML after qrc changes.
Move setApplicationVersion after QApplication construction.
This commit is contained in:
Sebastian Palencsar
2026-06-22 17:28:25 +02:00
parent 2224307056
commit 818efc099e
3 changed files with 17 additions and 4 deletions

View File

@@ -22,13 +22,13 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QApplication::setApplicationName(QStringLiteral("BearWave"));
QApplication::setDesktopFileName(QStringLiteral("de.nerdbear.bearwave"));
QApplication::setOrganizationName(QStringLiteral("BearWave"));
QApplication::setApplicationVersion(QStringLiteral(BEARWAVE_VERSION));
QApplication app(argc, argv);
QDBusConnection sessionBus = QDBusConnection::sessionBus();
if (sessionBus.isConnected() && sessionBus.interface() && sessionBus.interface()->isServiceRegistered(QStringLiteral("org.mpris.MediaPlayer2.bearwave"))) {
QDBusMessage call = QDBusMessage::createMethodCall(
@@ -49,6 +49,9 @@ int main(int argc, char *argv[])
app.installTranslator(&appTranslator);
}
// QML disk cache can retain stale bytecode across app updates (same qrc paths).
qputenv("QML_DISABLE_DISK_CACHE", "1");
QQmlApplicationEngine engine;
engine.addImportPath(QStringLiteral("qrc:/qml"));

View File

@@ -14,6 +14,16 @@ Dialog {
property string appVersion: Qt.application.version
property string buildId: "?"
readonly property string versionLine: {
var version = root.appVersion
if (version === undefined || version === null || version === "")
version = Qt.application.version
var build = root.buildId
if (build === undefined || build === null || build === "")
build = "?"
return qsTr("Version") + " " + String(version) + " · " + qsTr("build") + " " + String(build)
}
modal: true
anchors.centerIn: parent
width: compactMode ? 360 : 520
@@ -55,7 +65,7 @@ Dialog {
Label {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Version %1 · build %2").arg(root.appVersion).arg(root.buildId)
text: root.versionLine
color: BearTheme.textMuted
font.pixelSize: 12
}