diff options
author | Lorn Potter <lorn.potter@jollamobile.com> | 2013-05-09 08:28:37 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-09 07:43:38 +0200 |
commit | fb72a057387d3b6b6a292d33cb7c97a596bbfb2e (patch) | |
tree | 5955cdf10d69e5353651c4c03e8e29bf5f690661 /src/systeminfo/linux/qdeviceinfo_linux.cpp | |
parent | e70d49413c9e01cfad27156c6264e627cec2a919 (diff) |
remove proprietary libsysinfo stuff
Change-Id: Iad21e043c67722244e069d09c08d63db779b5c60
Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'src/systeminfo/linux/qdeviceinfo_linux.cpp')
-rw-r--r-- | src/systeminfo/linux/qdeviceinfo_linux.cpp | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/src/systeminfo/linux/qdeviceinfo_linux.cpp b/src/systeminfo/linux/qdeviceinfo_linux.cpp index 3948418a..204dec82 100644 --- a/src/systeminfo/linux/qdeviceinfo_linux.cpp +++ b/src/systeminfo/linux/qdeviceinfo_linux.cpp @@ -71,9 +71,6 @@ QDeviceInfoPrivate::QDeviceInfoPrivate(QDeviceInfo *parent) #if !defined(QT_NO_OFONO) , ofonoWrapper(0) #endif // QT_NO_OFONO -#if !defined(QT_NO_LIBSYSINFO) - , sc(0) -#endif // QT_NO_LIBSYSINFO { } @@ -236,11 +233,7 @@ int QDeviceInfoPrivate::imeiCount() QString QDeviceInfoPrivate::imei(int interface) { -#if !defined(QT_NO_LIBSYSINFO) - if (imeiBuffer.size() == 0) - imeiBuffer << getSysInfoValue("/certs/npc/esn/gsm"); - -#elif !defined(QT_NO_OFONO) +#if !defined(QT_NO_OFONO) if (QOfonoWrapper::isOfonoAvailable()) { if (!ofonoWrapper) ofonoWrapper = new QOfonoWrapper(this); @@ -262,13 +255,9 @@ QString QDeviceInfoPrivate::imei(int interface) QString QDeviceInfoPrivate::manufacturer() { if (manufacturerBuffer.isEmpty()) { -#if !defined(QT_NO_LIBSYSINFO) - manufacturerBuffer = getSysInfoValue("/component/manufacturer"); -#else QFile file(QStringLiteral("/sys/devices/virtual/dmi/id/sys_vendor")); if (file.open(QIODevice::ReadOnly)) manufacturerBuffer = QString::fromLocal8Bit(file.readAll().simplified().data()); -#endif } return manufacturerBuffer; @@ -287,10 +276,6 @@ QString QDeviceInfoPrivate::model() QString QDeviceInfoPrivate::productName() { -#if !defined(QT_NO_LIBSYSINFO) - if (productNameBuffer.isEmpty()) - productNameBuffer = getSysInfoValue("/component/product"); -#else if (productNameBuffer.isEmpty()) { QProcess lsbRelease; lsbRelease.start(QStringLiteral("/usr/bin/lsb_release"), @@ -300,7 +285,6 @@ QString QDeviceInfoPrivate::productName() productNameBuffer = buffer.section(QChar::fromLatin1('\t'), 1, 1).simplified(); } } -#endif return productNameBuffer; } @@ -466,39 +450,4 @@ QDeviceInfo::ThermalState QDeviceInfoPrivate::getThermalState() return state; } -#if !defined(QT_NO_LIBSYSINFO) -QString QDeviceInfoPrivate::getSysInfoValue(const char *component) -{ - QString value; - bool componentExist = false; - if (sysinfo_init(&sc) == 0) { - char **keys = 0; - if (sysinfo_get_keys(sc, &keys) == 0) { - size_t i; - for (i = 0; keys[i]; ++i) { - if (strcmp(keys[i], component) == 0) { - componentExist = true; - break; - } - } - for (int i = 0; keys[i]; ++i) free(keys[i]); - free(keys); - } - if (componentExist) { - uint8_t *data = 0; - unsigned long size = 0; - if (sysinfo_get_value(sc, component, &data, &size) == 0) { - for (unsigned long k = 0; k < size; ++k) { - char c = data[k]; - if (c >= 32 && c <= 126) - value.append(c); - } - free(data); - } - } - } - sysinfo_finish(sc); - return value; -} -#endif QT_END_NAMESPACE |