Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Commit 50ce517

Browse files
committed
Merge branch 'omp-jb47664' into 'master'
[aboutsettings] Add property with localized version. Contributes to JB#47664 See merge request mer-core/nemo-qml-plugin-systemsettings!124
2 parents 96af9a6 + fff687f commit 50ce517

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/aboutsettings.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ QString AboutSettings::operatingSystemName() const
269269
return d->osRelease["NAME"];
270270
}
271271

272+
QString AboutSettings::localizedSoftwareVersion() const
273+
{
274+
Q_D(const AboutSettings);
275+
parseLocalizationFile(QStringLiteral("/etc/os-release-l10n"), &d->osReleaseLocalization);
276+
277+
return d->osReleaseLocalization.value("VERSION", softwareVersion());
278+
}
279+
272280
QString AboutSettings::softwareVersion() const
273281
{
274282
Q_D(const AboutSettings);

src/aboutsettings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class SYSTEMSETTINGS_EXPORT AboutSettings: public QObject
5050
Q_PROPERTY(QString localizedOperatingSystemName READ localizedOperatingSystemName CONSTANT)
5151
Q_PROPERTY(QString baseOperatingSystemName READ baseOperatingSystemName CONSTANT)
5252
Q_PROPERTY(QString operatingSystemName READ operatingSystemName CONSTANT)
53+
Q_PROPERTY(QString localizedSoftwareVersion READ localizedSoftwareVersion CONSTANT)
5354
Q_PROPERTY(QString softwareVersion READ softwareVersion CONSTANT)
5455
Q_PROPERTY(QString softwareVersionId READ softwareVersionId CONSTANT)
5556
Q_PROPERTY(QString adaptationVersion READ adaptationVersion CONSTANT)
@@ -81,6 +82,7 @@ class SYSTEMSETTINGS_EXPORT AboutSettings: public QObject
8182
QString localizedOperatingSystemName() const;
8283
QString baseOperatingSystemName() const;
8384
QString operatingSystemName() const;
85+
QString localizedSoftwareVersion() const;
8486
QString softwareVersion() const;
8587
QString softwareVersionId() const;
8688
QString adaptationVersion() const;

src/plugin/plugins.qmltypes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Module {
1919
Property { name: "localizedOperatingSystemName"; type: "string"; isReadonly: true }
2020
Property { name: "baseOperatingSystemName"; type: "string"; isReadonly: true }
2121
Property { name: "operatingSystemName"; type: "string"; isReadonly: true }
22+
Property { name: "localizedSoftwareVersion"; type: "string"; isReadonly: true }
2223
Property { name: "softwareVersion"; type: "string"; isReadonly: true }
2324
Property { name: "softwareVersionId"; type: "string"; isReadonly: true }
2425
Property { name: "adaptationVersion"; type: "string"; isReadonly: true }

0 commit comments

Comments
 (0)