Commit c61659d8 authored by martinjones's avatar martinjones

Merge branch 'jb35322' into 'master'

[nemo-qml-plugin-systemsettings] Read vendor data info. Contributes to JB#35322



See merge request !11
parents 88e161dd 35740e47
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <QMap> #include <QMap>
#include <QTextStream> #include <QTextStream>
#include <QVariant> #include <QVariant>
#include <QSettings>
#include <mntent.h> #include <mntent.h>
...@@ -186,6 +187,10 @@ AboutSettings::AboutSettings(QObject *parent) ...@@ -186,6 +187,10 @@ AboutSettings::AboutSettings(QObject *parent)
: QObject(parent), m_sysinfo(new QStorageInfo(this)), m_netinfo(new QNetworkInfo(this)), : QObject(parent), m_sysinfo(new QStorageInfo(this)), m_netinfo(new QNetworkInfo(this)),
m_devinfo(new QDeviceInfo(this)) m_devinfo(new QDeviceInfo(this))
{ {
QSettings settings(QStringLiteral("/mnt/vendor_data/vendor-data.ini"), QSettings::IniFormat);
m_vendorName = settings.value(QStringLiteral("Name")).toString();
m_vendorVersion = settings.value(QStringLiteral("Version")).toString();
refreshStorageModels(); refreshStorageModels();
} }
...@@ -265,6 +270,16 @@ QString AboutSettings::adaptationVersion() const ...@@ -265,6 +270,16 @@ QString AboutSettings::adaptationVersion() const
return m_hardwareRelease["VERSION_ID"]; return m_hardwareRelease["VERSION_ID"];
} }
QString AboutSettings::vendorName() const
{
return m_vendorName;
}
QString AboutSettings::vendorVersion() const
{
return m_vendorVersion;
}
void AboutSettings::refreshStorageModels() void AboutSettings::refreshStorageModels()
{ {
// Optional mountpoints that we want to report disk usage for // Optional mountpoints that we want to report disk usage for
......
...@@ -49,6 +49,8 @@ class AboutSettings: public QObject ...@@ -49,6 +49,8 @@ class AboutSettings: public QObject
Q_PROPERTY(QString softwareVersion READ softwareVersion CONSTANT) Q_PROPERTY(QString softwareVersion READ softwareVersion CONSTANT)
Q_PROPERTY(QString softwareVersionId READ softwareVersionId CONSTANT) Q_PROPERTY(QString softwareVersionId READ softwareVersionId CONSTANT)
Q_PROPERTY(QString adaptationVersion READ adaptationVersion CONSTANT) Q_PROPERTY(QString adaptationVersion READ adaptationVersion CONSTANT)
Q_PROPERTY(QString vendorName READ vendorName CONSTANT)
Q_PROPERTY(QString vendorVersion READ vendorVersion CONSTANT)
Q_PROPERTY(QVariant internalStorageUsageModel READ diskUsageModel NOTIFY storageChanged) Q_PROPERTY(QVariant internalStorageUsageModel READ diskUsageModel NOTIFY storageChanged)
Q_PROPERTY(QVariant externalStorageUsageModel READ externalStorageUsageModel NOTIFY storageChanged) Q_PROPERTY(QVariant externalStorageUsageModel READ externalStorageUsageModel NOTIFY storageChanged)
...@@ -81,6 +83,9 @@ public: ...@@ -81,6 +83,9 @@ public:
QString softwareVersionId() const; QString softwareVersionId() const;
QString adaptationVersion() const; QString adaptationVersion() const;
QString vendorName() const;
QString vendorVersion() const;
signals: signals:
void storageChanged(); void storageChanged();
...@@ -93,6 +98,9 @@ private: ...@@ -93,6 +98,9 @@ private:
QVariantList m_externalStorage; QVariantList m_externalStorage;
mutable QMap<QString, QString> m_osRelease; mutable QMap<QString, QString> m_osRelease;
mutable QMap<QString, QString> m_hardwareRelease; mutable QMap<QString, QString> m_hardwareRelease;
QString m_vendorName;
QString m_vendorVersion;
}; };
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment