diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-03 19:34:21 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2016-10-06 08:02:59 +0000 |
commit | 669add92d9adc15ecfa0b2d62dd90ea9066d401e (patch) | |
tree | 49ad8ef5a042c1f0cf9aa305bb8836b63e1d282f /src/network/kernel/qnetworkproxy_mac.cpp | |
parent | 1b567854e4787ac591f8039c88e8cd8a44edaef7 (diff) |
Replace QCFString::to(CF/NS/Q)String usage with QString methods
Slims down QCFString and leaves only one implementation of converting
back and forth between CF/NS strings and QStrings.
Change-Id: I068568ffa25e6f4f6d6c99dcf47078b7a8e70e10
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/network/kernel/qnetworkproxy_mac.cpp')
-rw-r--r-- | src/network/kernel/qnetworkproxy_mac.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp index 76a2d2df9f..c13a472b90 100644 --- a/src/network/kernel/qnetworkproxy_mac.cpp +++ b/src/network/kernel/qnetworkproxy_mac.cpp @@ -104,7 +104,7 @@ static bool isHostExcluded(CFDictionaryRef dict, const QString &host) CFIndex size = CFArrayGetCount(exclusionList); for (CFIndex i = 0; i < size; ++i) { CFStringRef cfentry = (CFStringRef)CFArrayGetValueAtIndex(exclusionList, i); - QString entry = QCFString::toQString(cfentry); + QString entry = QString::fromCFString(cfentry); if (isIpAddress && ipAddress.isInSubnet(QHostAddress::parseSubnet(entry))) { return true; // excluded @@ -133,7 +133,7 @@ static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict, QNetworkProxy::Pr && (protoPort = (CFNumberRef)CFDictionaryGetValue(dict, portKey))) { int enabled; if (CFNumberGetValue(protoEnabled, kCFNumberIntType, &enabled) && enabled) { - QString host = QCFString::toQString(protoHost); + QString host = QString::fromCFString(protoHost); int port; CFNumberGetValue(protoPort, kCFNumberIntType, &port); @@ -168,9 +168,9 @@ static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict) proxyType = QNetworkProxy::Socks5Proxy; } - hostName = QCFString::toQString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyHostNameKey)); - user = QCFString::toQString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyUsernameKey)); - password = QCFString::toQString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyPasswordKey)); + hostName = QString::fromCFString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyHostNameKey)); + user = QString::fromCFString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyUsernameKey)); + password = QString::fromCFString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyPasswordKey)); CFNumberRef portNumber = (CFNumberRef)CFDictionaryGetValue(dict, kCFProxyPortNumberKey); if (portNumber) { @@ -229,7 +229,7 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query) QCFType<CFDataRef> pacData; QCFType<CFURLRef> pacUrl = CFURLCreateWithString(kCFAllocatorDefault, cfPacLocation, NULL); if (!pacUrl) { - qWarning("Invalid PAC URL \"%s\"", qPrintable(QCFString::toQString(cfPacLocation))); + qWarning("Invalid PAC URL \"%s\"", qPrintable(QString::fromCFString(cfPacLocation))); return result; } @@ -259,9 +259,9 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query) CFRunLoopRunInMode(pacRunLoopMode, 1000, /*returnAfterSourceHandled*/ true); if (!pacInfo.proxies) { - QString pacLocation = QCFString::toQString(cfPacLocation); + QString pacLocation = QString::fromCFString(cfPacLocation); QCFType<CFStringRef> pacErrorDescription = CFErrorCopyDescription(pacInfo.error); - qWarning("Execution of PAC script at \"%s\" failed: %s", qPrintable(pacLocation), qPrintable(QCFString::toQString(pacErrorDescription))); + qWarning("Execution of PAC script at \"%s\" failed: %s", qPrintable(pacLocation), qPrintable(QString::fromCFString(pacErrorDescription))); return result; } |