diff --git a/libssu/libssu.pro b/libssu/libssu.pro index ca5899d..cfb52fc 100644 --- a/libssu/libssu.pro +++ b/libssu/libssu.pro @@ -13,10 +13,7 @@ public_headers = \ HEADERS = \ $${public_headers} \ sandbox_p.h \ - ssucoreconfig.h \ - mobility-booty/qofonoservice_linux_p.h \ - mobility-booty/qsysteminfo_linux_common_p.h \ - mobility-booty/qsysteminfo_dbus_p.h + ssucoreconfig.h SOURCES = \ sandbox.cpp \ @@ -26,15 +23,11 @@ SOURCES = \ ssulog.cpp \ ssuvariables.cpp \ ssurepomanager.cpp \ - ssusettings.cpp \ - mobility-booty/qofonoservice_linux.cpp \ - mobility-booty/qsysteminfo_linux_common.cpp \ + ssusettings.cpp -#CONFIG += mobility link_pkgconfig CONFIG += link_pkgconfig QT += network xml dbus -#MOBILITY += systeminfo -PKGCONFIG += libsystemd-journal boardname +PKGCONFIG += libsystemd-journal boardname Qt5SystemInfo install_headers.files = $${public_headers} diff --git a/libssu/mobility-booty/README b/libssu/mobility-booty/README deleted file mode 100644 index d103891..0000000 --- a/libssu/mobility-booty/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains the handful of bits used from QtSystemInfo, to avoid -pulling in the whole X11 stack. diff --git a/libssu/mobility-booty/qofonoservice_linux.cpp b/libssu/mobility-booty/qofonoservice_linux.cpp deleted file mode 100644 index d42df07..0000000 --- a/libssu/mobility-booty/qofonoservice_linux.cpp +++ /dev/null @@ -1,408 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qofonoservice_linux_p.h" -#include -#include -#include - -#ifndef QT_NO_DBUS - -QDBusArgument &operator<<(QDBusArgument &argument, const QOfonoProperties &property) -{ - argument.beginStructure(); - argument << property.path << property.properties; - argument.endStructure(); - return argument; -} - -const QDBusArgument &operator>>(const QDBusArgument &argument, QOfonoProperties &property) -{ - argument.beginStructure(); - argument >> property.path >> property.properties; - argument.endStructure(); - return argument; -} - -//QTM_BEGIN_NAMESPACE - -#define OFONO_SERVICE "org.ofono" -#define OFONO_MANAGER_INTERFACE "org.ofono.Manager" -#define OFONO_MANAGER_PATH "/" -#define OFONO_MODEM_INTERFACE "org.ofono.Modem" -#define OFONO_NETWORK_REGISTRATION_INTERFACE "org.ofono.NetworkRegistration" -#define OFONO_NETWORK_OPERATOR_INTERFACE "org.ofono.NetworkOperator" -#define OFONO_SIM_MANAGER_INTERFACE "org.ofono.SimManager" -#define OFONO_CONNECTION_MANAGER_INTERFACE "org.ofono.ConnectionManager" - -QOfonoManagerInterface::QOfonoManagerInterface(QObject *parent) - : QDBusAbstractInterface(QLatin1String(OFONO_SERVICE), QLatin1String(OFONO_MANAGER_PATH), - OFONO_MANAGER_INTERFACE, QDBusConnection::systemBus(), parent) -{ - qDBusRegisterMetaType(); - qDBusRegisterMetaType(); -} - -QOfonoManagerInterface::~QOfonoManagerInterface() -{ -} - -QList QOfonoManagerInterface::getModems() -{ - QDBusReply reply = call(QLatin1String("GetModems")); - QList modems; - if (reply.isValid()) { - foreach (const QOfonoProperties &property, reply.value()) - modems << property.path; - } - return modems; -} - -QDBusObjectPath QOfonoManagerInterface::currentModem() -{ - QList modems = getModems(); - foreach (const QDBusObjectPath &modem, modems) { - QOfonoModemInterface device(modem.path()); - if (device.isPowered()) - return modem; - } - return QDBusObjectPath(); -} - -void QOfonoManagerInterface::connectNotify(const char *signal) -{ - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { - QOfonoDBusHelper *helper = new QOfonoDBusHelper(this); - QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), - QLatin1String(OFONO_MANAGER_PATH), - QLatin1String(OFONO_MANAGER_INTERFACE), - QLatin1String("PropertyChanged"), - helper, SLOT(propertyChanged(QString,QDBusVariant))); - connect(helper, SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)), - this,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))); - } -} - -void QOfonoManagerInterface::disconnectNotify(const char */*signal*/) -{ - // TODO: disconnect the DBus signal -} - -QVariant QOfonoManagerInterface::getProperty(const QString &property) -{ - QVariant value; - - if (isValid()) { - QDBusReply reply = call(QLatin1String("GetProperties")); - value = reply.value().value(property); - } - - return value; -} - -QOfonoDBusHelper::QOfonoDBusHelper(QObject *parent) - : QObject(parent) -{ -} - -QOfonoDBusHelper::~QOfonoDBusHelper() -{ -} - -void QOfonoDBusHelper::propertyChanged(const QString &item, const QDBusVariant &value) -{ - QDBusMessage msg = message(); - Q_EMIT propertyChangedContext(msg.path(), item, value); -} - -QOfonoModemInterface::QOfonoModemInterface(const QString &dbusPathName, QObject *parent) - : QDBusAbstractInterface(QLatin1String(OFONO_SERVICE), dbusPathName, - OFONO_MODEM_INTERFACE, QDBusConnection::systemBus(), parent) -{ -} - -QOfonoModemInterface::~QOfonoModemInterface() -{ -} - -bool QOfonoModemInterface::isPowered() -{ - QVariant var = getProperty("Powered"); - return qdbus_cast(var); -} - -QString QOfonoModemInterface::getSerial() -{ - QVariant var = getProperty("Serial"); - return qdbus_cast(var); -} - -QVariant QOfonoModemInterface::getProperty(const QString &property) -{ - QVariant value; - - if (isValid()) { - QDBusReply reply = call(QLatin1String("GetProperties")); - value = reply.value().value(property); - } - - return value; -} - -QOfonoNetworkRegistrationInterface::QOfonoNetworkRegistrationInterface(const QString &dbusPathName, QObject *parent) - : QDBusAbstractInterface(QLatin1String(OFONO_SERVICE), dbusPathName, - OFONO_NETWORK_REGISTRATION_INTERFACE, QDBusConnection::systemBus(), parent) -{ -} - -QOfonoNetworkRegistrationInterface::~QOfonoNetworkRegistrationInterface() -{ -} - -QString QOfonoNetworkRegistrationInterface::getStatus() -{ - QVariant var = getProperty("Status"); - return qdbus_cast(var); -} - -quint16 QOfonoNetworkRegistrationInterface::getLac() -{ - QVariant var = getProperty("LocationAreaCode"); - return qdbus_cast(var); -} - -quint32 QOfonoNetworkRegistrationInterface::getCellId() -{ - QVariant var = getProperty("CellId"); - return qdbus_cast(var); -} - -QString QOfonoNetworkRegistrationInterface::getTechnology() -{ - QVariant var = getProperty("Technology"); - return qdbus_cast(var); -} - -QString QOfonoNetworkRegistrationInterface::getOperatorName() -{ - QVariant var = getProperty("Name"); - return qdbus_cast(var); -} - -int QOfonoNetworkRegistrationInterface::getSignalStrength() -{ - QVariant var = getProperty("Strength"); - return qdbus_cast(var); -} - -QList QOfonoNetworkRegistrationInterface::getOperators() -{ - QDBusReply reply = call(QLatin1String("GetOperators")); - QList operators; - if (reply.isValid()) { - foreach (const QOfonoProperties &property, reply.value()) - operators << property.path; - } - return operators; -} - -void QOfonoNetworkRegistrationInterface::connectNotify(const char *signal) -{ - if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) { - QOfonoDBusHelper *helper = new QOfonoDBusHelper(this); - QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE), - path(), - QLatin1String(OFONO_NETWORK_REGISTRATION_INTERFACE), - QLatin1String("PropertyChanged"), - helper, SLOT(propertyChanged(QString,QDBusVariant))); - connect(helper, SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)), - this,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))); - } -} - -void QOfonoNetworkRegistrationInterface::disconnectNotify(const char */*signal*/) -{ - // TODO: disconnect the signal -} - -QVariant QOfonoNetworkRegistrationInterface::getProperty(const QString &property) -{ - QVariant value; - - if (isValid()) { - QDBusReply reply = call(QLatin1String("GetProperties")); - value = reply.value().value(property); - } - - return value; -} - -QOfonoNetworkOperatorInterface::QOfonoNetworkOperatorInterface(const QString &dbusPathName, QObject *parent) - : QDBusAbstractInterface(QLatin1String(OFONO_SERVICE), dbusPathName, - OFONO_NETWORK_OPERATOR_INTERFACE, QDBusConnection::systemBus(), parent) -{ -} - -QOfonoNetworkOperatorInterface::~QOfonoNetworkOperatorInterface() -{ -} - -QString QOfonoNetworkOperatorInterface::getStatus() -{ - QVariant var = getProperty("Status"); - return qdbus_cast(var); -} - -QString QOfonoNetworkOperatorInterface::getMcc() -{ - QVariant var = getProperty("MobileCountryCode"); - return qdbus_cast(var); -} - -QString QOfonoNetworkOperatorInterface::getMnc() -{ - QVariant var = getProperty("MobileNetworkCode"); - return qdbus_cast(var); -} - -QStringList QOfonoNetworkOperatorInterface::getTechnologies() -{ - QVariant var = getProperty("Technologies"); - return qdbus_cast(var); -} - -QVariant QOfonoNetworkOperatorInterface::getProperty(const QString &property) -{ - QVariant value; - - if (isValid()) { - QDBusReply reply = call(QLatin1String("GetProperties")); - value = reply.value().value(property); - } - - return value; -} - -QOfonoSimInterface::QOfonoSimInterface(const QString &dbusPathName, QObject *parent) - : QDBusAbstractInterface(QLatin1String(OFONO_SERVICE), dbusPathName, - OFONO_SIM_MANAGER_INTERFACE, QDBusConnection::systemBus(), parent) -{ -} - -QOfonoSimInterface::~QOfonoSimInterface() -{ -} - -bool QOfonoSimInterface::isPresent() -{ - QVariant var = getProperty("Present"); - return qdbus_cast(var); -} - -QString QOfonoSimInterface::getHomeMcc() -{ - QVariant var = getProperty("MobileCountryCode"); - return qdbus_cast(var); -} - -QString QOfonoSimInterface::getHomeMnc() -{ - QVariant var = getProperty("MobileNetworkCode"); - return qdbus_cast(var); -} - -QString QOfonoSimInterface::pinRequired() -{ - QVariant var = getProperty("PinRequired"); - return qdbus_cast(var); -} - -QString QOfonoSimInterface::getImsi() -{ - QVariant var = getProperty("SubscriberIdentity"); - return qdbus_cast(var); -} - -QVariant QOfonoSimInterface::getProperty(const QString &property) -{ - QVariant value; - - if (isValid()) { - QDBusReply reply = call(QLatin1String("GetProperties")); - value = reply.value().value(property); - } - - return value; -} - -QOfonoConnectionManagerInterface::QOfonoConnectionManagerInterface(const QString &dbusPathName, QObject *parent) - : QDBusAbstractInterface(QLatin1String(OFONO_SERVICE), dbusPathName, - OFONO_CONNECTION_MANAGER_INTERFACE, QDBusConnection::systemBus(), parent) -{ -} - -QOfonoConnectionManagerInterface::~QOfonoConnectionManagerInterface() -{ -} - -QString QOfonoConnectionManagerInterface::bearer() -{ - QVariant var = getProperty("Bearer"); - return qdbus_cast(var); -} - -QVariant QOfonoConnectionManagerInterface::getProperty(const QString &property) -{ - QVariant value; - - if (isValid()) { - QDBusReply reply = call(QLatin1String("GetProperties")); - value = reply.value().value(property); - } - - return value; -} - -#include "moc_qofonoservice_linux_p.cpp" - -//QTM_END_NAMESPACE - -#endif // QT_NO_DBUS diff --git a/libssu/mobility-booty/qofonoservice_linux_p.h b/libssu/mobility-booty/qofonoservice_linux_p.h deleted file mode 100644 index 34ce477..0000000 --- a/libssu/mobility-booty/qofonoservice_linux_p.h +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QOFONOSERVICE_H -#define QOFONOSERVICE_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -//#include "qmobilityglobal.h" -#include -#include - -struct QOfonoProperties -{ - QDBusObjectPath path; - QVariantMap properties; -}; -Q_DECLARE_METATYPE(QOfonoProperties) - -typedef QList QOfonoPropertyMap; -Q_DECLARE_METATYPE(QOfonoPropertyMap) - -//QTM_BEGIN_NAMESPACE - -class QOfonoManagerInterface : public QDBusAbstractInterface -{ - Q_OBJECT - -public: - QOfonoManagerInterface( QObject *parent = 0); - ~QOfonoManagerInterface(); - - QDBusObjectPath currentModem(); - QList getModems(); - -Q_SIGNALS: - void propertyChangedContext(const QString &path, const QString &item, const QDBusVariant &value); - -protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); - -private: - QVariant getProperty(const QString &property); -}; - -class QOfonoDBusHelper: public QObject, protected QDBusContext -{ - Q_OBJECT - -public: - QOfonoDBusHelper(QObject *parent = 0); - ~QOfonoDBusHelper(); - -public Q_SLOTS: - void propertyChanged(const QString &item, const QDBusVariant &value); - -Q_SIGNALS: - void propertyChangedContext(const QString &path, const QString &item, const QDBusVariant &value); -}; - -class QOfonoModemInterface : public QDBusAbstractInterface -{ - Q_OBJECT - -public: - QOfonoModemInterface(const QString &dbusModemPathName, QObject *parent = 0); - ~QOfonoModemInterface(); - - bool isPowered(); - QString getSerial(); - -private: - QVariant getProperty(const QString &property); -}; - -class QOfonoNetworkRegistrationInterface : public QDBusAbstractInterface -{ - Q_OBJECT - -public: - QOfonoNetworkRegistrationInterface(const QString &dbusModemPathName, QObject *parent = 0); - ~QOfonoNetworkRegistrationInterface(); - - int getSignalStrength(); - QList getOperators(); - QString getOperatorName(); - QString getStatus(); - QString getTechnology(); - quint16 getLac(); - quint32 getCellId(); - -protected: - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); - -private: - QVariant getProperty(const QString &property); - -Q_SIGNALS: - void propertyChangedContext(const QString &path, const QString &item, const QDBusVariant &value); -}; - -class QOfonoNetworkOperatorInterface : public QDBusAbstractInterface -{ - Q_OBJECT - -public: - QOfonoNetworkOperatorInterface(const QString &dbusPathName, QObject *parent = 0); - ~QOfonoNetworkOperatorInterface(); - - QString getMcc(); - QString getMnc(); - QString getStatus(); - QStringList getTechnologies(); - -private: - QVariant getProperty(const QString &property); -}; - -class QOfonoSimInterface : public QDBusAbstractInterface -{ - Q_OBJECT - -public: - QOfonoSimInterface(const QString &dbusModemPathName, QObject *parent = 0); - ~QOfonoSimInterface(); - - bool isPresent(); - QString getHomeMcc(); - QString getHomeMnc(); - QString getImsi(); - QString pinRequired(); - -private: - QVariant getProperty(const QString &property); -}; - -class QOfonoConnectionManagerInterface : public QDBusAbstractInterface -{ - Q_OBJECT - -public: - QOfonoConnectionManagerInterface(const QString &dbusPathName, QObject *parent = 0); - ~QOfonoConnectionManagerInterface(); - - QString bearer(); - -private: - QVariant getProperty(const QString &); -}; - -//QTM_END_NAMESPACE - -#endif //QOFONOSERVICE_H diff --git a/libssu/mobility-booty/qsysteminfo_dbus_p.h b/libssu/mobility-booty/qsysteminfo_dbus_p.h deleted file mode 100644 index 8923728..0000000 --- a/libssu/mobility-booty/qsysteminfo_dbus_p.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSYSTEMINFO_DBUS_P_H -#define QSYSTEMINFO_DBUS_P_H - -static bool ofonoAvailable() -{ - if (QDBusConnection::systemBus().isConnected()) { - QDBusReply reply = QDBusConnection::systemBus().interface()->isServiceRegistered("org.ofono"); - if (reply.isValid() && reply.value()) - return reply.value(); - } - return false; -} - -#endif // QSYSTEMINFO_DBUS_P_H diff --git a/libssu/mobility-booty/qsysteminfo_linux_common.cpp b/libssu/mobility-booty/qsysteminfo_linux_common.cpp deleted file mode 100644 index e47d77c..0000000 --- a/libssu/mobility-booty/qsysteminfo_linux_common.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qsysteminfo_linux_common_p.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include "qofonoservice_linux_p.h" -#include "qsysteminfo_dbus_p.h" - -//QTM_BEGIN_NAMESPACE - -QSystemDeviceInfoLinuxCommonPrivate::QSystemDeviceInfoLinuxCommonPrivate(QObject *parent) - : QObject(parent) -{ - -} - -QSystemDeviceInfoLinuxCommonPrivate::~QSystemDeviceInfoLinuxCommonPrivate() -{ -} - -QString QSystemDeviceInfoLinuxCommonPrivate::imei() -{ -#if !defined(QT_NO_CONNMAN) - if (ofonoAvailable()) { - QOfonoManagerInterface ofonoManager; - QString modem = ofonoManager.currentModem().path(); - if (!modem.isEmpty()) { - QOfonoModemInterface modemIface(modem,this); - QString imei = modemIface.getSerial(); - if (!imei.isEmpty()) - return imei; - } - } -#endif // QT_NO_CONNMAN - - return QString(); -} - -QString QSystemDeviceInfoLinuxCommonPrivate::manufacturer() -{ - QFile vendorId("/sys/devices/virtual/dmi/id/board_vendor"); - if (vendorId.open(QIODevice::ReadOnly)) { - QTextStream cpuinfo(&vendorId); - return cpuinfo.readLine().trimmed(); - } else { - QFile file("/proc/cpuinfo"); - if (!file.open(QIODevice::ReadOnly)) { - qDebug() << "Could not open /proc/cpuinfo"; - } else { - QTextStream cpuinfo(&file); - QString line = cpuinfo.readLine(); - while (!line.isNull()) { - line = cpuinfo.readLine(); - if (line.contains("vendor_id")) - return line.split(": ").at(1).trimmed(); - } - } - } - - return QString(); -} - -QByteArray QSystemDeviceInfoLinuxCommonPrivate::uniqueDeviceID() -{ - QCryptographicHash hash(QCryptographicHash::Sha1); - - // Return the DBUS machine ID - QByteArray dbusId = QDBusConnection::localMachineId(); - hash.addData(dbusId); - - return hash.result().toHex(); -} - - -//#include "moc_qsysteminfo_linux_common_p.cpp" - -//QTM_END_NAMESPACE diff --git a/libssu/mobility-booty/qsysteminfo_linux_common_p.h b/libssu/mobility-booty/qsysteminfo_linux_common_p.h deleted file mode 100644 index 11d3368..0000000 --- a/libssu/mobility-booty/qsysteminfo_linux_common_p.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSYSTEMINFO_LINUX_COMMON_P_H -#define QSYSTEMINFO_LINUX_COMMON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -/* -#include "qsysteminfo.h" -#include "qsystemdeviceinfo.h" -*/ - -#include "qofonoservice_linux_p.h" - -//QTM_BEGIN_NAMESPACE - -class QSystemDeviceInfoLinuxCommonPrivate : public QObject -{ - Q_OBJECT - -public: - QSystemDeviceInfoLinuxCommonPrivate(QObject *parent = 0); - virtual ~QSystemDeviceInfoLinuxCommonPrivate(); - - QByteArray uniqueDeviceID(); //1.2 - QString imei(); - QString manufacturer(); -}; - - -//QTM_END_NAMESPACE - -#endif // QSYSTEMINFO_LINUX_COMMON_P_H diff --git a/libssu/ssudeviceinfo.cpp b/libssu/ssudeviceinfo.cpp index bbd7354..e11f565 100644 --- a/libssu/ssudeviceinfo.cpp +++ b/libssu/ssudeviceinfo.cpp @@ -22,10 +22,7 @@ extern "C" { #include "../constants.h" -#include "mobility-booty/qsysteminfo_linux_common_p.h" - -//#include -//QTM_USE_NAMESPACE +#include SsuDeviceInfo::SsuDeviceInfo(QString model): QObject(){ @@ -285,10 +282,10 @@ QString SsuDeviceInfo::deviceModel(){ QString SsuDeviceInfo::deviceUid(){ QString IMEI; - //QSystemDeviceInfo devInfo; - QSystemDeviceInfoLinuxCommonPrivate devInfo; + QDeviceInfo devInfo; - IMEI = devInfo.imei(); + /// @todo properly check number of imeis, ... + IMEI = devInfo.imei(0); // this might not be completely unique (or might change on reflash), but works for now if (IMEI == ""){ diff --git a/rpm/ssu.spec b/rpm/ssu.spec index 408757f..db43aaa 100644 --- a/rpm/ssu.spec +++ b/rpm/ssu.spec @@ -12,6 +12,7 @@ BuildRequires: pkgconfig(Qt5DBus) BuildRequires: pkgconfig(Qt5Network) BuildRequires: pkgconfig(Qt5Xml) BuildRequires: pkgconfig(Qt5Test) +BuildRequires: pkgconfig(Qt5SystemInfo) BuildRequires: pkgconfig(libzypp) BuildRequires: pkgconfig(libsystemd-journal) BuildRequires: oneshot