Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[aboutsettings] Add property with localized version. Contributes to J…
…B#47664
  • Loading branch information
dseight committed Oct 18, 2019
1 parent 2e04b05 commit fff687f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/aboutsettings.cpp
Expand Up @@ -269,6 +269,14 @@ QString AboutSettings::operatingSystemName() const
return d->osRelease["NAME"];
}

QString AboutSettings::localizedSoftwareVersion() const
{
Q_D(const AboutSettings);
parseLocalizationFile(QStringLiteral("/etc/os-release-l10n"), &d->osReleaseLocalization);

return d->osReleaseLocalization.value("VERSION", softwareVersion());
}

QString AboutSettings::softwareVersion() const
{
Q_D(const AboutSettings);
Expand Down
2 changes: 2 additions & 0 deletions src/aboutsettings.h
Expand Up @@ -50,6 +50,7 @@ class SYSTEMSETTINGS_EXPORT AboutSettings: public QObject
Q_PROPERTY(QString localizedOperatingSystemName READ localizedOperatingSystemName CONSTANT)
Q_PROPERTY(QString baseOperatingSystemName READ baseOperatingSystemName CONSTANT)
Q_PROPERTY(QString operatingSystemName READ operatingSystemName CONSTANT)
Q_PROPERTY(QString localizedSoftwareVersion READ localizedSoftwareVersion CONSTANT)
Q_PROPERTY(QString softwareVersion READ softwareVersion CONSTANT)
Q_PROPERTY(QString softwareVersionId READ softwareVersionId CONSTANT)
Q_PROPERTY(QString adaptationVersion READ adaptationVersion CONSTANT)
Expand Down Expand Up @@ -81,6 +82,7 @@ class SYSTEMSETTINGS_EXPORT AboutSettings: public QObject
QString localizedOperatingSystemName() const;
QString baseOperatingSystemName() const;
QString operatingSystemName() const;
QString localizedSoftwareVersion() const;
QString softwareVersion() const;
QString softwareVersionId() const;
QString adaptationVersion() const;
Expand Down
1 change: 1 addition & 0 deletions src/plugin/plugins.qmltypes
Expand Up @@ -19,6 +19,7 @@ Module {
Property { name: "localizedOperatingSystemName"; type: "string"; isReadonly: true }
Property { name: "baseOperatingSystemName"; type: "string"; isReadonly: true }
Property { name: "operatingSystemName"; type: "string"; isReadonly: true }
Property { name: "localizedSoftwareVersion"; type: "string"; isReadonly: true }
Property { name: "softwareVersion"; type: "string"; isReadonly: true }
Property { name: "softwareVersionId"; type: "string"; isReadonly: true }
Property { name: "adaptationVersion"; type: "string"; isReadonly: true }
Expand Down

0 comments on commit fff687f

Please sign in to comment.