From 613bc8eb31d8a80b43aa045ab2040b7cb7e0eadf Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Thu, 29 Jul 2010 16:35:30 +1000 Subject: Rename QNetworkConfiguration::bearerName() function. bearerName() -> bearerTypeName(). bearerName() is deprecated and converted into an inline function which calls bearerTypeName(). This is required to keep existing code source compatible between Qt Mobility 1.0.x and Qt 4.7. Task-number: QTBUG-12378 Reviewed-by: Alex --- examples/network/bearercloud/cloud.cpp | 22 +++++++++++----------- examples/network/bearermonitor/sessionwidget.cpp | 4 ++-- src/network/bearer/qnetworkconfiguration.cpp | 24 ++++++++++++++++-------- src/network/bearer/qnetworkconfiguration.h | 6 +++++- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/examples/network/bearercloud/cloud.cpp b/examples/network/bearercloud/cloud.cpp index 980efbf..f45ae0d 100644 --- a/examples/network/bearercloud/cloud.cpp +++ b/examples/network/bearercloud/cloud.cpp @@ -261,9 +261,9 @@ void Cloud::stateChanged(QNetworkSession::State state) tooltip += tr("
Id: %1").arg(configuration.identifier()); #endif - const QString bearerName = configuration.bearerName(); - if (!bearerName.isEmpty()) - tooltip += tr("
Bearer: %1").arg(bearerName); + const QString bearerTypeName = configuration.bearerTypeName(); + if (!bearerTypeName.isEmpty()) + tooltip += tr("
Bearer: %1").arg(bearerTypeName); QString s = tr("
State: %1 (%2)"); switch (state) { @@ -313,17 +313,17 @@ void Cloud::stateChanged(QNetworkSession::State state) //! [1] void Cloud::newConfigurationActivated() { - const QString bearerName = configuration.bearerName(); - if (!svgCache.contains(bearerName)) { - if (bearerName == QLatin1String("WLAN")) - svgCache.insert(bearerName, new QSvgRenderer(QLatin1String(":wlan.svg"))); - else if (bearerName == QLatin1String("Ethernet")) - svgCache.insert(bearerName, new QSvgRenderer(QLatin1String(":lan.svg"))); + const QString bearerTypeName = configuration.bearerTypeName(); + if (!svgCache.contains(bearerTypeName)) { + if (bearerTypeName == QLatin1String("WLAN")) + svgCache.insert(bearerTypeName, new QSvgRenderer(QLatin1String(":wlan.svg"))); + else if (bearerTypeName == QLatin1String("Ethernet")) + svgCache.insert(bearerTypeName, new QSvgRenderer(QLatin1String(":lan.svg"))); else - svgCache.insert(bearerName, new QSvgRenderer(QLatin1String(":unknown.svg"))); + svgCache.insert(bearerTypeName, new QSvgRenderer(QLatin1String(":unknown.svg"))); } - icon->setSharedRenderer(svgCache[bearerName]); + icon->setSharedRenderer(svgCache[bearerTypeName]); if (configuration.name().isEmpty()) { text->setPlainText(tr("HIDDEN NETWORK")); diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp index 8b5693a..ecc2a93 100644 --- a/examples/network/bearermonitor/sessionwidget.cpp +++ b/examples/network/bearermonitor/sessionwidget.cpp @@ -111,11 +111,11 @@ void SessionWidget::updateSession() killTimer(statsTimer); if (session->configuration().type() == QNetworkConfiguration::InternetAccessPoint) - bearer->setText(session->configuration().bearerName()); + bearer->setText(session->configuration().bearerTypeName()); else { QNetworkConfigurationManager mgr; QNetworkConfiguration c = mgr.configurationFromIdentifier(session->sessionProperty("ActiveConfiguration").toString()); - bearer->setText(c.bearerName()); + bearer->setText(c.bearerTypeName()); } #ifndef QT_NO_NETWORKINTERFACE diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index d7fceba..b939342 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -383,12 +383,20 @@ QList QNetworkConfiguration::children() const } /*! - Returns the type of bearer. The string is not translated and - therefore can not be shown to the user. The subsequent table presents the currently known - bearer types: + \fn QString QNetworkConfiguration::bearerName() const + \deprecated + + This function is deprecated. It is equivalent to calling bearerTypeName(). +*/ + +/*! + Returns the type of bearer used by this network configuration as a string. + + The string is not translated and therefore can not be shown to the user. The subsequent table + presents the currently known bearer types: \table - \header + \header \o Value \o Description \row @@ -403,7 +411,7 @@ QList QNetworkConfiguration::children() const \row \o 2G \o The session uses CSD, GPRS, HSCSD, EDGE or cdmaOne. - \row + \row \o CDMA2000 \o The session uses CDMA. \row @@ -420,11 +428,11 @@ QList QNetworkConfiguration::children() const \o The session uses WiMAX. \endtable - This function returns an empty string if this is an invalid configuration, - a network configuration of type \l QNetworkConfiguration::ServiceNetwork or + This function returns an empty string if this is an invalid configuration, a network + configuration of type \l QNetworkConfiguration::ServiceNetwork or \l QNetworkConfiguration::UserChoice. */ -QString QNetworkConfiguration::bearerName() const +QString QNetworkConfiguration::bearerTypeName() const { if (!isValid()) return QString(); diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h index dce39eb..42e8b6a 100644 --- a/src/network/bearer/qnetworkconfiguration.h +++ b/src/network/bearer/qnetworkconfiguration.h @@ -106,7 +106,11 @@ public: StateFlags state() const; Type type() const; Purpose purpose() const; - QString bearerName() const; + + // Required to maintain source compatibility with Qt Mobility. + QT_DEPRECATED inline QString bearerName() const { return bearerTypeName(); } + QString bearerTypeName() const; + QString identifier() const; bool isRoamingAvailable() const; QList children() const; -- cgit v0.12 From d12f39e50e4144f3272424bb0bff18c857105654 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Thu, 29 Jul 2010 16:39:05 +1000 Subject: Use an enum to return the bearer type of a network configuration. Task-number: QTBUG-12378 Reviewed-by: Alex --- examples/network/bearercloud/cloud.cpp | 28 ++++--- src/network/bearer/qnetworkconfigmanager_p.cpp | 24 +++--- src/network/bearer/qnetworkconfiguration.cpp | 97 ++++++++++++++++++---- src/network/bearer/qnetworkconfiguration.h | 13 +++ src/network/bearer/qnetworkconfiguration_p.h | 9 +- src/plugins/bearer/connman/qconnmanengine.cpp | 90 ++++++++++---------- src/plugins/bearer/connman/qconnmanengine.h | 4 +- src/plugins/bearer/corewlan/qcorewlanengine.h | 2 - src/plugins/bearer/corewlan/qcorewlanengine.mm | 6 +- src/plugins/bearer/generic/qgenericengine.cpp | 28 +++---- src/plugins/bearer/generic/qgenericengine.h | 2 - src/plugins/bearer/icd/qicdengine.cpp | 18 ++-- src/plugins/bearer/icd/qicdengine.h | 14 +++- src/plugins/bearer/icd/qnetworksession_impl.cpp | 3 + .../bearer/nativewifi/qnativewifiengine.cpp | 7 +- src/plugins/bearer/nativewifi/qnativewifiengine.h | 2 - .../networkmanager/qnetworkmanagerengine.cpp | 34 ++------ .../bearer/networkmanager/qnetworkmanagerengine.h | 2 - src/plugins/bearer/nla/qnlaengine.cpp | 47 +++++------ src/plugins/bearer/nla/qnlaengine.h | 2 - src/plugins/bearer/symbian/symbianengine.cpp | 84 +++++++------------ src/plugins/bearer/symbian/symbianengine.h | 16 ---- 22 files changed, 271 insertions(+), 261 deletions(-) diff --git a/examples/network/bearercloud/cloud.cpp b/examples/network/bearercloud/cloud.cpp index f45ae0d..8deaab3 100644 --- a/examples/network/bearercloud/cloud.cpp +++ b/examples/network/bearercloud/cloud.cpp @@ -53,7 +53,7 @@ #include -static QMap svgCache; +static QMap svgCache; //! [0] Cloud::Cloud(const QNetworkConfiguration &config, QGraphicsItem *parent) @@ -313,17 +313,25 @@ void Cloud::stateChanged(QNetworkSession::State state) //! [1] void Cloud::newConfigurationActivated() { - const QString bearerTypeName = configuration.bearerTypeName(); - if (!svgCache.contains(bearerTypeName)) { - if (bearerTypeName == QLatin1String("WLAN")) - svgCache.insert(bearerTypeName, new QSvgRenderer(QLatin1String(":wlan.svg"))); - else if (bearerTypeName == QLatin1String("Ethernet")) - svgCache.insert(bearerTypeName, new QSvgRenderer(QLatin1String(":lan.svg"))); - else - svgCache.insert(bearerTypeName, new QSvgRenderer(QLatin1String(":unknown.svg"))); + QNetworkConfiguration::BearerType bearerType = configuration.bearerType(); + if (!svgCache.contains(bearerType)) { + QSvgRenderer *renderer = 0; + switch (bearerType) { + case QNetworkConfiguration::BearerWLAN: + renderer = new QSvgRenderer(QLatin1String(":wlan.svg")); + break; + case QNetworkConfiguration::BearerEthernet: + renderer = new QSvgRenderer(QLatin1String(":lan.svg")); + break; + default: + renderer = new QSvgRenderer(QLatin1String(":unknown.svg")); + } + + if (renderer) + svgCache.insert(bearerType, renderer); } - icon->setSharedRenderer(svgCache[bearerTypeName]); + icon->setSharedRenderer(svgCache[bearerType]); if (configuration.name().isEmpty()) { text->setPlainText(tr("HIDDEN NETWORK")); diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index 5d4274f..c4f7c00 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -150,25 +150,29 @@ QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration( end = engine->accessPointConfigurations.end(); it != end; ++it) { QNetworkConfigurationPrivatePointer ptr = it.value(); - const QString bearerName = ptr->bearerName(); QMutexLocker configLocker(&ptr->mutex); + QNetworkConfiguration::BearerType bearerType = ptr->bearerType; if ((ptr->state & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered) { if (!defaultConfiguration) { defaultConfiguration = ptr; } else { + QMutexLocker defaultConfigLocker(&defaultConfiguration->mutex); + if (defaultConfiguration->state == ptr->state) { - if (defaultConfiguration->bearerName() == QLatin1String("Ethernet")) { + switch (defaultConfiguration->bearerType) { + case QNetworkConfiguration::BearerEthernet: // do nothing - } else if (defaultConfiguration->bearerName() == QLatin1String("WLAN")) { - // ethernet beats wlan - if (bearerName == QLatin1String("Ethernet")) - defaultConfiguration = ptr; - } else { - // ethernet and wlan beats other - if (bearerName == QLatin1String("Ethernet") || - bearerName == QLatin1String("WLAN")) { + break; + case QNetworkConfiguration::BearerWLAN: + // Ethernet beats WLAN + defaultConfiguration = ptr; + break; + default: + // Ethernet and WLAN beats other + if (bearerType == QNetworkConfiguration::BearerEthernet || + bearerType == QNetworkConfiguration::BearerWLAN) { defaultConfiguration = ptr; } } diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index b939342..b645916 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -183,6 +183,23 @@ QT_BEGIN_NAMESPACE */ /*! + \enum QNetworkConfiguration::BearerType + + Specifies the type of bearer used by a configuration. + + \value BearerUnknown The type of bearer is unknown or unspecified. The bearerTypeName() + function may return additional information. + \value BearerEthernet The configuration is for an Ethernet interfaces. + \value BearerWLAN The configuration is for a Wireless LAN interface. + \value Bearer2G The configuration is for a CSD, GPRS, HSCSD, EDGE or cdmaOne interface. + \value BearerCDMA2000 The configuration is for CDMA interface. + \value BearerWCDMA The configuration is for W-CDMA/UMTS interface. + \value BearerHSPA The configuration is for High Speed Packet Access (HSPA) interface. + \value BearerBluetooth The configuration is for a Bluetooth interface. + \value BearerWiMAX The configuration is for a WiMAX interface. +*/ + +/*! Constructs an invalid configuration object. \sa isValid() @@ -386,58 +403,110 @@ QList QNetworkConfiguration::children() const \fn QString QNetworkConfiguration::bearerName() const \deprecated - This function is deprecated. It is equivalent to calling bearerTypeName(). + This function is deprecated. It is equivalent to calling bearerTypeName(), however + bearerType() should be used in preference. */ /*! + Returns the type of bearer used by this network configuration. + + If the bearer type is \l {QNetworkConfiguration::BearerUnknown}{unknown} the bearerTypeName() + function can be used to retrieve a textural type name for the bearer. + + An invalid network configuration always returns the BearerUnknown value. +*/ +QNetworkConfiguration::BearerType QNetworkConfiguration::bearerType() const +{ + if (!isValid()) + return BearerUnknown; + + QMutexLocker locker(&d->mutex); + + return d->bearerType; +} + +/*! Returns the type of bearer used by this network configuration as a string. The string is not translated and therefore can not be shown to the user. The subsequent table - presents the currently known bearer types: + shows the fixed mappings between BearerType and the bearer type name for known types. If the + BearerType is unknown this function may return additional information if it is available; + otherwise an empty string will be returned. \table \header + \o BearerType \o Value - \o Description \row - \o Unknown - \o The session is based on an unknown or unspecified bearer type. + \o BearerUnknown + \o + \o The session is based on an unknown or unspecified bearer type. The value of the + string returned describes the bearer type. \row + \o BearerEthernet \o Ethernet - \o The session is based on Ethernet. \row + \o BearerWLAN \o WLAN - \o The session is based on Wireless LAN. \row + \o Bearer2G \o 2G - \o The session uses CSD, GPRS, HSCSD, EDGE or cdmaOne. \row + \o BearerCDMA2000 \o CDMA2000 - \o The session uses CDMA. \row + \o BearerWCDMA \o WCDMA - \o The session uses W-CDMA/UMTS. \row + \o BearerHSPA \o HSPA - \o The session uses High Speed Packet Access. \row + \o BearerBluetooth \o Bluetooth - \o The session uses Bluetooth. \row + \o BearerWiMAX \o WiMAX - \o The session uses WiMAX. \endtable This function returns an empty string if this is an invalid configuration, a network configuration of type \l QNetworkConfiguration::ServiceNetwork or \l QNetworkConfiguration::UserChoice. + + \sa bearerType() */ QString QNetworkConfiguration::bearerTypeName() const { if (!isValid()) return QString(); - return d->bearerName(); + QMutexLocker locker(&d->mutex); + + if (d->type == QNetworkConfiguration::ServiceNetwork || + d->type == QNetworkConfiguration::UserChoice) + return QString(); + + switch (d->bearerType) { + case BearerUnknown: + return d->bearerTypeName(); + case BearerEthernet: + return QLatin1String("Ethernet"); + case BearerWLAN: + return QLatin1String("WLAN"); + case Bearer2G: + return QLatin1String("2G"); + case BearerCDMA2000: + return QLatin1String("CDMA2000"); + case BearerWCDMA: + return QLatin1String("WCDMA"); + case BearerHSPA: + return QLatin1String("HSPA"); + case BearerBluetooth: + return QLatin1String("Bluetooth"); + case BearerWiMAX: + return QLatin1String("WiMAX"); + } + + return QString(); } QT_END_NAMESPACE diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h index 42e8b6a..d9d36fd 100644 --- a/src/network/bearer/qnetworkconfiguration.h +++ b/src/network/bearer/qnetworkconfiguration.h @@ -103,12 +103,25 @@ public: Q_DECLARE_FLAGS(StateFlags, StateFlag) + enum BearerType { + BearerUnknown, + BearerEthernet, + BearerWLAN, + Bearer2G, + BearerCDMA2000, + BearerWCDMA, + BearerHSPA, + BearerBluetooth, + BearerWiMAX + }; + StateFlags state() const; Type type() const; Purpose purpose() const; // Required to maintain source compatibility with Qt Mobility. QT_DEPRECATED inline QString bearerName() const { return bearerTypeName(); } + BearerType bearerType() const; QString bearerTypeName() const; QString identifier() const; diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h index 966dfb2..0fc6ee9 100644 --- a/src/network/bearer/qnetworkconfiguration_p.h +++ b/src/network/bearer/qnetworkconfiguration_p.h @@ -68,6 +68,7 @@ public: QNetworkConfigurationPrivate () : mutex(QMutex::Recursive), type(QNetworkConfiguration::Invalid), purpose(QNetworkConfiguration::UnknownPurpose), + bearerType(QNetworkConfiguration::BearerUnknown), isValid(false), roamingSupported(false) { } @@ -78,24 +79,22 @@ public: serviceNetworkMembers.clear(); } - virtual QString bearerName() const + virtual QString bearerTypeName() const { - QMutexLocker locker(&mutex); - - return bearer; + return QString(); } QMap serviceNetworkMembers; mutable QMutex mutex; - QString bearer; QString name; QString id; QNetworkConfiguration::StateFlags state; QNetworkConfiguration::Type type; QNetworkConfiguration::Purpose purpose; + QNetworkConfiguration::BearerType bearerType; bool isValid; bool roamingSupported; diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp index 8775623..b51596c 100644 --- a/src/plugins/bearer/connman/qconnmanengine.cpp +++ b/src/plugins/bearer/connman/qconnmanengine.cpp @@ -125,7 +125,7 @@ QList QConnmanEngine::getConfigurations() config->type = cpPriv->type; config->roamingSupported = cpPriv->roamingSupported; config->purpose = cpPriv->purpose; - config->bearer = cpPriv->bearer; + config->bearerType = cpPriv->bearerType; fetchedConfigurations.append(config); } @@ -169,30 +169,6 @@ bool QConnmanEngine::hasIdentifier(const QString &id) return accessPointConfigurations.contains(id); } -QString QConnmanEngine::bearerName(const QString &id) -{ - QMutexLocker locker(&mutex); - QConnmanServiceInterface serv(serviceFromId(id)); - QString connectionType = serv.getType(); - - if (connectionType == "ethernet") - return QLatin1String("Ethernet"); - else if (connectionType == "wifi") - return QLatin1String("WLAN"); - else if (connectionType == "cellular") { - QString mode = serv.getMode(); - if(mode == "gprs" || mode == "edge") { - return QLatin1String("2G"); - } else if(mode == "umts") { - return QLatin1String("WCDMA"); - } - } - else if (connectionType == "wimax") - return QLatin1String("WIMAX"); - - return QString(); -} - void QConnmanEngine::connectToId(const QString &id) { QMutexLocker locker(&mutex); @@ -538,25 +514,25 @@ QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QStri return flag; } -QString QConnmanEngine::typeToBearer(const QString &type) +QNetworkConfiguration::BearerType QConnmanEngine::typeToBearer(const QString &type) { - QMutexLocker locker(&mutex); - if(type == "wifi") - return "WLAN"; - if(type == "ethernet") - return "Ethernet"; - if(type == "bluetooth") - return "Bluetooth"; - if(type == "cellular") { - return "Cellular"; + if (type == "wifi") + return QNetworkConfiguration::BearerWLAN; + if (type == "ethernet") + return QNetworkConfiguration::BearerEthernet; + if (type == "bluetooth") + return QNetworkConfiguration::BearerBluetooth; + if (type == "cellular") { + return QNetworkConfiguration::BearerUnknown; // not handled: CDMA2000 HSPA } - if(type == "wimax") - return "WiMax"; + if (type == "wimax") + return QNetworkConfiguration::BearerWiMAX; + // if(type == "gps") // if(type == "vpn") - return "Unknown"; + return QNetworkConfiguration::BearerUnknown; } void QConnmanEngine::removeConfiguration(const QString &id) @@ -620,7 +596,24 @@ void QConnmanEngine::addServiceConfiguration(const QString &servicePath) cpPriv->isValid = true; cpPriv->id = id; cpPriv->type = QNetworkConfiguration::InternetAccessPoint; - cpPriv->bearer = bearerName(id); + + + const QString connectionType = serv->getType(); + if (connectionType == "ethernet") { + cpPriv->bearerType = QNetworkConfiguration::BearerEthernet; + } else if (connectionType == "wifi") { + cpPriv->bearerType = QNetworkConfiguration::BearerWLAN; + } else if (connectionType == "cellular") { + const QString mode = serv->getMode(); + if (mode == "gprs" || mode == "edge") + cpPriv->bearerType = QNetworkConfiguration::Bearer2G; + else if (mode == "umts") + cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA; + } else if (connectionType == "wimax") { + cpPriv->bearerType = QNetworkConfiguration::BearerWiMAX; + } else { + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; + } if(serv->getSecurity() == "none") { cpPriv->purpose = QNetworkConfiguration::PublicPurpose; @@ -683,22 +676,23 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath) if(networkName.isEmpty()) networkName = "Hidden Network"; - QString bearerName; + + QNetworkConfiguration::BearerType bearerType; if(servicePath.isEmpty()) { QString devicePath = networkPath.section("/",0,5); QConnmanDeviceInterface device(devicePath,this); - bearerName = typeToBearer(device.getType()); + bearerType = typeToBearer(device.getType()); } else { - bearerName = typeToBearer(serv->getType()); + bearerType = typeToBearer(serv->getType()); } - if(bearerName == "Cellular") { + if (bearerType == QNetworkConfiguration::BearerUnknown) { QString mode = serv->getMode(); - if(mode == "gprs" || mode == "edge") { - bearerName = "2G"; - } else if(mode == "umts") { - bearerName = "WCDMA"; + if (mode == "gprs" || mode == "edge") { + bearerType = QNetworkConfiguration::Bearer2G; + } else if (mode == "umts") { + bearerType = QNetworkConfiguration::BearerWCDMA; } networkName = serv->getAPN(); } @@ -707,7 +701,7 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath) cpPriv->isValid = true; cpPriv->id = id; cpPriv->type = QNetworkConfiguration::InternetAccessPoint; - cpPriv->bearer = bearerName; + cpPriv->bearerType = bearerType; if(network->getWifiSecurity() == "none") { cpPriv->purpose = QNetworkConfiguration::PublicPurpose; diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h index 0f6dc1c..2ee6da5 100644 --- a/src/plugins/bearer/connman/qconnmanengine.h +++ b/src/plugins/bearer/connman/qconnmanengine.h @@ -80,8 +80,6 @@ public: virtual QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - virtual QString bearerName(const QString &id); - virtual void connectToId(const QString &id); virtual void disconnectFromId(const QString &id); @@ -125,7 +123,7 @@ private: QString networkFromId(const QString &id); QNetworkConfiguration::StateFlags getStateForService(const QString &service); - QString typeToBearer(const QString &type); + QNetworkConfiguration::BearerType typeToBearer(const QString &type); void removeConfiguration(const QString &servicePath); void addServiceConfiguration(const QString &servicePath); diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h index 4d90648..56da66a 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.h +++ b/src/plugins/bearer/corewlan/qcorewlanengine.h @@ -68,8 +68,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index 6ba9504..131f36d 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -264,7 +264,7 @@ QStringList QScanThread::foundNetwork(const QString &id, const QString &name, co ptr->id = id; ptr->state = state; ptr->type = QNetworkConfiguration::InternetAccessPoint; - ptr->bearer = QLatin1String("WLAN"); + ptr->bearerType = QNetworkConfiguration::BearerWLAN; ptr->purpose = purpose; fetchedConfigurations.append( ptr); @@ -789,8 +789,8 @@ void QCoreWlanEngine::networksChanged() changed = true; } - if (ptr->bearer != cpPriv->bearer) { - ptr->bearer = cpPriv->bearer; + if (ptr->bearerType != cpPriv->bearerType) { + ptr->bearerType = cpPriv->bearerType; changed = true; } diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp index 652fe4a..fad3ae8 100644 --- a/src/plugins/bearer/generic/qgenericengine.cpp +++ b/src/plugins/bearer/generic/qgenericengine.cpp @@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_NETWORKINTERFACE -static QString qGetInterfaceType(const QString &interface) +static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interface) { #ifdef Q_OS_WIN32 unsigned long oid; @@ -78,10 +78,10 @@ static QString qGetInterfaceType(const QString &interface) NDIS_MEDIUM medium; NDIS_PHYSICAL_MEDIUM physicalMedium; - HANDLE handle = CreateFile((TCHAR *)QString("\\\\.\\%1").arg(interface).utf16(), 0, + HANDLE handle = CreateFile((TCHAR *)QString::fromLatin1("\\\\.\\%1").arg(interface).utf16(), 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); if (handle == INVALID_HANDLE_VALUE) - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; oid = OID_GEN_MEDIA_SUPPORTED; bytesWritten = 0; @@ -89,7 +89,7 @@ static QString qGetInterfaceType(const QString &interface) &medium, sizeof(medium), &bytesWritten, 0); if (!result) { CloseHandle(handle); - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } oid = OID_GEN_PHYSICAL_MEDIUM; @@ -100,9 +100,9 @@ static QString qGetInterfaceType(const QString &interface) CloseHandle(handle); if (medium == NdisMedium802_3) - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; else - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } CloseHandle(handle); @@ -110,16 +110,16 @@ static QString qGetInterfaceType(const QString &interface) if (medium == NdisMedium802_3) { switch (physicalMedium) { case NdisPhysicalMediumWirelessLan: - return QLatin1String("WLAN"); + return QNetworkConfiguration::BearerWLAN; case NdisPhysicalMediumBluetooth: - return QLatin1String("Bluetooth"); + return QNetworkConfiguration::BearerBluetooth; case NdisPhysicalMediumWiMax: - return QLatin1String("WiMAX"); + return QNetworkConfiguration::BearerWiMAX; default: #ifdef BEARER_MANAGEMENT_DEBUG qDebug() << "Physical Medium" << physicalMedium; #endif - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; } } @@ -135,12 +135,12 @@ static QString qGetInterfaceType(const QString &interface) close(sock); if (result >= 0 && request.ifr_hwaddr.sa_family == ARPHRD_ETHER) - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; #else Q_UNUSED(interface); #endif - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } #endif @@ -214,7 +214,7 @@ void QGenericEngine::doRequestUpdate() continue; // ignore WLAN interface handled in separate engine - if (qGetInterfaceType(interface.name()) == QLatin1String("WLAN")) + if (qGetInterfaceType(interface.name()) == QNetworkConfiguration::BearerWLAN) continue; uint identifier; @@ -277,7 +277,7 @@ void QGenericEngine::doRequestUpdate() ptr->id = id; ptr->state = state; ptr->type = QNetworkConfiguration::InternetAccessPoint; - ptr->bearer = qGetInterfaceType(interface.name()); + ptr->bearerType = qGetInterfaceType(interface.name()); accessPointConfigurations.insert(id, ptr); configurationInterface.insert(id, interface.name()); diff --git a/src/plugins/bearer/generic/qgenericengine.h b/src/plugins/bearer/generic/qgenericengine.h index cdbbc9d..021b35b 100644 --- a/src/plugins/bearer/generic/qgenericengine.h +++ b/src/plugins/bearer/generic/qgenericengine.h @@ -65,8 +65,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index 0083380..6060a09 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -60,16 +60,11 @@ IcdNetworkConfigurationPrivate::~IcdNetworkConfigurationPrivate() { } -QString IcdNetworkConfigurationPrivate::bearerName() const +QString IcdNetworkConfigurationPrivate::bearerTypeName() const { - if (iap_type == QLatin1String("WLAN_INFRA") || - iap_type == QLatin1String("WLAN_ADHOC")) { - return QLatin1String("WLAN"); - } else if (iap_type == QLatin1String("GPRS")) { - return QLatin1String("HSPA"); - } else { - return iap_type; - } + QMutexLocker locker(&mutex); + + return iap_type; } /* The IapAddTimer is a helper class that makes sure we update @@ -400,6 +395,7 @@ void QIcdEngine::addConfiguration(QString& iap_id) ptr->mutex.lock(); ptr->id = iap_id; toIcdConfig(ptr)->iap_type = iap_type; + ptr->bearerType = bearerTypeFromIapType(iap_type); toIcdConfig(ptr)->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString()); toIcdConfig(ptr)->network_id = ssid; toIcdConfig(ptr)->service_id = saved_iap.value("service_id").toString(); @@ -424,6 +420,7 @@ void QIcdEngine::addConfiguration(QString& iap_id) cpPriv->isValid = true; cpPriv->id = iap_id; cpPriv->iap_type = iap_type; + cpPriv->bearerType = bearerTypeFromIapType(iap_type); cpPriv->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString()); cpPriv->service_id = saved_iap.value("service_id").toString(); cpPriv->service_type = saved_iap.value("service_type").toString(); @@ -480,6 +477,7 @@ void QIcdEngine::addConfiguration(QString& iap_id) ptr->isValid = true; if (toIcdConfig(ptr)->iap_type != iap_type) { toIcdConfig(ptr)->iap_type = iap_type; + ptr->bearerType = bearerTypeFromIapType(iap_type); update_needed = true; } if (iap_type.startsWith(QLatin1String("WLAN"))) { @@ -580,6 +578,7 @@ void QIcdEngine::doRequestUpdate(QList scanned) cpPriv->network_id = ssid; cpPriv->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString()); cpPriv->iap_type = iap_type; + cpPriv->bearerType = bearerTypeFromIapType(iap_type); cpPriv->service_id = saved_ap.value("service_id").toString(); cpPriv->service_type = saved_ap.value("service_type").toString(); cpPriv->type = QNetworkConfiguration::InternetAccessPoint; @@ -688,6 +687,7 @@ rescan_list: cpPriv->id = scanned_ssid.data(); // Note: id is now ssid, it should be set to IAP id if the IAP is saved cpPriv->network_id = scanned_ssid; cpPriv->iap_type = ap.scan.network_type; + cpPriv->bearerType = bearerTypeFromIapType(cpPriv->iap_type); cpPriv->network_attrs = ap.scan.network_attrs; cpPriv->service_id = ap.scan.service_id; cpPriv->service_type = ap.scan.service_type; diff --git a/src/plugins/bearer/icd/qicdengine.h b/src/plugins/bearer/icd/qicdengine.h index 1b291eb..16dc979 100644 --- a/src/plugins/bearer/icd/qicdengine.h +++ b/src/plugins/bearer/icd/qicdengine.h @@ -54,13 +54,25 @@ class QNetworkConfigurationPrivate; class IapMonitor; class QDBusInterface; +inline QNetworkConfiguration::BearerType bearerTypeFromIapType(const QString &iapType) +{ + if (iapType == QLatin1String("WLAN_INFRA") || + iapType == QLatin1String("WLAN_ADHOC")) { + return QNetworkConfiguration::BearerWLAN; + } else if (iapType == QLatin1String("GPRS")) { + return QNetworkConfiguration::BearerHSPA; + } else { + return QNetworkConfiguration::BearerUnknown; + } +} + class IcdNetworkConfigurationPrivate : public QNetworkConfigurationPrivate { public: IcdNetworkConfigurationPrivate(); ~IcdNetworkConfigurationPrivate(); - QString bearerName() const; + virtual QString bearerTypeName() const; // In Maemo the id field (defined in QNetworkConfigurationPrivate) // is the IAP id (which typically is UUID) diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index e8e5183..2583b28 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -318,6 +318,7 @@ QNetworkConfiguration& QNetworkSessionPrivateImpl::copyConfig(QNetworkConfigurat cpPriv->purpose = fromPriv->purpose; cpPriv->network_id = fromPriv->network_id; cpPriv->iap_type = fromPriv->iap_type; + cpPriv->bearerType = fromPriv->bearerType; cpPriv->network_attrs = fromPriv->network_attrs; cpPriv->service_type = fromPriv->service_type; cpPriv->service_id = fromPriv->service_id; @@ -443,6 +444,7 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface() ptr->id = toIcdConfig(ptr)->network_id; toIcdConfig(ptr)->network_attrs = state_results.first().params.network_attrs; toIcdConfig(ptr)->iap_type = state_results.first().params.network_type; + ptr->bearerType = bearerTypeFromIapType(toIcdConfig(ptr)->iap_type); toIcdConfig(ptr)->service_type = state_results.first().params.service_type; toIcdConfig(ptr)->service_id = state_results.first().params.service_id; toIcdConfig(ptr)->service_attrs = state_results.first().params.service_attrs; @@ -819,6 +821,7 @@ void QNetworkSessionPrivateImpl::stateChange(const QDBusMessage& rep) icdConfig->name = name; icdConfig->iap_type = rep.arguments().at(3).toString(); // connect_result.connect.network_type; + icdConfig->bearerType = bearerTypeFromIapType(icdConfig->iap_type); icdConfig->isValid = true; icdConfig->state = QNetworkConfiguration::Active; icdConfig->type = QNetworkConfiguration::InternetAccessPoint; diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp index 1a55402..ba8297e 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp @@ -206,7 +206,7 @@ void QNativeWifiEngine::scanComplete() ptr->id = id; ptr->state = state; ptr->type = QNetworkConfiguration::InternetAccessPoint; - ptr->bearer = QLatin1String("WLAN"); + ptr->bearerType = QNetworkConfiguration::BearerWLAN; accessPointConfigurations.insert(id, ptr); @@ -350,11 +350,6 @@ bool QNativeWifiEngine::hasIdentifier(const QString &id) return false; } -/*QString QNativeWifiEngine::bearerName(const QString &) -{ - return QLatin1String("WLAN"); -}*/ - void QNativeWifiEngine::connectToId(const QString &id) { QMutexLocker locker(&mutex); diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.h b/src/plugins/bearer/nativewifi/qnativewifiengine.h index 0e9576b..dccf2e2 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.h +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.h @@ -75,8 +75,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - //QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp index 3ebc356..f3f693b 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp @@ -181,30 +181,6 @@ bool QNetworkManagerEngine::hasIdentifier(const QString &id) return false; } -QString QNetworkManagerEngine::bearerName(const QString &id) -{ - QMutexLocker locker(&mutex); - - QNetworkManagerSettingsConnection *connection = connectionFromId(id); - - if (!connection) - return QString(); - - QNmSettingsMap map = connection->getSettings(); - const QString connectionType = map.value("connection").value("type").toString(); - - if (connectionType == "802-3-ethernet") - return QLatin1String("Ethernet"); - else if (connectionType == "802-11-wireless") - return QLatin1String("WLAN"); - else if (connectionType == "gsm") - return QLatin1String("2G"); - else if (connectionType == "cdma") - return QLatin1String("CDMA2000"); - else - return QString(); -} - void QNetworkManagerEngine::connectToId(const QString &id) { QMutexLocker locker(&mutex); @@ -611,7 +587,7 @@ void QNetworkManagerEngine::newAccessPoint(const QString &path, const QDBusObjec ptr->purpose = QNetworkConfiguration::PublicPurpose; } ptr->state = QNetworkConfiguration::Undefined; - ptr->bearer = QLatin1String("WLAN"); + ptr->bearerType = QNetworkConfiguration::BearerWLAN; accessPointConfigurations.insert(ptr->id, ptr); @@ -724,7 +700,7 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri const QString connectionType = map.value("connection").value("type").toString(); if (connectionType == QLatin1String("802-3-ethernet")) { - cpPriv->bearer = QLatin1String("Ethernet"); + cpPriv->bearerType = QNetworkConfiguration::BearerEthernet; cpPriv->purpose = QNetworkConfiguration::PublicPurpose; foreach (const QDBusObjectPath &devicePath, interface->getDevices()) { @@ -739,7 +715,7 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri } } } else if (connectionType == QLatin1String("802-11-wireless")) { - cpPriv->bearer = QLatin1String("WLAN"); + cpPriv->bearerType = QNetworkConfiguration::BearerWLAN; const QString connectionSsid = map.value("802-11-wireless").value("ssid").toString(); const QString connectionSecurity = map.value("802-11-wireless").value("security").toString(); @@ -767,9 +743,9 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri } } } else if (connectionType == "gsm") { - cpPriv->bearer = QLatin1String("2G"); + cpPriv->bearerType = QNetworkConfiguration::Bearer2G; } else if (connectionType == "cdma") { - cpPriv->bearer = QLatin1String("CDMA2000"); + cpPriv->bearerType = QNetworkConfiguration::BearerCDMA2000; } return cpPriv; diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h index 8e95a2c..ffb8395 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h @@ -78,8 +78,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp index 9ab9924..fd50099 100644 --- a/src/plugins/bearer/nla/qnlaengine.cpp +++ b/src/plugins/bearer/nla/qnlaengine.cpp @@ -119,7 +119,7 @@ static void printBlob(NLA_BLOB *blob) } #endif -static QString qGetInterfaceType(const QString &interface) +static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interface) { #ifdef Q_OS_WINCE Q_UNUSED(interface) @@ -130,10 +130,10 @@ static QString qGetInterfaceType(const QString &interface) NDIS_MEDIUM medium; NDIS_PHYSICAL_MEDIUM physicalMedium; - HANDLE handle = CreateFile((TCHAR *)QString(QLatin1String("\\\\.\\%1")).arg(interface).utf16(), - 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + HANDLE handle = CreateFile((TCHAR *)QString::fromLatin1("\\\\.\\%1").arg(interface).utf16(), 0, + FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); if (handle == INVALID_HANDLE_VALUE) - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; oid = OID_GEN_MEDIA_SUPPORTED; bytesWritten = 0; @@ -141,7 +141,7 @@ static QString qGetInterfaceType(const QString &interface) &medium, sizeof(medium), &bytesWritten, 0); if (!result) { CloseHandle(handle); - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } oid = OID_GEN_PHYSICAL_MEDIUM; @@ -152,9 +152,9 @@ static QString qGetInterfaceType(const QString &interface) CloseHandle(handle); if (medium == NdisMedium802_3) - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; else - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } CloseHandle(handle); @@ -162,16 +162,16 @@ static QString qGetInterfaceType(const QString &interface) if (medium == NdisMedium802_3) { switch (physicalMedium) { case NdisPhysicalMediumWirelessLan: - return QLatin1String("WLAN"); + return QNetworkConfiguration::BearerWLAN; case NdisPhysicalMediumBluetooth: - return QLatin1String("Bluetooth"); + return QNetworkConfiguration::BearerBluetooth; case NdisPhysicalMediumWiMax: - return QLatin1String("WiMAX"); + return QNetworkConfiguration::BearerWiMAX; default: #ifdef BEARER_MANAGEMENT_DEBUG qDebug() << "Physical Medium" << physicalMedium; #endif - return QLatin1String("Ethernet"); + return QNetworkConfiguration::BearerEthernet; } } @@ -181,7 +181,7 @@ static QString qGetInterfaceType(const QString &interface) #endif - return QLatin1String("Unknown"); + return QNetworkConfiguration::BearerUnknown; } class QNlaThread : public QThread @@ -374,10 +374,9 @@ DWORD QNlaThread::parseBlob(NLA_BLOB *blob, QNetworkConfigurationPrivate *cpPriv #endif break; case NLA_CONNECTIVITY: - if (blob->data.connectivity.internet == NLA_INTERNET_YES) - cpPriv->internet = true; - else - cpPriv->internet = false; +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug("%s: unhandled header type NLA_CONNECTIVITY", __FUNCTION__); +#endif break; case NLA_ICS: #ifdef BEARER_MANAGEMENT_DEBUG @@ -438,8 +437,10 @@ QNetworkConfigurationPrivate *QNlaThread::parseQuerySet(const WSAQUERYSET *query } while (offset != 0 && offset < querySet->lpBlob->cbSize); } - if (QNlaEngine *engine = qobject_cast(parent())) - cpPriv->bearer = engine->bearerName(cpPriv->id); + if (QNlaEngine *engine = qobject_cast(parent())) { + const QString interface = engine->getInterfaceFromId(cpPriv->id); + cpPriv->bearerType = qGetInterfaceType(interface); + } return cpPriv; } @@ -586,16 +587,6 @@ bool QNlaEngine::hasIdentifier(const QString &id) return configurationInterface.contains(id.toUInt()); } -QString QNlaEngine::bearerName(const QString &id) -{ - QString interface = getInterfaceFromId(id); - - if (interface.isEmpty()) - return QString(); - - return qGetInterfaceType(interface); -} - void QNlaEngine::connectToId(const QString &id) { emit connectionError(id, OperationNotSupported); diff --git a/src/plugins/bearer/nla/qnlaengine.h b/src/plugins/bearer/nla/qnlaengine.h index 1d49464..69f54c9 100644 --- a/src/plugins/bearer/nla/qnlaengine.h +++ b/src/plugins/bearer/nla/qnlaengine.h @@ -85,8 +85,6 @@ public: QString getInterfaceFromId(const QString &id); bool hasIdentifier(const QString &id); - QString bearerName(const QString &id); - void connectToId(const QString &id); void disconnectFromId(const QString &id); diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index 4bd6d2f..078e8dd 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE static const int KUserChoiceIAPId = 0; SymbianNetworkConfigurationPrivate::SymbianNetworkConfigurationPrivate() -: bearer(BearerUnknown), numericId(0), connectionId(0) +: numericId(0), connectionId(0) { } @@ -83,32 +83,6 @@ SymbianNetworkConfigurationPrivate::~SymbianNetworkConfigurationPrivate() { } -QString SymbianNetworkConfigurationPrivate::bearerName() const -{ - QMutexLocker locker(&mutex); - - switch (bearer) { - case BearerEthernet: - return QLatin1String("Ethernet"); - case BearerWLAN: - return QLatin1String("WLAN"); - case Bearer2G: - return QLatin1String("2G"); - case BearerCDMA2000: - return QLatin1String("CDMA2000"); - case BearerWCDMA: - return QLatin1String("WCDMA"); - case BearerHSPA: - return QLatin1String("HSPA"); - case BearerBluetooth: - return QLatin1String("Bluetooth"); - case BearerWiMAX: - return QLatin1String("WiMAX"); - default: - return QString(); - } -} - SymbianEngine::SymbianEngine(QObject *parent) : QBearerEngine(parent), CActive(CActive::EPriorityHigh), iFirstUpdate(true), iInitOk(true), iUpdatePending(false) @@ -146,7 +120,7 @@ void SymbianEngine::initialize() SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate; cpPriv->name = "UserChoice"; - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; cpPriv->state = QNetworkConfiguration::Discovered; cpPriv->isValid = true; cpPriv->id = QString::number(qHash(KUserChoiceIAPId)); @@ -517,25 +491,25 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL( TUint32 bearerId = connectionMethod.GetIntAttributeL(CMManager::ECmCommsDBBearerType); switch (bearerId) { case KCommDbBearerCSD: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + cpPriv->bearerType = QNetworkConfiguration::Bearer2G; break; case KCommDbBearerWcdma: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA; + cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA; break; case KCommDbBearerLAN: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerEthernet; + cpPriv->bearerType = QNetworkConfiguration::BearerEthernet; break; case KCommDbBearerVirtual: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; break; case KCommDbBearerPAN: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; break; case KCommDbBearerWLAN: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerWLAN; + cpPriv->bearerType = QNetworkConfiguration::BearerWLAN; break; default: - cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; break; } @@ -619,28 +593,28 @@ void SymbianEngine::readNetworkConfigurationValuesFromCommsDbL( apNetworkConfiguration->roamingSupported = false; switch (pAPItem->BearerTypeL()) { case EApBearerTypeCSD: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + apNetworkConfiguration->bearerType = QNetworkConfiguration::Bearer2G; break; case EApBearerTypeGPRS: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + apNetworkConfiguration->bearerType = QNetworkConfiguration::Bearer2G; break; case EApBearerTypeHSCSD: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerHSPA; break; case EApBearerTypeCDMA: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerCDMA2000; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerCDMA2000; break; case EApBearerTypeWLAN: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerWLAN; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerWLAN; break; case EApBearerTypeLAN: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerEthernet; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerEthernet; break; case EApBearerTypeLANModem: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerEthernet; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerEthernet; break; default: - apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown; + apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerUnknown; break; } @@ -870,38 +844,38 @@ void SymbianEngine::updateMobileBearerToConfigs(TConnMonBearerInfo bearerInfo) SymbianNetworkConfigurationPrivate *p = toSymbianConfig(ptr); - if (p->bearer >= SymbianNetworkConfigurationPrivate::Bearer2G && - p->bearer <= SymbianNetworkConfigurationPrivate::BearerHSPA) { + if (p->bearerType >= QNetworkConfiguration::Bearer2G && + p->bearerType <= QNetworkConfiguration::BearerHSPA) { switch (bearerInfo) { case EBearerInfoCSD: - p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + p->bearerType = QNetworkConfiguration::Bearer2G; break; case EBearerInfoWCDMA: - p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA; + p->bearerType = QNetworkConfiguration::BearerWCDMA; break; case EBearerInfoCDMA2000: - p->bearer = SymbianNetworkConfigurationPrivate::BearerCDMA2000; + p->bearerType = QNetworkConfiguration::BearerCDMA2000; break; case EBearerInfoGPRS: - p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + p->bearerType = QNetworkConfiguration::Bearer2G; break; case EBearerInfoHSCSD: - p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + p->bearerType = QNetworkConfiguration::Bearer2G; break; case EBearerInfoEdgeGPRS: - p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G; + p->bearerType = QNetworkConfiguration::Bearer2G; break; case EBearerInfoWcdmaCSD: - p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA; + p->bearerType = QNetworkConfiguration::BearerWCDMA; break; case EBearerInfoHSDPA: - p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA; + p->bearerType = QNetworkConfiguration::BearerHSPA; break; case EBearerInfoHSUPA: - p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA; + p->bearerType = QNetworkConfiguration::BearerHSPA; break; case EBearerInfoHSxPA: - p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA; + p->bearerType = QNetworkConfiguration::BearerHSPA; break; } } diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h index ecd858d..1fe6395 100644 --- a/src/plugins/bearer/symbian/symbianengine.h +++ b/src/plugins/bearer/symbian/symbianengine.h @@ -73,23 +73,9 @@ class AccessPointsAvailabilityScanner; class SymbianNetworkConfigurationPrivate : public QNetworkConfigurationPrivate { public: - enum Bearer { - BearerEthernet, - BearerWLAN, - Bearer2G, - BearerCDMA2000, - BearerWCDMA, - BearerHSPA, - BearerBluetooth, - BearerWiMAX, - BearerUnknown = -1 - }; - SymbianNetworkConfigurationPrivate(); ~SymbianNetworkConfigurationPrivate(); - QString bearerName() const; - inline TUint32 numericIdentifier() const { QMutexLocker locker(&mutex); @@ -110,8 +96,6 @@ public: QString mappingName; - Bearer bearer; - // So called IAP id from the platform. Remains constant as long as the // platform is aware of the configuration ie. it is stored in the databases // --> does not depend on whether connections are currently open or not. -- cgit v0.12 From eb674c0ba34dfb9434c96d4e1376c02287fb367b Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Mon, 2 Aug 2010 11:15:06 +1000 Subject: Simplify network manager settings code. There is no need to iterate over the outer and inner map as they are not multi-maps. --- .../networkmanager/qnetworkmanagerservice.cpp | 158 ++++++--------------- 1 file changed, 46 insertions(+), 112 deletions(-) diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp index 31a9aa1..f47c97c 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp @@ -718,146 +718,80 @@ QNmSettingsMap QNetworkManagerSettingsConnection::getSettings() NMDeviceType QNetworkManagerSettingsConnection::getType() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap innerMap = i.value(); - QMap::const_iterator ii = innerMap.find(QLatin1String("type")); - while (ii != innerMap.end() && ii.key() == QLatin1String("type")) { - QString devType = ii.value().toString(); - if (devType == QLatin1String("802-3-ethernet")) { - return DEVICE_TYPE_802_3_ETHERNET; - } - if (devType == QLatin1String("802-11-wireless")) { - return DEVICE_TYPE_802_11_WIRELESS; - } - ii++; - } - i++; - } - return DEVICE_TYPE_UNKNOWN; + const QString devType = + d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("type")).toString(); + + if (devType == QLatin1String("802-3-ethernet")) + return DEVICE_TYPE_802_3_ETHERNET; + else if (devType == QLatin1String("802-11-wireless")) + return DEVICE_TYPE_802_11_WIRELESS; + else + return DEVICE_TYPE_UNKNOWN; } bool QNetworkManagerSettingsConnection::isAutoConnect() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap innerMap = i.value(); - QMap::const_iterator ii = innerMap.find(QLatin1String("autoconnect")); - while (ii != innerMap.end() && ii.key() == QLatin1String("autoconnect")) { - return ii.value().toBool(); - ii++; - } - i++; - } - return true; //default networkmanager is autoconnect + const QVariant autoConnect = + d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("autoconnect")); + + // NetworkManager default is to auto connect + if (!autoConnect.isValid()) + return true; + + return autoConnect.toBool(); } quint64 QNetworkManagerSettingsConnection::getTimestamp() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap innerMap = i.value(); - QMap::const_iterator ii = innerMap.find(QLatin1String("timestamp")); - while (ii != innerMap.end() && ii.key() == QLatin1String("timestamp")) { - return ii.value().toUInt(); - ii++; - } - i++; - } - return 0; + qDebug() << d->settingsMap.value(QLatin1String("connection")); + + return d->settingsMap.value(QLatin1String("connection")) + .value(QLatin1String("timestamp")).toUInt(); } QString QNetworkManagerSettingsConnection::getId() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap innerMap = i.value(); - QMap::const_iterator ii = innerMap.find(QLatin1String("id")); - while (ii != innerMap.end() && ii.key() == QLatin1String("id")) { - return ii.value().toString(); - ii++; - } - i++; - } - return QString(); + return d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("id")).toString(); } QString QNetworkManagerSettingsConnection::getUuid() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) { - QMap innerMap = i.value(); - QMap::const_iterator ii = innerMap.find(QLatin1String("uuid")); - while (ii != innerMap.end() && ii.key() == QLatin1String("uuid")) { - return ii.value().toString(); - ii++; - } - i++; - } + const QString id = d->settingsMap.value(QLatin1String("connection")) + .value(QLatin1String("uuid")).toString(); + // is no uuid, return the connection path - return d->connectionInterface->path(); + return id.isEmpty() ? d->connectionInterface->path() : id; } QString QNetworkManagerSettingsConnection::getSsid() { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-11-wireless")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("802-11-wireless")) { - QMap innerMap = i.value(); - QMap::const_iterator ii = innerMap.find(QLatin1String("ssid")); - while (ii != innerMap.end() && ii.key() == QLatin1String("ssid")) { - return ii.value().toString(); - ii++; - } - i++; - } - return QString(); + return d->settingsMap.value(QLatin1String("802-11-wireless")) + .value(QLatin1String("ssid")).toString(); } QString QNetworkManagerSettingsConnection::getMacAddress() { - if(getType() == DEVICE_TYPE_802_3_ETHERNET) { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-3-ethernet")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("802-3-ethernet")) { - QMap innerMap = i.value(); - QMap::const_iterator ii = innerMap.find(QLatin1String("mac-address")); - while (ii != innerMap.end() && ii.key() == QLatin1String("mac-address")) { - return ii.value().toString(); - ii++; - } - i++; - } - } + NMDeviceType type = getType(); - else if(getType() == DEVICE_TYPE_802_11_WIRELESS) { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-11-wireless")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("802-11-wireless")) { - QMap innerMap = i.value(); - QMap::const_iterator ii = innerMap.find(QLatin1String("mac-address")); - while (ii != innerMap.end() && ii.key() == QLatin1String("mac-address")) { - return ii.value().toString(); - ii++; - } - i++; - } + if (type == DEVICE_TYPE_802_3_ETHERNET) { + return d->settingsMap.value(QLatin1String("802-3-ethernet")) + .value(QLatin1String("mac-address")).toString(); + } else if (type == DEVICE_TYPE_802_11_WIRELESS) { + return d->settingsMap.value(QLatin1String("802-11-wireless")) + .value(QLatin1String("mac-address")).toString(); + } else { + return QString(); } - return QString(); -} - -QStringList QNetworkManagerSettingsConnection::getSeenBssids() -{ - if(getType() == DEVICE_TYPE_802_11_WIRELESS) { - QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-11-wireless")); - while (i != d->settingsMap.end() && i.key() == QLatin1String("802-11-wireless")) { - QMap innerMap = i.value(); - QMap::const_iterator ii = innerMap.find(QLatin1String("seen-bssids")); - while (ii != innerMap.end() && ii.key() == QLatin1String("seen-bssids")) { - return ii.value().toStringList(); - ii++; - } - i++; - } +} + +QStringList QNetworkManagerSettingsConnection::getSeenBssids() +{ + if (getType() == DEVICE_TYPE_802_11_WIRELESS) { + return d->settingsMap.value(QLatin1String("802-11-wireless")) + .value(QLatin1String("seen-bssids")).toStringList(); + } else { + return QStringList(); } - return QStringList(); } class QNetworkManagerConnectionActivePrivate -- cgit v0.12 From f0e49104a864b3f658e8cc0036b742b20ad84872 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 2 Aug 2010 10:53:25 +0200 Subject: Fixed comment about all enums being accessible in QML. Fix for QTBUG-12527. --- src/declarative/qml/qdeclarativeengine.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index e8cb36e..3822373 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -206,10 +206,9 @@ Text { \section1 Enums -The Qt object contains all enums in the Qt namespace. For example, you can -access the \c AlignLeft member of the \c Qt::AlignmentFlag enum with \c Qt.AlignLeft. +The Qt object contains enums that declared into Qt's Meta-Object System. For example, you can access +the \c Leftbutton member of the \c Qt::MouseButton enum with \c Qt.LeftButton. -For a full list of enums, see the \l{Qt Namespace} documentation. \section1 Types The Qt object also contains helper functions for creating objects of specific -- cgit v0.12 From b588cfe80741ec500fc0a52586145e5849ca5968 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 2 Aug 2010 12:20:13 +0200 Subject: qdoc: Removed exclusion of declarative directories in qt-api-only.qdocconf --- tools/qdoc3/main.cpp | 4 ++- tools/qdoc3/test/assistant.qdocconf | 52 ++++++++++++++++----------------- tools/qdoc3/test/qdeclarative.qdocconf | 52 ++++++++++++++++----------------- tools/qdoc3/test/qt-api-only.qdocconf | 5 +--- tools/qdoc3/test/qt-build-docs.qdocconf | 1 + tools/qdoc3/test/qt.qdocconf | 4 +-- 6 files changed, 59 insertions(+), 59 deletions(-) diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 616ae2f..ba3e387 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -475,8 +475,10 @@ int main(int argc, char **argv) /* Main loop. */ - foreach (QString qf, qdocFiles) + foreach (QString qf, qdocFiles) { + qDebug() << "PROCESSING:" << qf; processQdocconfFile(qf); + } qDeleteAll(trees); return EXIT_SUCCESS; diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index efe3b3b..119a676 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -19,39 +19,39 @@ qhp.Assistant.file = assistant.qhp qhp.Assistant.namespace = com.trolltech.assistant.470 qhp.Assistant.virtualFolder = qdoc qhp.Assistant.indexTitle = Qt Assistant Manual -qhp.Assistant.extraFiles = images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_ll_blank.png \ - images/bg_ul_blank.png \ - images/header_bg.png \ +qhp.Assistant.extraFiles = images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ul_blank.png \ + images/header_bg.png \ images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ images/bullet_dn.png \ - images/bullet_sq.png \ + images/bullet_sq.png \ images/bullet_up.png \ - images/arrow_down.png \ + images/arrow_down.png \ images/feedbackground.png \ images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/spinner.gif \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - scripts/narrow.js \ - scripts/superfish.js \ - style/narrow.css \ - style/superfish.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/narrow.css \ + style/superfish.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css qhp.Assistant.filterAttributes = qt 4.7.0 tools assistant qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index 0cff98e..7628519 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -31,32 +31,32 @@ qhp.Qml.indexTitle = Qml Reference # Files not referenced in any qdoc file # See also extraimages.HTML qhp.Qml.extraFiles = images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/arrow-down.png \ - images/spinner.png \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/OfflineStyle.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/arrow-down.png \ + images/spinner.png \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/OfflineStyle.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css qhp.Qml.filterAttributes = qt 4.7.0 qtrefdoc qhp.Qml.customFilters.Qt.name = Qt 4.7.0 diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf index 1ec0c6b..7387810 100644 --- a/tools/qdoc3/test/qt-api-only.qdocconf +++ b/tools/qdoc3/test/qt-api-only.qdocconf @@ -30,10 +30,7 @@ qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \ # Remove the QML documentation from the Qt-only documentation. -excludedirs += $QT_SOURCE_TREE/src/declarative \ - $QT_SOURCE_TREE/src/imports \ - $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/declarative \ - $QT_SOURCE_TREE/doc/src/declarative +excludedirs += $QT_SOURCE_TREE/src/imports outputdir = $QT_BUILD_TREE/doc-build/html-qt tagfile = $QT_BUILD_TREE/doc-build/html-qt/qt.tags diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index f663016..415457e 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -21,6 +21,7 @@ qhp.Qt.file = qt.qhp qhp.Qt.namespace = com.trolltech.qt.470 qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation +qhp.Qt.indexRoot = # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 08492e3..a5e6578 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -9,9 +9,9 @@ versionsym = version = %VERSION% description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.7 -online = false +online = true offline = false -creator = true +creator = false sourceencoding = UTF-8 outputencoding = UTF-8 -- cgit v0.12 From b7256b1f8c9bb43c5234d24453aaa8b1c079cf06 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 2 Aug 2010 13:21:05 +0200 Subject: Fixed potential infinite loop in QFileSystemWatcher on Mac. The patch provided by the customer just jumps to reading the next event fom the kqueue when an unexpected condition happens. Task-number: QTBUG-12533 Reviewed-by: Bradley T. Hughes --- src/corelib/io/qfilesystemwatcher_kqueue.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index 99c165e..378ad20 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -295,12 +295,12 @@ void QKqueueFileSystemWatcherEngine::run() path = idToPath.value(id); if (path.isEmpty()) { DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent for a file we're not watching"; - continue; + goto process_next_event; } } if (kev.filter != EVFILT_VNODE) { DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent with the wrong filter"; - continue; + goto process_next_event; } if ((kev.fflags & (NOTE_DELETE | NOTE_REVOKE | NOTE_RENAME)) != 0) { @@ -337,6 +337,7 @@ void QKqueueFileSystemWatcherEngine::run() } // are there any more? +process_next_event: r = kevent(kqfd, 0, 0, &kev, 1, &ZeroTimeout); } while (r > 0); } -- cgit v0.12 From 5f87e737219b6b22d532c0f3df659995a509b6e6 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 2 Aug 2010 14:47:13 +0200 Subject: doc: Fixed many qdoc errors. --- src/3rdparty/libconninet/src/dbusdispatcher.cpp | 2 +- src/declarative/graphicsitems/qdeclarativeitem.cpp | 75 ++++++++++++++++++++-- .../graphicsitems/qdeclarativetranslate.cpp | 8 --- src/gui/kernel/qpalette.cpp | 4 +- src/gui/s60framework/qs60maindocument.cpp | 6 ++ tools/qdoc3/test/qt-cpp-ignore.qdocconf | 1 + 6 files changed, 80 insertions(+), 16 deletions(-) diff --git a/src/3rdparty/libconninet/src/dbusdispatcher.cpp b/src/3rdparty/libconninet/src/dbusdispatcher.cpp index 7581982..f5b830a 100644 --- a/src/3rdparty/libconninet/src/dbusdispatcher.cpp +++ b/src/3rdparty/libconninet/src/dbusdispatcher.cpp @@ -31,7 +31,7 @@ namespace Maemo { /*! - \class DBusDispatcher + \class Maemo::DBusDispatcher \brief DBusDispatcher is a class, which is able to send DBUS method call messages and receive unicast signals from DBUS object. diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 2c295cd..50998eb 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -1432,11 +1432,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec */ /*! - \fn void QDeclarativeItem::childrenChanged() - \internal -*/ - -/*! \fn void QDeclarativeItem::focusChanged(bool) \internal */ @@ -2855,6 +2850,41 @@ void QDeclarativeItem::setSmooth(bool smooth) } /*! + \property QDeclarativeItem::anchors + \internal +*/ + +/*! + \property QDeclarativeItem::left + \internal +*/ + +/*! + \property QDeclarativeItem::right + \internal +*/ + +/*! + \property QDeclarativeItem::horizontalCenter + \internal +*/ + +/*! + \property QDeclarativeItem::top + \internal +*/ + +/*! + \property QDeclarativeItem::bottom + \internal +*/ + +/*! + \property QDeclarativeItem::verticalCenter + \internal +*/ + +/*! \property QDeclarativeItem::focus \internal */ @@ -2875,6 +2905,41 @@ void QDeclarativeItem::setSmooth(bool smooth) */ /*! + \property QDeclarativeItem::baseline + \internal +*/ + +/*! + \property QDeclarativeItem::data + \internal +*/ + +/*! + \property QDeclarativeItem::resources + \internal +*/ + +/*! + \property QDeclarativeItem::state + \internal +*/ + +/*! + \property QDeclarativeItem::states + \internal +*/ + +/*! + \property QDeclarativeItem::transformOriginPoint + \internal +*/ + +/*! + \property QDeclarativeItem::transitions + \internal +*/ + +/*! \internal Return the width of the item */ diff --git a/src/declarative/graphicsitems/qdeclarativetranslate.cpp b/src/declarative/graphicsitems/qdeclarativetranslate.cpp index be9b3f3..0bae0cd 100644 --- a/src/declarative/graphicsitems/qdeclarativetranslate.cpp +++ b/src/declarative/graphicsitems/qdeclarativetranslate.cpp @@ -125,12 +125,4 @@ void QDeclarativeTranslate::applyTo(QMatrix4x4 *matrix) const matrix->translate(d->x, d->y, 0); } -/*! - \fn QDeclarativeTranslate::positionChanged() - - QDeclarativeTranslate emits this signal when its position changes. - - \sa QDeclarativeTranslate::x, QDeclarativeTranslate::y -*/ - QT_END_NAMESPACE diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index 38ec806..55d5727 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -872,7 +872,7 @@ void QPalette::detach() \note The current ColorGroup is not taken into account when comparing palettes - \sa operator== + \sa operator==() */ /*! @@ -882,7 +882,7 @@ void QPalette::detach() \note The current ColorGroup is not taken into account when comparing palettes - \sa operator!= + \sa operator!=() */ bool QPalette::operator==(const QPalette &p) const { diff --git a/src/gui/s60framework/qs60maindocument.cpp b/src/gui/s60framework/qs60maindocument.cpp index ed33a41..26e2d00 100644 --- a/src/gui/s60framework/qs60maindocument.cpp +++ b/src/gui/s60framework/qs60maindocument.cpp @@ -105,11 +105,17 @@ CEikAppUi *QS60MainDocument::CreateAppUiL() return (static_cast (new(ELeave)QS60MainAppUi)); } +/*! + \internal + */ CFileStore *QS60MainDocument::OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs) { return QS60MainDocumentBase::OpenFileL(aDoOpen, aFilename, aFs); } +/*! + \internal + */ void QS60MainDocument::OpenFileL(CFileStore *&aFileStore, RFile &aFile) { QS60MainDocumentBase::OpenFileL(aFileStore, aFile); diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf index 4963b96..b78b512 100644 --- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf +++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf @@ -64,6 +64,7 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \ Q_XMLSTREAM_EXPORT \ Q_XMLPATTERNS_EXPORT \ QDBUS_EXPORT \ + Q_DBUS_EXPORT \ QT_BEGIN_NAMESPACE \ QT_BEGIN_INCLUDE_NAMESPACE \ QT_END_NAMESPACE \ -- cgit v0.12 From b9767be7c1f52c95e1040175b8496e4ef49ac961 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 2 Aug 2010 15:27:20 +0200 Subject: Doc: adding changes to getting started and fixing redirection links --- doc/src/files-and-resources/resources.qdoc | 2 +- .../frameworks-technologies/eventsandfilters.qdoc | 2 +- doc/src/getting-started/gettingstarted.qdoc | 26 +++++++++++----------- doc/src/internationalization/linguist-manual.qdoc | 4 ++-- doc/src/porting/porting4.qdoc | 14 ++++++------ doc/src/qt-webpages.qdoc | 8 +++---- doc/src/widgets-and-layouts/layout.qdoc | 2 +- tools/qdoc3/test/qt-html-templates.qdocconf | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/doc/src/files-and-resources/resources.qdoc b/doc/src/files-and-resources/resources.qdoc index b0b0e3c..3177af8 100644 --- a/doc/src/files-and-resources/resources.qdoc +++ b/doc/src/files-and-resources/resources.qdoc @@ -54,7 +54,7 @@ The resource system is based on tight cooperation between \l qmake, \l rcc (Qt's resource compiler), and QFile. It obsoletes Qt 3's \c qembed tool and the - \l{http://qt.nokia.com/doc/qq/qq05-iconography.html#imagestorage}{image + \l{http://doc.qt.nokia.com/qq/qq05-iconography.html}{image collection} mechanism. \section1 Resource Collection Files (\c{.qrc}) diff --git a/doc/src/frameworks-technologies/eventsandfilters.qdoc b/doc/src/frameworks-technologies/eventsandfilters.qdoc index e792161..fb14a3b 100644 --- a/doc/src/frameworks-technologies/eventsandfilters.qdoc +++ b/doc/src/frameworks-technologies/eventsandfilters.qdoc @@ -100,7 +100,7 @@ event delivery mechanisms are flexible. The documentation for QCoreApplication::notify() concisely tells the whole story; the \e{Qt Quarterly} article - \l{http://qt.nokia.com/doc/qq/qq11-events.html}{Another Look at Events} + \l{http://doc.qt.nokia.com/qq/qq11-events.html}{Another Look at Events} rehashes it less concisely. Here we will explain enough for 95% of applications. diff --git a/doc/src/getting-started/gettingstarted.qdoc b/doc/src/getting-started/gettingstarted.qdoc index 391aec3..9b6b5d5 100644 --- a/doc/src/getting-started/gettingstarted.qdoc +++ b/doc/src/getting-started/gettingstarted.qdoc @@ -62,7 +62,7 @@ 12 } \endcode - Let's go through the code line by line. In the first two lines, we + Let us go through the code line by line. In the first two lines, we include the header files for QApplication and QTextEdit, which are the two classes that we need for this example. All Qt classes have a header file named after them. @@ -97,9 +97,9 @@ following shell commands build the program. \code - vattekar@positive:~/testing/gssnippets/part1$ qmake -project - vattekar@positive:~/testing/gssnippets/part1$ qmake - vattekar@positive:~/testing/gssnippets/part1$ make + qmake -project + qmake + make \endcode This will leave an executable in the \c part1 directory (note that @@ -134,7 +134,7 @@ \image gs2.png - Let's take a look at the code. + Let us take a look at the code. \code 1 #include @@ -217,7 +217,7 @@ \image gs3.png - Let's look at the code: + Let us look at the code: \code 5 class Notepad : public QWidget @@ -275,7 +275,7 @@ We now use the function \l{QObject::}{tr()} around our user visible strings. This function is necessary when you want to provide your application in more than one language (e.g. English - and Chinese). We won't go into details here, but you can follow + and Chinese). We will not go into details here, but you can follow the \c {Qt Linguist} link from the learn more table. \section2 Learn More @@ -312,8 +312,8 @@ The following shell commands build the example. \code - vattekar@positive:~/testing/gssnippets/part3$ qmake - vattekar@positive:~/testing/gssnippets/part3$ make + qmake + make \endcode \section1 Using a QMainWindow @@ -326,7 +326,7 @@ \image gs4.png - Let's look at the new \c Notepad class definition. + Let us look at the new \c Notepad class definition. \code #include @@ -422,7 +422,7 @@ \image gs5.png - Let's start with the \c open() slot: + We will start with the \c open() slot: \code QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", @@ -451,7 +451,7 @@ If we have a file name, we try to open the file with \l{QIODevice::}{open()}, which returns true if the file could be - opened. We won't go into error handling here, but you can follow + opened. We will not go into error handling here, but you can follow the links from the learn more section. If the file could not be opened, we use QMessageBox to display a dialog with an error message (see the QMessageBox class description for further @@ -465,7 +465,7 @@ edit. We then \l{QIODevice::}{close()} the file to return the file descriptor back to the operating system. - Now, let's move on to the the \c save() slot. + Now, let us move on to the the \c save() slot. \code QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "", diff --git a/doc/src/internationalization/linguist-manual.qdoc b/doc/src/internationalization/linguist-manual.qdoc index c8d8e9d..fa992af 100644 --- a/doc/src/internationalization/linguist-manual.qdoc +++ b/doc/src/internationalization/linguist-manual.qdoc @@ -1414,8 +1414,8 @@ \c -pluralonly command line option, which allows the creation of TS files containing only entries with plural forms. - See the \l{http://qt.nokia.com/doc/qq/}{Qt Quarterly} Article - \l{http://qt.nokia.com/doc/qq/qq19-plurals.html}{Plural Forms in Translations} + See the \l{http://doc.qt.nokia.com/qq/}{Qt Quarterly} Article + \l{http://doc.qt.nokia.com/qq/qq19-plurals.html}{Plural Forms in Translations} for further details on this issue. \section2 Coping With C++ Namespaces diff --git a/doc/src/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc index f355e7b..0bbf35f 100644 --- a/doc/src/porting/porting4.qdoc +++ b/doc/src/porting/porting4.qdoc @@ -472,7 +472,7 @@ \section1 Explicit Sharing Qt 4 is the first version of Qt that contains no \link - http://qt.nokia.com/doc/3.3/shclass.html explicitly shared + http://doc.qt.nokia.com/3.3/shclass.html explicitly shared \endlink classes. All classes that were explicitly shared in Qt 3 are \e implicitly shared in Qt 4: @@ -1079,7 +1079,7 @@ ensuring that the string is '\\0'-terminated. Another important issue was that conversions between \c QCString and QByteArray often gave confusing results. (See the - \l{http://qt.nokia.com/doc/qq/qq05-achtung.html#qcstringisastringofchars}{Achtung! + \l{http://doc.qt.nokia.com/qq/qq05-achtung.html#qcstringisastringofchars}{Achtung! Binary and Character Data} article in \e{Qt Quarterly} for an overview of the pitfalls.) @@ -2440,13 +2440,13 @@ that provides the old semantics. See the Q3Painter documentation for details and for the reasons why we had to make this change. - The \l{http://qt.nokia.com/doc/3.3/qpainter.html#CoordinateMode-enum}{QPainter::CoordinateMode} + The \l{http://doc.qt.nokia.com/3.3/qpainter.html#CoordinateMode-enum}{QPainter::CoordinateMode} enum has been removed in Qt 4. All clipping operations are now defined using logical coordinates and are subject to transformation operations. The - \l{http://qt.nokia.com/doc/3.3/qpainter.html#RasterOP-enum}{QPainter::RasterOP} + \l{http://doc.qt.nokia.com/3.3/qpainter.html#RasterOP-enum}{QPainter::RasterOP} enum has been replaced with QPainter::CompositionMode. \section1 QPicture @@ -3258,7 +3258,7 @@ \list \o If you use Q3SocketDevice in a thread to perform blocking network I/O (a technique encouraged by the \e{Qt Quarterly} - article \l{http://qt.nokia.com/doc/qq/qq09-networkthread.html} + article \l{http://doc.qt.nokia.com/qq/qq09-networkthread.html} {Unblocking Networking}), you can now use QTcpSocket, QFtp, or QNetworkAccessManager, which can be used from non-GUI threads. @@ -4052,7 +4052,7 @@ Sample code on how to do obtain similar behavior from Qt 4, previously handled by some of the above functions can be found in the - \l{http://qt.nokia.com/doc/qwidget-qt3.html}{Qt 3 Support Members for QWidget} + \l{http://doc.qt.nokia.com/qwidget-qt3.html}{Qt 3 Support Members for QWidget} page. A widget now receives change events in its QWidget::changeEvent() @@ -4150,7 +4150,7 @@ clearWFlags() has no direct replacement. You can use QWidget::setAttribute() instead. For example, \c{setAttribute(..., false)} to clear an attribute. More information - is available \l{http://qt.nokia.com/doc/qwidget.html#setAttribute}{here}. + is available \l{http://doc.qt.nokia.com/qwidget.html#setAttribute}{here}. testWFlags() was renamed to \l{QWidget::testAttribute()}{testAttribute()}. diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc index 89d564f..0c61285 100644 --- a/doc/src/qt-webpages.qdoc +++ b/doc/src/qt-webpages.qdoc @@ -141,7 +141,7 @@ */ /*! - \externalpage http://qt.nokia.com/doc/supported-platforms.html + \externalpage http://doc.qt.nokia.com/supported-platforms.html \title Platform Support Policy */ @@ -151,7 +151,7 @@ */ /*! - \externalpage http://qt.nokia.com/doc/supported-platforms.html + \externalpage http://doc.qt.nokia.com/supported-platforms.html \title Qt 4 Platforms Overview */ @@ -161,7 +161,7 @@ */ /*! - \externalpage http://qt.nokia.com/doc/qq/ + \externalpage http://doc.qt.nokia.com/qq/ \title Qt Quarterly */ @@ -181,7 +181,7 @@ */ /*! - \externalpage http://qt.nokia.com/doc/qtcanvas + \externalpage http://doc.qt.nokia.com/qtcanvas \title QtCanvas */ diff --git a/doc/src/widgets-and-layouts/layout.qdoc b/doc/src/widgets-and-layouts/layout.qdoc index aa4a933..798a7a1 100644 --- a/doc/src/widgets-and-layouts/layout.qdoc +++ b/doc/src/widgets-and-layouts/layout.qdoc @@ -242,7 +242,7 @@ For further guidance when implementing these functions, see the \e{Qt Quarterly} article - \l{http://qt.nokia.com/doc/qq/qq04-height-for-width.html} + \l{http://doc.qt.nokia.com/qq/qq04-height-for-width.html} {Trading Height for Width}. diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index e439708..cf15628 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -30,7 +30,7 @@ HTML.postheader = "
\n" \ "
\n" \ " \n" \ "
\n" \ -- cgit v0.12 From aff888a3e7f3d9ee2c5611c2dd5c0ff1693752c6 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 2 Aug 2010 17:04:14 +0200 Subject: configure: don't symlink the mkspecs/features directory In shadow builds, the directory QT_BUILD_TREE/mkspecs/features isn't a mere symlink anymore. The directories below mkspecs/features are copied and every single file is symlinked. This makes it possible to place .prf files into a shadow build's mkspecs/features directory, like Qt Mobility does with its mobility.prf, without polluting the source directory. Task-number: QTBUG-12545 Reviewed-by: ossi --- configure | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure b/configure index c61250b..52a4063 100755 --- a/configure +++ b/configure @@ -2397,6 +2397,14 @@ if [ "$OPT_SHADOW" = "yes" ]; then ln -s "$relpath"/mkspecs/* "$outpath/mkspecs" rm -f "$outpath/mkspecs/default" + # Special case for mkspecs/features directory. + # To be able to place .prf files into a shadow build directory, + # we're creating links for files only. The directory structure is reproduced. + # A simple "cp -rs" doesn't work on Mac. :( + rm -rf "$outpath/mkspecs/features" + find "$relpath/mkspecs/features" -type d | sed "s,^$relpath,$outpath," | xargs mkdir -p + find "$relpath/mkspecs/features" -type f | sed "s,^$relpath/,," | xargs -n 1 -I % ln -s "$relpath/%" "$outpath/%" + # symlink the doc directory rm -rf "$outpath/doc" ln -s "$relpath/doc" "$outpath/doc" -- cgit v0.12 From 00fb79714162ea3e434cf66a87a70a4fc26b2b86 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 2 Aug 2010 17:17:49 +0200 Subject: Fix Japanese characters not displayed in webkit on Mac Cocoa 64 (Regression) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our stringToCMap implementation for CoreText that bypasses the shaping needs to have basic support for font cascading / glyph substitution. We now use CTFontCreateForString to determine the substitute font for missing glyphs. Task-number: QTBUG-12411 Reviewed-by: Tor Arne Vestbø --- src/gui/text/qfontengine_mac.mm | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index deaad57..91b6082 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -349,11 +349,32 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay int *nglyphs, QTextEngine::ShaperFlags flags) const { *nglyphs = len; + QCFType cfstring; + QVarLengthArray cgGlyphs(len); CTFontGetGlyphsForCharacters(ctfont, (const UniChar*)str, cgGlyphs.data(), len); - for (int i = 0; i < len; ++i) - glyphs->glyphs[i] = cgGlyphs[i]; + for (int i = 0; i < len; ++i) { + if (cgGlyphs[i]) { + glyphs->glyphs[i] = cgGlyphs[i]; + } else { + if (!cfstring) + cfstring = CFStringCreateWithCharactersNoCopy(0, reinterpret_cast(str), len, kCFAllocatorNull); + QCFType substituteFont = CTFontCreateForString(ctfont, cfstring, CFRangeMake(i, 1)); + CGGlyph substituteGlyph = 0; + CTFontGetGlyphsForCharacters(substituteFont, (const UniChar*)str + i, &substituteGlyph, 1); + if (substituteGlyph) { + const uint fontIndex = (fontIndexForFont(substituteFont) << 24); + glyphs->glyphs[i] = substituteGlyph | fontIndex; + if (!(flags & QTextEngine::GlyphIndicesOnly)) { + CGSize advance; + CTFontGetAdvancesForGlyphs(substituteFont, kCTFontHorizontalOrientation, &substituteGlyph, &advance, 1); + glyphs->advances_x[i] = QFixed::fromReal(advance.width); + glyphs->advances_y[i] = QFixed::fromReal(advance.height); + } + } + } + } if (flags & QTextEngine::GlyphIndicesOnly) return true; @@ -362,9 +383,14 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay CTFontGetAdvancesForGlyphs(ctfont, kCTFontHorizontalOrientation, cgGlyphs.data(), advances.data(), len); for (int i = 0; i < len; ++i) { + if (glyphs->glyphs[i] & 0xff000000) + continue; glyphs->advances_x[i] = QFixed::fromReal(advances[i].width); glyphs->advances_y[i] = QFixed::fromReal(advances[i].height); - if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) { + } + + if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) { + for (int i = 0; i < len; ++i) { glyphs->advances_x[i] = glyphs->advances_x[i].round(); glyphs->advances_y[i] = glyphs->advances_y[i].round(); } -- cgit v0.12 From e55fd8c9790863f2d6001bda617a9d87be61f29b Mon Sep 17 00:00:00 2001 From: Kevin Wright Date: Mon, 2 Aug 2010 17:43:42 +0200 Subject: Modified qtdemo so error does not appear when there is no demo/example description availablei (QTBUG-12522). There is already output when building Qt that a description is missing -- the user does not need to witness an error about ensuring the documentation has been built just because a description has not been contributed. --- demos/qtdemo/examplecontent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/qtdemo/examplecontent.cpp b/demos/qtdemo/examplecontent.cpp index 19be3e0..65c078d 100644 --- a/demos/qtdemo/examplecontent.cpp +++ b/demos/qtdemo/examplecontent.cpp @@ -91,8 +91,8 @@ QString ExampleContent::loadDescription() if (paragraphs.length() < 1 && Colors::verbose) qDebug() << "- ExampleContent::loadDescription(): Could not load description:" << MenuManager::instance()->info[this->name]["docfile"]; - QString description = Colors::contentColor + - QLatin1String("Could not load description. Ensure that the documentation for Qt is built."); + QString description = Colors::contentColor + QLatin1String(""); + //QLatin1String("Could not load description. Ensure that the documentation for Qt is built."); // QTBUG-12522: If there is no description why show an error to the user when qDebug above communications the issue (if it is indeed an issue at all) when demos are built? for (int p = 0; p < int(paragraphs.length()); ++p) { description = this->extractTextFromParagraph(paragraphs.item(p)); if (this->isSummary(description)) { -- cgit v0.12 From 41ae34d84a2d5024b5d42a25a2bf97b6a6dd8412 Mon Sep 17 00:00:00 2001 From: Kevin Wright Date: Mon, 2 Aug 2010 18:04:35 +0200 Subject: Added notice that some links are online documents. --- doc/src/index.qdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 4acf212..9df7641 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -94,12 +94,12 @@
-- cgit v0.12 From 5e61d763ec24016a92bb91e5eb39c54d9e28b913 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 2 Aug 2010 20:04:55 +0200 Subject: Doc: updating index page, x platform and platform spec. Removing redundant style files --- doc/src/development/developing-with-qt.qdoc | 61 ++++++- doc/src/index.qdoc | 6 +- doc/src/template/style/OfflineStyle.css | 251 ---------------------------- doc/src/template/style/superfish_skin.css | 83 --------- 4 files changed, 61 insertions(+), 340 deletions(-) delete mode 100644 doc/src/template/style/OfflineStyle.css delete mode 100644 doc/src/template/style/superfish_skin.css diff --git a/doc/src/development/developing-with-qt.qdoc b/doc/src/development/developing-with-qt.qdoc index ffc5a8e..f9b38b8 100644 --- a/doc/src/development/developing-with-qt.qdoc +++ b/doc/src/development/developing-with-qt.qdoc @@ -27,12 +27,22 @@ /*! \page developing-with-qt.html - \title Cross Platform Development with Qt + + \title Cross-platform & Platform-specific Development + Qt allows you to write advanced applications and UIs once, and deploy them + across desktop and embedded operating systems without rewriting the source + code. The top section of this page provides an overview of the tools and + techniques used in Qt application development. Still, you might want to add + platform-specific features to your code. The bottom section of the page + links to documents that describe platform-specific features provided by Qt, + and discuss issues related to particular platforms and environments. + + \section1 Cross-platform Development with Qt Qt is provided with a set of build tools to help developers automate the process of building and installing Qt applications. - \table 100% + \table \header \o Development \o Cross-Platform Issues \o Specific Tools \row \o @@ -57,4 +67,49 @@ \o \l {Resource Compiler (rcc)} \endlist \endtable -*/ + + \section1 Platform-specific Development with Qt + + These documents describe platform-specific features provided by Qt, and + discuss issues related to particular platforms and environments. + + \table + \row + \o + \list + \o \l {Calling Qt Functions From Unix Signal Handlers} + \o \l {Compiler Notes} + \o \l {Developing Qt Applications for Mac OS X} + \o \l {Known Issues} + \o \l {Platform Notes} + \o \l {Platform Notes - Symbian} + \o \l {Qt For ActiveX} + \o \l {Qt for Embedded Linux Classes} + \o \l {Qt for Embedded Platforms} + \o \l {Qt for Mac OS X - Specific Issues} + \o \l {Qt is Mac OS X Native} + \o \l {Supported Platforms} + \o \l {The qtmain Library} + \o \l {Window System Specific Notes} + \endlist + \o + \list + \o Workaround to make it work. + \o Information about the C++ compilers and tools used to build Qt. + \o Information for developing Qt applications for Mac OS X + \o A summary of known issues in this Qt version at the time of release. + \o Information about the platforms on which Qt can be used. + \o Information about the state of support for the Symbian platform. + \o Qt API's for using ActiveX controls, servers, and COM. + \o Classes that are specific to Qt for Embedded Linux. + \o Documents related to Qt for Embedded Platforms. + \o A description of issues with Qt that are specific to Mac OS X. + \o An explanation of Qt's native features on Mac OS X. + \o The platforms supported by Nokia for Qt. + \o Describes the use and license of the qtmain helper library. + \o Collections of notes about Qt implementations on different window systems. + \endlist + \endtable + + +*/ \ No newline at end of file diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 4acf212..55c7545 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -65,8 +65,8 @@ diff --git a/doc/src/template/style/OfflineStyle.css b/doc/src/template/style/OfflineStyle.css deleted file mode 100644 index 9f5d28b..0000000 --- a/doc/src/template/style/OfflineStyle.css +++ /dev/null @@ -1,251 +0,0 @@ -@media screen -{ - - .wrapper - { - top:50px; - background: none; - - } - .wrapper .bd - { - background: none; - position: relative; - } - - - - - body.offline - { - background-image: none; - background-color: #FFFFFF; - - } - - .offline .footer { - margin: 0; - } - .offline .header - { - width: 100%; - margin: 0; - height: auto; - background-color: #ffffff; - padding: 10px 0 5px 0; - overflow: visible; - border-bottom: solid #E5E5E5 1px; - z-index:1; - position:fixed; - } - - .offline .header .content - { - } - .offline .header .qtref - { - color: #00732F; - position: static; - float: left; - margin-left: 5px; - font: bold 18px/1 Arial; - } - - .offline .header .qtref:visited - { - color: #00732F; - } - .offline .header .qtref:hover - { - color: #00732F; - text-decoration:none; - } - .offline .header .qtref span - { - background-image: none; - text-indent: 0; - text-decoration:none; - } - - .offline .wrap - { - margin: 0 5px 0 5px; - } - - .offline .wrap .toolbar - { - display:block; - padding-top:5px; - } - - .offline .wrap .breadcrumb ul li { - font-weight: normal; - } - - .offline .wrap .breadcrumb ul li a { - /*color: #44a51c;*/ - } - - .offline .wrap .breadcrumb ul li.last a { - /*color: #363534;*/ - } - - - - .narrow .indexboxcont .section { - width: 64%; - padding-left: 0; - } - - .narrow .indexboxcont .sectionlist { - width: 32.5%; - } - - .header .icon, - .sidebar, - .feedback, - .t_button, - .feedback, - #feedbackBox, - #feedback, - #blurpage, - .indexbox .indexIcon span, - .wrapper .hd, - .offline .indexbox .indexIcon, - .offline .header #nav-logo, - #offlinemenu, - #offlinesearch, - .offline .header #nav-topright, - .offline .header #shortCut , - .offline .wrapper .hd, - .offline .wrapper .ft, - .offline .sidebar, - .offline .wrap .feedback - { - display:none; - } - - /* end offline mode */ -#narrowmenu { - display: none; - float: right; - margin: 15px 40px 0 0; - font-size: 11px; - } - - .narrow #narrowmenu { - display: block; - } - - #narrowsearch{ - display:none; - } - - #narrowmenu ul - { - border-bottom:solid 1px #E5E5E5; - border-left:solid 1px #E5E5E5; - border-right:solid 1px #E5E5E5; - } - - #narrowmenu a { - line-height: 1.1; - background: url(../images/arrow_down.png) no-repeat 100% 50%; - white-space: nowrap; - padding: 0 16px 0 5px; - } - - #narrowmenu li { - margin-left: 20px; - } - - #narrowmenu li li { - margin: 0 0 5px 0; - } - - #narrowmenu li li a { - padding: 0; - background-image: none; - } - - #narrowmenu li, - #narrowmenu li ul { - background-color: #fff; - } - - #narrowmenu li ul { - width: auto; - padding: 5px; - margin-top:-15px; - } - - .sf-menu li:hover ul, .sf-menu li.sfHover ul { - top: 1.2em; - } -.sf-menu, .sf-menu * { - margin: 0; - padding: 0; - list-style: none; -} -.sf-menu { - line-height: 1.0; -} -.sf-menu ul { - position: absolute; - top: -999em; - width: 10em; /* left offset of submenus need to match (see below) */ -} -.sf-menu ul li { - width: 100%; -} -.sf-menu li:hover { - visibility: inherit; /* fixes IE7 'sticky bug' */ -} -.sf-menu li { - float: left; - position: relative; -} -.sf-menu a { - display: block; - position: relative; -} -.sf-menu li:hover ul, -.sf-menu li.sfHover ul { - left: 0; - top: 2.5em; /* match top ul list item height */ - z-index: 99; -} -ul.sf-menu li:hover li ul, -ul.sf-menu li.sfHover li ul { - top: -999em; -} -ul.sf-menu li li:hover ul, -ul.sf-menu li li.sfHover ul { - left: 10em; /* match ul width */ - top: 0; -} -ul.sf-menu li li:hover li ul, -ul.sf-menu li li.sfHover li ul { - top: -999em; -} -ul.sf-menu li li li:hover ul, -ul.sf-menu li li li.sfHover ul { - left: 10em; /* match ul width */ - top: 0; -} - .wrap .content ol li { - background:none; - font:400 10pt/1 Verdana; - margin-bottom:10px; - margin-left:12px; - } - .wrap .content ol li { - list-style-type:decimal; - - } - - - -} -/* end of screen media */ - diff --git a/doc/src/template/style/superfish_skin.css b/doc/src/template/style/superfish_skin.css deleted file mode 100644 index 8d84827..0000000 --- a/doc/src/template/style/superfish_skin.css +++ /dev/null @@ -1,83 +0,0 @@ - -/*** DEMO SKIN ***/ -.sf-menu { - float: left; - margin-bottom: 1em; -} -.sf-menu a { - border-left: 1px solid #fff; - border-top: 1px solid #CFDEFF; - padding: .75em 1em; - text-decoration:none; -} -.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/ - color: #13a; -} -.sf-menu li { - background: #BDD2FF; -} -.sf-menu li li { - background: #AABDE6; -} -.sf-menu li li li { - background: #9AAEDB; -} -.sf-menu li:hover, .sf-menu li.sfHover, -.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { - background: #CFDEFF; - outline: 0; -} - -/*** arrows **/ -.sf-menu a.sf-with-ul { - padding-right: 2.25em; - min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */ -} -.sf-sub-indicator { - position: absolute; - display: block; - right: .75em; - top: 1.05em; /* IE6 only */ - width: 10px; - height: 10px; - text-indent: -999em; - overflow: hidden; - background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ -} -a > .sf-sub-indicator { /* give all except IE6 the correct values */ - top: .8em; - background-position: 0 -100px; /* use translucent arrow for modern browsers*/ -} -/* apply hovers to modern browsers */ -a:focus > .sf-sub-indicator, -a:hover > .sf-sub-indicator, -a:active > .sf-sub-indicator, -li:hover > a > .sf-sub-indicator, -li.sfHover > a > .sf-sub-indicator { - background-position: -10px -100px; /* arrow hovers for modern browsers*/ -} - -/* point right for anchors in subs */ -.sf-menu ul .sf-sub-indicator { background-position: -10px 0; } -.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; } -/* apply hovers to modern browsers */ -.sf-menu ul a:focus > .sf-sub-indicator, -.sf-menu ul a:hover > .sf-sub-indicator, -.sf-menu ul a:active > .sf-sub-indicator, -.sf-menu ul li:hover > a > .sf-sub-indicator, -.sf-menu ul li.sfHover > a > .sf-sub-indicator { - background-position: -10px 0; /* arrow hovers for modern browsers*/ -} - -/*** shadows for all but IE6 ***/ -.sf-shadow ul { - background: url('../images/shadow.png') no-repeat bottom right; - padding: 0 8px 9px 0; - -moz-border-radius-bottomleft: 17px; - -moz-border-radius-topright: 17px; - -webkit-border-top-right-radius: 17px; - -webkit-border-bottom-left-radius: 17px; -} -.sf-shadow ul.sf-shadow-off { - background: transparent; -} -- cgit v0.12 From ed6d7222894a9bdc804d8c64845e2f0f356d2c01 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Tue, 3 Aug 2010 11:09:37 +1000 Subject: Update def files. --- src/s60installs/bwins/QtNetworku.def | 2 ++ src/s60installs/eabi/QtNetworku.def | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def index 48af60c..2cf62a8 100644 --- a/src/s60installs/bwins/QtNetworku.def +++ b/src/s60installs/bwins/QtNetworku.def @@ -1143,4 +1143,6 @@ EXPORTS ?setNetworkAccessible@QNetworkAccessManager@@QAEXW4NetworkAccessibility@1@@Z @ 1142 NONAME ; void QNetworkAccessManager::setNetworkAccessible(enum QNetworkAccessManager::NetworkAccessibility) ??_EQBearerEngineFactoryInterface@@UAE@I@Z @ 1143 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(unsigned int) ?enablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1144 NONAME ; void QNetworkConfigurationManagerPrivate::enablePolling(void) + ?bearerTypeName@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1145 NONAME ; class QString QNetworkConfiguration::bearerTypeName(void) const + ?bearerType@QNetworkConfiguration@@QBE?AW4BearerType@1@XZ @ 1146 NONAME ; enum QNetworkConfiguration::BearerType QNetworkConfiguration::bearerType(void) const diff --git a/src/s60installs/eabi/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def index eb30832..6b34a19 100644 --- a/src/s60installs/eabi/QtNetworku.def +++ b/src/s60installs/eabi/QtNetworku.def @@ -1131,7 +1131,7 @@ EXPORTS _ZNK21QNetworkAccessManager13configurationEv @ 1130 NONAME _ZNK21QNetworkAccessManager17networkAccessibleEv @ 1131 NONAME _ZNK21QNetworkAccessManager19activeConfigurationEv @ 1132 NONAME - _ZNK21QNetworkConfiguration10bearerNameEv @ 1133 NONAME + _ZNK21QNetworkConfiguration10bearerNameEv @ 1133 NONAME ABSENT _ZNK21QNetworkConfiguration10identifierEv @ 1134 NONAME _ZNK21QNetworkConfiguration18isRoamingAvailableEv @ 1135 NONAME _ZNK21QNetworkConfiguration4nameEv @ 1136 NONAME @@ -1167,4 +1167,6 @@ EXPORTS _ZN14QAuthenticator9setOptionERK7QStringRK8QVariant @ 1166 NONAME _ZNK14QAuthenticator6optionERK7QString @ 1167 NONAME _ZNK14QAuthenticator7optionsEv @ 1168 NONAME + _ZNK21QNetworkConfiguration10bearerTypeEv @ 1169 NONAME + _ZNK21QNetworkConfiguration14bearerTypeNameEv @ 1170 NONAME -- cgit v0.12 From 972191f8e3bdbf702e11be8c0a72fca9e896f395 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Tue, 3 Aug 2010 15:33:11 +1000 Subject: Return 'Unknown' bearer type name for unknown bearer type. --- src/network/bearer/qnetworkconfiguration.cpp | 2 +- src/network/bearer/qnetworkconfiguration_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index b645916..3190a30 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -506,7 +506,7 @@ QString QNetworkConfiguration::bearerTypeName() const return QLatin1String("WiMAX"); } - return QString(); + return QLatin1String("Unknown"); } QT_END_NAMESPACE diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h index 0fc6ee9..2b0bbf6 100644 --- a/src/network/bearer/qnetworkconfiguration_p.h +++ b/src/network/bearer/qnetworkconfiguration_p.h @@ -81,7 +81,7 @@ public: virtual QString bearerTypeName() const { - return QString(); + return QLatin1String("Unknown"); } QMap serviceNetworkMembers; -- cgit v0.12 From 56cfbce20f736caa1ef74b5706fe3713ebd773c9 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 3 Aug 2010 09:24:54 +0200 Subject: Doc: Correcting bugs in the CSS --- doc/src/template/style/narrow.css | 21 +++++++++++++++++++-- doc/src/template/style/style.css | 6 ++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index 05159aa..e4ad135 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -15,7 +15,12 @@ } .narrow .footer { - margin: 0; + margin: 0px; + } + + .creator .header, .creator .header .content, .creator .footer, .creator .wrapper { + margin: 0px; + min-width: 300px; } .narrow .header { @@ -126,6 +131,11 @@ margin: 0 5px 0 5px; } + .creator .wrap + { + margin: 0px; + background:#FFFFFF; + } .narrow .wrap .toolbar { border-bottom: none; @@ -135,7 +145,14 @@ { padding-top: 15px; } - + .creator .wrap .content + { + padding-top: 10px; + } + .creator .wrap .content .guide + { + padding-top: 15px; + } .narrow .wrap .feedback { display: none; diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 9f80921..259591f 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -1345,7 +1345,7 @@ font: normal 13px/1.2 Verdana; color: #363534; - background-color: #FFFFFF; + background-color: #FAFAFA; } @@ -1406,7 +1406,9 @@ border-bottom:1px solid #E5E5E5; - width:100%, + /*width:100%;*/ + margin-left:-5px; + margin-right:-5px; } .creator .wrap .breadcrumb ul li a { -- cgit v0.12 From a53b98f9269e6ee0b524fe7477e8fb46f189f9d3 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 3 Aug 2010 09:49:14 +0200 Subject: Made changes to qdoc to allow it to accept a "style level" flag --- tools/qdoc3/config.h | 1 + tools/qdoc3/main.cpp | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h index b087b1c..7665f1a 100644 --- a/tools/qdoc3/config.h +++ b/tools/qdoc3/config.h @@ -119,6 +119,7 @@ class Config }; #define CONFIG_ALIAS "alias" +#define CONFIG_APPLICATION "application" #define CONFIG_BASE "base" // ### don't document for now #define CONFIG_CODEINDENT "codeindent" #define CONFIG_DEFINES "defines" diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 616ae2f..44f9572 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -105,6 +105,8 @@ static bool showInternal = false; static bool obsoleteLinks = false; static QStringList defines; static QHash trees; +static QString application = "base"; //application +static bool applicationArg = 0; //if 1, then the argument is provided and it will override the qdocconf file /*! Find the Tree for language \a lang and return a pointer to it. @@ -192,6 +194,38 @@ static void processQdocconfFile(const QString &fileName) config.load(fileName); /* + Set the application to which qdoc will create the output. + The three applications are: + base: simple, basic html output. Best suited for offline viewing + creator: additional formatting. + online: full-featured online version with search and links to Qt topics + + Note: This will override the offline, online, creator defines. + */ + if(applicationArg == false){ + + QString appConfig = config.getString(CONFIG_APPLICATION); + if (!appConfig.isEmpty()){ + application = appConfig; + } + } + if(application == "online"){ + config.setStringList(CONFIG_ONLINE, QStringList("true")); + config.setStringList(CONFIG_OFFLINE, QStringList("false")); + config.setStringList(CONFIG_CREATOR, QStringList("false")); + } + else if(application == "creator"){ + config.setStringList(CONFIG_ONLINE, QStringList("false")); + config.setStringList(CONFIG_OFFLINE, QStringList("true")); + config.setStringList(CONFIG_CREATOR, QStringList("false")); + } + else if(application == "base"){ + config.setStringList(CONFIG_ONLINE, QStringList("false")); + config.setStringList(CONFIG_OFFLINE, QStringList("false")); + config.setStringList(CONFIG_CREATOR, QStringList("true")); + } + + /* Add the defines to the configuration variables. */ QStringList defs = defines + config.getStringList(CONFIG_DEFINES); @@ -462,12 +496,24 @@ int main(int argc, char **argv) else if (opt == "-obsoletelinks") { obsoleteLinks = true; } + else if (opt == "-base") { + application = "base"; + applicationArg = true; + } + else if (opt == "-creator") { + application = "creator"; + applicationArg = true; + } + else if (opt == "-online") { + application = "online"; + applicationArg = true; + } else { qdocFiles.append(opt); } } - if (qdocFiles.isEmpty()) { + if (qdocFiles.isEmpty()) { printHelp(); return EXIT_FAILURE; } -- cgit v0.12 From 44e11692549f1d6a4fed01066a06085dacfaa444 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 3 Aug 2010 10:35:35 +0200 Subject: Cocoa: Active QDockWidget does not stay on top of inactive QDockWidget If a window has several child windows, it was not be possible to click on a child window to make it stack in front of the other children. The reason is that cocoa held a fixed stacking order of the child windows (sub-windows). This patch will release, and then reestablish, the stacking order of the children upon acitvation. Task-number: QTBUG-11780 Reviewed-by: prasanth --- src/gui/kernel/qapplication.cpp | 7 +++++++ src/gui/kernel/qt_cocoa_helpers_mac.mm | 16 ++++++++++++++++ src/gui/kernel/qt_cocoa_helpers_mac_p.h | 1 + 3 files changed, 24 insertions(+) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 5c333b0..3303800 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -2540,6 +2540,13 @@ void QApplication::setActiveWindow(QWidget* act) sendSpontaneousEvent(w, &activationChange); } +#ifdef QT_MAC_USE_COCOA + // In case the user clicked on a child window, we need to + // reestablish the stacking order of the window so + // it pops in front of other child windows in cocoa: + qt_cocoaStackChildWindowOnTopOfOtherChildren(window); +#endif + for(int i = 0; i < toBeDeactivated.size(); ++i) { QWidget *w = toBeDeactivated.at(i); sendSpontaneousEvent(w, &windowDeactivate); diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 3fc27f4..647cb86 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1527,6 +1527,22 @@ void macSyncDrawingOnFirstInvocation(void * /*OSWindowRef */window) [theWindow display]; } } + +void qt_cocoaStackChildWindowOnTopOfOtherChildren(QWidget *childWidget) +{ + if (!childWidget) + return; + + QWidget *parent = childWidget->parentWidget(); + if (childWidget->isWindow() && parent) { + if ([[qt_mac_window_for(parent) childWindows] containsObject:qt_mac_window_for(childWidget)]) { + QWidgetPrivate *d = qt_widget_private(childWidget); + d->setSubWindowStacking(false); + d->setSubWindowStacking(true); + } + } +} + #endif // QT_MAC_USE_COCOA QT_END_NAMESPACE diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h index 44fb4f0..c6c2db2 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h +++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h @@ -148,6 +148,7 @@ void qt_cocoaChangeOverrideCursor(const QCursor &cursor); // These methods exists only for supporting unified mode. void macDrawRectOnTop(void * /*OSWindowRef */ window); void macSyncDrawingOnFirstInvocation(void * /*OSWindowRef */window); +void qt_cocoaStackChildWindowOnTopOfOtherChildren(QWidget *widget); #endif void qt_mac_menu_collapseSeparators(void * /*NSMenu */ menu, bool collapse); bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEvent); -- cgit v0.12 From 79797d175c41198b0dffad1dced021a07c5873ae Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 3 Aug 2010 10:54:31 +0200 Subject: Doc: Adding content to installation guide and fixing printing bugs --- doc/src/getting-started/installation.qdoc | 7 +++++-- doc/src/template/style/style.css | 7 +++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 90723ec..629d8b7 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -30,10 +30,13 @@ \title Installation \brief Installing Qt on supported platforms. -The installation procedure is different on each Qt platform. -Please follow the instructions for your platform from the following list. +The installation procedure is different on each Qt platform. This page provides +information on how to install Qt, as well as software and hardware requirements +for using Qt on each of the supported platforms. Please follow the instructions +for your platform from the following list. \generatelist{related} + */ /*! \page install-x11.html diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 259591f..9b37693 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -1552,18 +1552,17 @@ @media print { - input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft + input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft, #feedbackBox, #blurpage, .toc, .breadcrumb, .toolbar, .floatingResult { display: none; background: none; } .content { - position: absolute; - top: 0px; - left: 0px; background: none; display: block; + width: 100%; margin: 0; float: none; + } } /* end of print media */ -- cgit v0.12 From 307601da8d3b64de7b7d83a6de0b5dac290b0eb6 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 3 Aug 2010 14:49:28 +0200 Subject: =?UTF-8?q?Crash=20when=20pressing=20the=20'=C2=A3'=20key=20on=20B?= =?UTF-8?q?elgian=20Keyboard=20layout=20(Cocoa)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In some cases the NSKeyDown event won't have fully constructed string in the [NSEvent characters]. So we need to add a guard before accessing the elements of this NSString. Task-number: QTBUG-12474 Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qt_cocoa_helpers_mac.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 647cb86..7d23abf 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -685,9 +685,11 @@ bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEve unsigned int info = 0; if ([event type] == NSKeyDown) { NSString *characters = [event characters]; - unichar value = [characters characterAtIndex:0]; - qt_keymapper_private()->updateKeyMap(0, key_event, (void *)&value); - info = value; + if ([characters length]) { + unichar value = [characters characterAtIndex:0]; + qt_keymapper_private()->updateKeyMap(0, key_event, (void *)&value); + info = value; + } } // Redirect keys to alien widgets. -- cgit v0.12 From 544d31b68c05ab70538bd34fd747b64d8b19f5de Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 3 Aug 2010 11:18:18 +0200 Subject: Unbreak QImage::rgbSwapped() for many image formats. These formats had broken rgbSwapped() implementations: argb8565, argb6666, rgb555, argb8555, rgb444, argb4444 Reviewed-by: Benjamin Poulain --- src/gui/image/qimage.cpp | 76 ++++++++++++++++++---------------------- tests/auto/qimage/tst_qimage.cpp | 66 ++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 41 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 30cf758..cb834c0 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4829,7 +4829,7 @@ QImage QImage::rgbSwapped() const QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { uint *q = (uint*)res.scanLine(i); - uint *p = (uint*)scanLine(i); + uint *p = (uint*)constScanLine(i); uint *end = p + d->width; while (p < end) { *q = ((*p << 16) & 0xff0000) | ((*p >> 16) & 0xff) | (*p & 0xff00ff00); @@ -4843,7 +4843,7 @@ QImage QImage::rgbSwapped() const QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { ushort *q = (ushort*)res.scanLine(i); - const ushort *p = (const ushort*)scanLine(i); + const ushort *p = (const ushort*)constScanLine(i); const ushort *end = p + d->width; while (p < end) { *q = ((*p << 11) & 0xf800) | ((*p >> 11) & 0x1f) | (*p & 0x07e0); @@ -4856,12 +4856,15 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - quint8 *p = (quint8*)scanLine(i); + const quint8 *p = constScanLine(i); + quint8 *q = res.scanLine(i); const quint8 *end = p + d->width * sizeof(qargb8565); while (p < end) { - quint16 *q = reinterpret_cast(p + 1); - *q = ((*q << 11) & 0xf800) | ((*q >> 11) & 0x1f) | (*q & 0x07e0); + q[0] = p[0]; + q[1] = (p[1] & 0xe0) | (p[2] >> 3); + q[2] = (p[2] & 0x07) | (p[1] << 3); p += sizeof(qargb8565); + q += sizeof(qargb8565); } } break; @@ -4870,7 +4873,7 @@ QImage QImage::rgbSwapped() const QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { qrgb666 *q = reinterpret_cast(res.scanLine(i)); - const qrgb666 *p = reinterpret_cast(scanLine(i)); + const qrgb666 *p = reinterpret_cast(constScanLine(i)); const qrgb666 *end = p + d->width; while (p < end) { const QRgb rgb = quint32(*p++); @@ -4882,12 +4885,15 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - qargb6666 *q = reinterpret_cast(res.scanLine(i)); - const qargb6666 *p = reinterpret_cast(scanLine(i)); - const qargb6666 *end = p + d->width; + const quint8 *p = constScanLine(i); + const quint8 *end = p + d->width * sizeof(qargb6666); + quint8 *q = res.scanLine(i); while (p < end) { - const QRgb rgb = quint32(*p++); - *q++ = qRgba(qBlue(rgb), qGreen(rgb), qRed(rgb), qAlpha(rgb)); + q[0] = (p[1] >> 4) | ((p[2] & 0x3) << 4) | (p[0] & 0xc0); + q[1] = (p[1] & 0xf) | (p[0] << 4); + q[2] = (p[2] & 0xfc) | ((p[0] >> 4) & 0x3); + p += sizeof(qargb6666); + q += sizeof(qargb6666); } } break; @@ -4895,11 +4901,11 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - ushort *q = (ushort*)res.scanLine(i); - const ushort *p = (const ushort*)scanLine(i); - const ushort *end = p + d->width; + quint16 *q = (quint16*)res.scanLine(i); + const quint16 *p = (const quint16*)constScanLine(i); + const quint16 *end = p + d->width; while (p < end) { - *q = ((*p << 10) & 0x7800) | ((*p >> 10) & 0x1f) | (*p & 0x83e0); + *q = ((*p << 10) & 0x7c00) | ((*p >> 10) & 0x1f) | (*p & 0x3e0); p++; q++; } @@ -4909,12 +4915,15 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - quint8 *p = (quint8*)scanLine(i); + const quint8 *p = constScanLine(i); + quint8 *q = res.scanLine(i); const quint8 *end = p + d->width * sizeof(qargb8555); while (p < end) { - quint16 *q = reinterpret_cast(p + 1); - *q = ((*q << 10) & 0x7800) | ((*q >> 10) & 0x1f) | (*q & 0x83e0); + q[0] = p[0]; + q[1] = (p[1] & 0xe0) | (p[2] >> 2); + q[2] = (p[2] & 0x03) | ((p[1] << 2) & 0x7f); p += sizeof(qargb8555); + q += sizeof(qargb8555); } } break; @@ -4922,8 +4931,8 @@ QImage QImage::rgbSwapped() const res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - quint8 *q = reinterpret_cast(res.scanLine(i)); - const quint8 *p = reinterpret_cast(scanLine(i)); + quint8 *q = res.scanLine(i); + const quint8 *p = constScanLine(i); const quint8 *end = p + d->width * sizeof(qrgb888); while (p < end) { q[0] = p[2]; @@ -4935,32 +4944,17 @@ QImage QImage::rgbSwapped() const } break; case Format_RGB444: - res = QImage(d->width, d->height, d->format); - QIMAGE_SANITYCHECK_MEMORY(res); - for (int i = 0; i < d->height; i++) { - quint8 *q = reinterpret_cast(res.scanLine(i)); - const quint8 *p = reinterpret_cast(scanLine(i)); - const quint8 *end = p + d->width * sizeof(qrgb444); - while (p < end) { - q[0] = (p[0] & 0xf0) | ((p[1] & 0x0f) << 8); - q[1] = ((p[0] & 0x0f) >> 8) | (p[1] & 0xf0); - q += sizeof(qrgb444); - p += sizeof(qrgb444); - } - } - break; case Format_ARGB4444_Premultiplied: res = QImage(d->width, d->height, d->format); QIMAGE_SANITYCHECK_MEMORY(res); for (int i = 0; i < d->height; i++) { - quint8 *q = reinterpret_cast(res.scanLine(i)); - const quint8 *p = reinterpret_cast(scanLine(i)); - const quint8 *end = p + d->width * sizeof(qargb4444); + quint16 *q = reinterpret_cast(res.scanLine(i)); + const quint16 *p = reinterpret_cast(constScanLine(i)); + const quint16 *end = p + d->width; while (p < end) { - q[0] = (p[0] & 0xf0) | ((p[1] & 0x0f) << 8); - q[1] = ((p[0] & 0x0f) >> 8) | (p[1] & 0xf0); - q += sizeof(qargb4444); - p += sizeof(qargb4444); + *q = (*p & 0xf0f0) | ((*p & 0x0f) << 8) | ((*p & 0xf00) >> 8); + p++; + q++; } } break; diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp index 1330d96..49514dc 100644 --- a/tests/auto/qimage/tst_qimage.cpp +++ b/tests/auto/qimage/tst_qimage.cpp @@ -139,6 +139,9 @@ private slots: void premultipliedAlphaConsistency(); void compareIndexed(); + + void rgbSwapped_data(); + void rgbSwapped(); }; tst_QImage::tst_QImage() @@ -1820,5 +1823,68 @@ void tst_QImage::compareIndexed() QCOMPARE(img, imgInverted); } +void tst_QImage::rgbSwapped_data() +{ + QTest::addColumn("format"); + + QTest::newRow("Format_Indexed8") << QImage::Format_Indexed8; + QTest::newRow("Format_RGB32") << QImage::Format_RGB32; + QTest::newRow("Format_ARGB32") << QImage::Format_ARGB32; + QTest::newRow("Format_ARGB32_Premultiplied") << QImage::Format_ARGB32_Premultiplied; + QTest::newRow("Format_RGB16") << QImage::Format_RGB16; + QTest::newRow("Format_ARGB8565_Premultiplied") << QImage::Format_ARGB8565_Premultiplied; + QTest::newRow("Format_ARGB6666_Premultiplied") << QImage::Format_ARGB6666_Premultiplied; + QTest::newRow("Format_ARGB4444_Premultiplied") << QImage::Format_ARGB4444_Premultiplied; + QTest::newRow("Format_RGB666") << QImage::Format_RGB666; + QTest::newRow("Format_RGB555") << QImage::Format_RGB555; + QTest::newRow("Format_ARGB8555_Premultiplied") << QImage::Format_ARGB8555_Premultiplied; + QTest::newRow("Format_RGB888") << QImage::Format_RGB888; + QTest::newRow("Format_RGB444") << QImage::Format_RGB444; +} + +void tst_QImage::rgbSwapped() +{ + QFETCH(QImage::Format, format); + + QImage image(100, 1, format); + image.fill(0); + + QVector testColor(image.width()); + + for (int i = 0; i < image.width(); ++i) + testColor[i] = QColor(i, 10 + i, 20 + i * 2, 30 + i); + + if (format != QImage::Format_Indexed8) { + QPainter p(&image); + p.setCompositionMode(QPainter::CompositionMode_Source); + for (int i = 0; i < image.width(); ++i) + p.fillRect(QRect(i, 0, 1, 1), testColor[i].rgb()); + } else { + image.setColorCount(image.width()); + for (int i = 0; i < image.width(); ++i) { + image.setColor(0, testColor[i].rgba()); + image.setPixel(i, 0, i); + } + } + + QImage imageSwapped = image.rgbSwapped(); + + for (int i = 0; i < image.width(); ++i) { + QColor referenceColor = QColor(image.pixel(i, 0)); + QColor swappedColor = QColor(imageSwapped.pixel(i, 0)); + + QCOMPARE(swappedColor.alpha(), referenceColor.alpha()); + QCOMPARE(swappedColor.red(), referenceColor.blue()); + QCOMPARE(swappedColor.green(), referenceColor.green()); + QCOMPARE(swappedColor.blue(), referenceColor.red()); + } + + QImage imageSwappedTwice = imageSwapped.rgbSwapped(); + + QCOMPARE(image, imageSwappedTwice); + + QCOMPARE(memcmp(image.constBits(), imageSwappedTwice.constBits(), image.numBytes()), 0); +} + QTEST_MAIN(tst_QImage) #include "tst_qimage.moc" -- cgit v0.12 From 14e17d5fe5f925a768aab9db9401e04bbaca224d Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 3 Aug 2010 16:19:12 +0200 Subject: Fixed the addressbook tutorial and some spelling mistakes. Fix for QTBUG-7071 and QTBUG-10173 --- doc/src/development/debug.qdoc | 2 +- examples/tutorials/addressbook-fr/part2/addressbook.cpp | 2 +- examples/tutorials/addressbook-fr/part3/addressbook.cpp | 3 ++- examples/tutorials/addressbook-fr/part4/addressbook.cpp | 3 ++- examples/tutorials/addressbook-fr/part5/addressbook.cpp | 5 +++-- examples/tutorials/addressbook-fr/part6/addressbook.cpp | 3 ++- examples/tutorials/addressbook-fr/part7/addressbook.cpp | 3 ++- examples/tutorials/addressbook/part2/addressbook.cpp | 2 +- examples/tutorials/addressbook/part3/addressbook.cpp | 2 +- examples/tutorials/addressbook/part4/addressbook.cpp | 2 +- examples/tutorials/addressbook/part5/addressbook.cpp | 2 +- examples/tutorials/addressbook/part6/addressbook.cpp | 2 +- examples/tutorials/addressbook/part7/addressbook.cpp | 2 +- 13 files changed, 19 insertions(+), 14 deletions(-) diff --git a/doc/src/development/debug.qdoc b/doc/src/development/debug.qdoc index 36970ee..bfb2355 100644 --- a/doc/src/development/debug.qdoc +++ b/doc/src/development/debug.qdoc @@ -49,7 +49,7 @@ The basic stuff you need to know about debug libraries and frameworks is found at developer.apple.com in: \l{http://developer.apple.com/technotes/tn2004/tn2124.html#SECDEBUGLIB} - {Apple Technicle Note TN2124} Qt follows that. + {Apple Technical Note TN2124} Qt follows that. When you build Qt, frameworks are built by default, and inside the framework you will find both a release and a debug version (e.g., diff --git a/examples/tutorials/addressbook-fr/part2/addressbook.cpp b/examples/tutorials/addressbook-fr/part2/addressbook.cpp index 1fa9d52..8d5b0e1 100644 --- a/examples/tutorials/addressbook-fr/part2/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part2/addressbook.cpp @@ -111,7 +111,7 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if ( name.isEmpty()|| address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); return; diff --git a/examples/tutorials/addressbook-fr/part3/addressbook.cpp b/examples/tutorials/addressbook-fr/part3/addressbook.cpp index 840f529..2d182c5 100644 --- a/examples/tutorials/addressbook-fr/part3/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part3/addressbook.cpp @@ -122,9 +122,10 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); + return; } if (!contacts.contains(name)) { diff --git a/examples/tutorials/addressbook-fr/part4/addressbook.cpp b/examples/tutorials/addressbook-fr/part4/addressbook.cpp index f6390a4..d3bf030 100644 --- a/examples/tutorials/addressbook-fr/part4/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part4/addressbook.cpp @@ -131,9 +131,10 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); + return; } //! [submitContact() function part1] if (currentMode == AddingMode) { diff --git a/examples/tutorials/addressbook-fr/part5/addressbook.cpp b/examples/tutorials/addressbook-fr/part5/addressbook.cpp index 80c18c3..d5f5778 100644 --- a/examples/tutorials/addressbook-fr/part5/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part5/addressbook.cpp @@ -138,10 +138,11 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); - } + return; + } if (currentMode == AddingMode) { diff --git a/examples/tutorials/addressbook-fr/part6/addressbook.cpp b/examples/tutorials/addressbook-fr/part6/addressbook.cpp index fc41190..7c57db7 100644 --- a/examples/tutorials/addressbook-fr/part6/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part6/addressbook.cpp @@ -144,9 +144,10 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); + return; } if (currentMode == AddingMode) { diff --git a/examples/tutorials/addressbook-fr/part7/addressbook.cpp b/examples/tutorials/addressbook-fr/part7/addressbook.cpp index 3ab8702..b0f35a7 100644 --- a/examples/tutorials/addressbook-fr/part7/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part7/addressbook.cpp @@ -146,9 +146,10 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); + return; } if (currentMode == AddingMode) { diff --git a/examples/tutorials/addressbook/part2/addressbook.cpp b/examples/tutorials/addressbook/part2/addressbook.cpp index 1fa9d52..f2f0d65 100644 --- a/examples/tutorials/addressbook/part2/addressbook.cpp +++ b/examples/tutorials/addressbook/part2/addressbook.cpp @@ -111,7 +111,7 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); return; diff --git a/examples/tutorials/addressbook/part3/addressbook.cpp b/examples/tutorials/addressbook/part3/addressbook.cpp index 28a570a..4e58fa1 100644 --- a/examples/tutorials/addressbook/part3/addressbook.cpp +++ b/examples/tutorials/addressbook/part3/addressbook.cpp @@ -122,7 +122,7 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); return; diff --git a/examples/tutorials/addressbook/part4/addressbook.cpp b/examples/tutorials/addressbook/part4/addressbook.cpp index 55d551f..896a427 100644 --- a/examples/tutorials/addressbook/part4/addressbook.cpp +++ b/examples/tutorials/addressbook/part4/addressbook.cpp @@ -131,7 +131,7 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); return; diff --git a/examples/tutorials/addressbook/part5/addressbook.cpp b/examples/tutorials/addressbook/part5/addressbook.cpp index 1b3f451..874b151 100644 --- a/examples/tutorials/addressbook/part5/addressbook.cpp +++ b/examples/tutorials/addressbook/part5/addressbook.cpp @@ -138,7 +138,7 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); return; diff --git a/examples/tutorials/addressbook/part6/addressbook.cpp b/examples/tutorials/addressbook/part6/addressbook.cpp index 724971c..a6bb4a5 100644 --- a/examples/tutorials/addressbook/part6/addressbook.cpp +++ b/examples/tutorials/addressbook/part6/addressbook.cpp @@ -144,7 +144,7 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); return; diff --git a/examples/tutorials/addressbook/part7/addressbook.cpp b/examples/tutorials/addressbook/part7/addressbook.cpp index bf00298..fb70ba4 100644 --- a/examples/tutorials/addressbook/part7/addressbook.cpp +++ b/examples/tutorials/addressbook/part7/addressbook.cpp @@ -146,7 +146,7 @@ void AddressBook::submitContact() QString name = nameLine->text(); QString address = addressText->toPlainText(); - if (name == "" || address == "") { + if (name.isEmpty() || address.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); return; -- cgit v0.12 From 79c6710c7785d915f64bd31e28ce48eed8493a41 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 3 Aug 2010 16:28:35 +0200 Subject: Removed the unfinished sentence. Fix for QTBUG-10173. --- doc/src/development/debug.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/development/debug.qdoc b/doc/src/development/debug.qdoc index bfb2355..9e881d1 100644 --- a/doc/src/development/debug.qdoc +++ b/doc/src/development/debug.qdoc @@ -49,7 +49,7 @@ The basic stuff you need to know about debug libraries and frameworks is found at developer.apple.com in: \l{http://developer.apple.com/technotes/tn2004/tn2124.html#SECDEBUGLIB} - {Apple Technical Note TN2124} Qt follows that. + {Apple Technical Note TN2124}. When you build Qt, frameworks are built by default, and inside the framework you will find both a release and a debug version (e.g., -- cgit v0.12