Commit 4d78ad7b authored by Thomas Perl's avatar Thomas Perl

Merge pull request #34 from thp/jb26713

[aboutsettings] Return serial number (Contributes to JB#26713)
parents 63f341a0 336d9ebc
......@@ -151,6 +151,22 @@ QString AboutSettings::imei() const
return m_devinfo->imei(0);
}
QString AboutSettings::serial() const
{
// XXX: For now, this is specific to the Jolla Tablet; eventually we should
// use QDeviceInfo's uniqueDeviceID(), but that does not always return the
// serial number, so this is our best bet for the short term (this will not
// show any serial number on the Phone, there we have the IMEI instead).
QFile serial_txt("/config/serial/serial.txt");
if (serial_txt.exists()) {
serial_txt.open(QIODevice::ReadOnly);
return QString::fromUtf8(serial_txt.readAll());
} else {
return "";
}
}
QString AboutSettings::softwareVersion() const
{
return parseReleaseFile("/etc/os-release")["VERSION"];
......
......@@ -44,6 +44,7 @@ class AboutSettings: public QObject
Q_PROPERTY(QString bluetoothAddress READ bluetoothAddress CONSTANT)
Q_PROPERTY(QString wlanMacAddress READ wlanMacAddress CONSTANT)
Q_PROPERTY(QString imei READ imei CONSTANT)
Q_PROPERTY(QString serial READ serial CONSTANT)
Q_PROPERTY(QString softwareVersion READ softwareVersion CONSTANT)
Q_PROPERTY(QString adaptationVersion READ adaptationVersion CONSTANT)
......@@ -57,6 +58,7 @@ public:
QString bluetoothAddress() const;
QString wlanMacAddress() const;
QString imei() const;
QString serial() const;
QString softwareVersion() const;
QString adaptationVersion() const;
......
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