From dbb7817e13bc7f7ccb8f04b00a65eb3dcf8d25f8 Mon Sep 17 00:00:00 2001 From: Louai Al-Khanji Date: Thu, 15 Oct 2015 16:24:54 +0300 Subject: Remove remaining support for Blackberry The platform is no longer supported or actively maintained, and is in the way for improvements to the Unix event dispatcher and QProcess implementations. Change-Id: I3935488ca12e2139ea5f46068d7665a453e20526 Reviewed-by: Lars Knoll --- src/network/bearer/qnetworkconfiguration.cpp | 103 --------------------------- src/network/bearer/qnetworkconfiguration_p.h | 11 --- 2 files changed, 114 deletions(-) (limited to 'src/network/bearer') diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index 6b56d3ec88..b68abce380 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -35,11 +35,6 @@ #include "qnetworkconfiguration_p.h" #include -#ifdef Q_OS_BLACKBERRY -#include "private/qcore_unix_p.h" // qt_safe_open -#include -#endif // Q_OS_BLACKBERRY - QT_BEGIN_NAMESPACE /*! @@ -202,77 +197,6 @@ QT_BEGIN_NAMESPACE \value BearerLTE The configuration is for a LTE (4G) interface. */ -#ifdef Q_OS_BLACKBERRY -static const char cellularStatusFile[] = "/pps/services/radioctrl/modem0/status_public"; - -static QNetworkConfiguration::BearerType cellularStatus() -{ - QNetworkConfiguration::BearerType ret = QNetworkConfiguration::BearerUnknown; - - int cellularStatusFD; - if ((cellularStatusFD = qt_safe_open(cellularStatusFile, O_RDONLY)) == -1) { - qWarning() << Q_FUNC_INFO << "failed to open" << cellularStatusFile; - return ret; - } - char buf[2048]; - if (qt_safe_read(cellularStatusFD, &buf, sizeof(buf)) == -1) { - qWarning() << Q_FUNC_INFO << "read from PPS file failed:" << strerror(errno); - qt_safe_close(cellularStatusFD); - return ret; - } - pps_decoder_t ppsDecoder; - if (pps_decoder_initialize(&ppsDecoder, buf) != PPS_DECODER_OK) { - qWarning() << Q_FUNC_INFO << "failed to initialize PPS decoder"; - qt_safe_close(cellularStatusFD); - return ret; - } - pps_decoder_error_t err; - if ((err = pps_decoder_push(&ppsDecoder, 0)) != PPS_DECODER_OK) { - qWarning() << Q_FUNC_INFO << "pps_decoder_push failed" << err; - pps_decoder_cleanup(&ppsDecoder); - qt_safe_close(cellularStatusFD); - return ret; - } - if (!pps_decoder_is_integer(&ppsDecoder, "network_technology")) { - qWarning() << Q_FUNC_INFO << "field has not the expected data type"; - pps_decoder_cleanup(&ppsDecoder); - qt_safe_close(cellularStatusFD); - return ret; - } - int type; - if (!pps_decoder_get_int(&ppsDecoder, "network_technology", &type) - == PPS_DECODER_OK) { - qWarning() << Q_FUNC_INFO << "could not read bearer type from PPS"; - pps_decoder_cleanup(&ppsDecoder); - qt_safe_close(cellularStatusFD); - return ret; - } - switch (type) { - case 0: // 0 == NONE - break; // unhandled - case 1: // fallthrough, 1 == GSM - case 4: // 4 == CDMA_1X - ret = QNetworkConfiguration::Bearer2G; - break; - case 2: // 2 == UMTS - ret = QNetworkConfiguration::BearerWCDMA; - break; - case 8: // 8 == EVDO - ret = QNetworkConfiguration::BearerEVDO; - break; - case 16: // 16 == LTE - ret = QNetworkConfiguration::BearerLTE; - break; - default: - qWarning() << Q_FUNC_INFO << "unhandled bearer type" << type; - break; - } - pps_decoder_cleanup(&ppsDecoder); - qt_safe_close(cellularStatusFD); - return ret; -} -#endif // Q_OS_BLACKBERRY - /*! Constructs an invalid configuration object. @@ -494,19 +418,6 @@ QNetworkConfiguration::BearerType QNetworkConfiguration::bearerType() const return BearerUnknown; QMutexLocker locker(&d->mutex); - -#ifdef Q_OS_BLACKBERRY - // for cellular configurations, we need to determine the exact - // type right now, because it might have changed after the last scan - if (d->bearerType == QNetworkConfiguration::Bearer2G) { - QNetworkConfiguration::BearerType type = cellularStatus(); - // if reading the status failed for some reason, just - // fall back to 2G - return (type == QNetworkConfiguration::BearerUnknown) - ? QNetworkConfiguration::Bearer2G : type; - } -#endif // Q_OS_BLACKBERRY - return d->bearerType; } @@ -639,20 +550,6 @@ QString QNetworkConfiguration::bearerTypeName() const case BearerWLAN: return QStringLiteral("WLAN"); case Bearer2G: -#ifdef Q_OS_BLACKBERRY - { - // for cellular configurations, we need to determine the exact - // type right now, because it might have changed after the last scan - QNetworkConfiguration::BearerType type = cellularStatus(); - if (type == QNetworkConfiguration::BearerWCDMA) { - return QStringLiteral("WCDMA"); - } else if (type == QNetworkConfiguration::BearerEVDO) { - return QStringLiteral("EVDO"); - }else if (type == QNetworkConfiguration::BearerLTE) { - return QStringLiteral("LTE"); - } - } -#endif // Q_OS_BLACKBERRY return QStringLiteral("2G"); case Bearer3G: return QStringLiteral("3G"); diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h index 75df36fbd9..c8d926e32f 100644 --- a/src/network/bearer/qnetworkconfiguration_p.h +++ b/src/network/bearer/qnetworkconfiguration_p.h @@ -51,10 +51,6 @@ #include #include -#ifdef Q_OS_BLACKBERRY -#include -#endif - QT_BEGIN_NAMESPACE typedef QExplicitlySharedDataPointer QNetworkConfigurationPrivatePointer; @@ -66,9 +62,6 @@ public: type(QNetworkConfiguration::Invalid), purpose(QNetworkConfiguration::UnknownPurpose), bearerType(QNetworkConfiguration::BearerUnknown), -#ifdef Q_OS_BLACKBERRY - oldIpStatus(NETSTATUS_IP_STATUS_ERROR_UNKNOWN), -#endif isValid(false), roamingSupported(false) {} virtual ~QNetworkConfigurationPrivate() @@ -89,10 +82,6 @@ public: QNetworkConfiguration::Purpose purpose; QNetworkConfiguration::BearerType bearerType; -#ifdef Q_OS_BLACKBERRY - netstatus_ip_status_t oldIpStatus; -#endif - bool isValid; bool roamingSupported; -- cgit v1.2.3