mirror of
https://github.com/spalencsar/bearwave.git
synced 2026-07-06 14:24:14 +02:00
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:
2
PKGBUILD
2
PKGBUILD
@@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Sebastian Palencsar <moin@nerdbear.de>
|
# Maintainer: Sebastian Palencsar <moin@nerdbear.de>
|
||||||
pkgname=bearwave-git
|
pkgname=bearwave-git
|
||||||
pkgver=1.0.5
|
pkgver=1.0.5
|
||||||
pkgrel=5
|
pkgrel=7
|
||||||
pkgdesc="KDE-focused desktop internet radio app"
|
pkgdesc="KDE-focused desktop internet radio app"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url="https://github.com/spalencsar/bearwave"
|
url="https://github.com/spalencsar/bearwave"
|
||||||
|
|||||||
@@ -22,13 +22,13 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
QApplication::setApplicationName(QStringLiteral("BearWave"));
|
QApplication::setApplicationName(QStringLiteral("BearWave"));
|
||||||
QApplication::setDesktopFileName(QStringLiteral("de.nerdbear.bearwave"));
|
QApplication::setDesktopFileName(QStringLiteral("de.nerdbear.bearwave"));
|
||||||
QApplication::setOrganizationName(QStringLiteral("BearWave"));
|
QApplication::setOrganizationName(QStringLiteral("BearWave"));
|
||||||
QApplication::setApplicationVersion(QStringLiteral(BEARWAVE_VERSION));
|
QApplication::setApplicationVersion(QStringLiteral(BEARWAVE_VERSION));
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
|
|
||||||
QDBusConnection sessionBus = QDBusConnection::sessionBus();
|
QDBusConnection sessionBus = QDBusConnection::sessionBus();
|
||||||
if (sessionBus.isConnected() && sessionBus.interface() && sessionBus.interface()->isServiceRegistered(QStringLiteral("org.mpris.MediaPlayer2.bearwave"))) {
|
if (sessionBus.isConnected() && sessionBus.interface() && sessionBus.interface()->isServiceRegistered(QStringLiteral("org.mpris.MediaPlayer2.bearwave"))) {
|
||||||
QDBusMessage call = QDBusMessage::createMethodCall(
|
QDBusMessage call = QDBusMessage::createMethodCall(
|
||||||
@@ -49,6 +49,9 @@ int main(int argc, char *argv[])
|
|||||||
app.installTranslator(&appTranslator);
|
app.installTranslator(&appTranslator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QML disk cache can retain stale bytecode across app updates (same qrc paths).
|
||||||
|
qputenv("QML_DISABLE_DISK_CACHE", "1");
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.addImportPath(QStringLiteral("qrc:/qml"));
|
engine.addImportPath(QStringLiteral("qrc:/qml"));
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,16 @@ Dialog {
|
|||||||
property string appVersion: Qt.application.version
|
property string appVersion: Qt.application.version
|
||||||
property string buildId: "?"
|
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
|
modal: true
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: compactMode ? 360 : 520
|
width: compactMode ? 360 : 520
|
||||||
@@ -55,7 +65,7 @@ Dialog {
|
|||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: qsTr("Version %1 · build %2").arg(root.appVersion).arg(root.buildId)
|
text: root.versionLine
|
||||||
color: BearTheme.textMuted
|
color: BearTheme.textMuted
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user