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/corelib/io/qfilesystemengine_unix.cpp | |
parent | 1b567854e4787ac591f8039c88e8cd8a44edaef7 (diff) | |
download | qtbase-669add92d9adc15ecfa0b2d62dd90ea9066d401e.tar.gz |
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/corelib/io/qfilesystemengine_unix.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 6aaaa4c05a..c9f7672ac3 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -101,13 +101,13 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e if (suffix.length() > 0) { // First step: is the extension known ? - QCFType<CFStringRef> extensionRef = QCFString::toCFStringRef(suffix); + QCFType<CFStringRef> extensionRef = suffix.toCFString(); QCFType<CFStringRef> uniformTypeIdentifier = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extensionRef, NULL); if (UTTypeConformsTo(uniformTypeIdentifier, kUTTypeBundle)) return true; // Second step: check if an application knows the package type - QCFType<CFStringRef> path = QCFString::toCFStringRef(entry.filePath()); + QCFType<CFStringRef> path = entry.filePath().toCFString(); QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, path, kCFURLPOSIXPathStyle, true); UInt32 type, creator; @@ -126,7 +126,7 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e if (application) { QCFType<CFBundleRef> bundle = CFBundleCreate(kCFAllocatorDefault, application); CFStringRef identifier = CFBundleGetIdentifier(bundle); - QString applicationId = QCFString::toQString(identifier); + QString applicationId = QString::fromCFString(identifier); if (applicationId != QLatin1String("com.apple.finder")) return true; } @@ -222,7 +222,7 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link, if (!cfstr) return QFileSystemEntry(); - return QFileSystemEntry(QCFString::toQString(cfstr)); + return QFileSystemEntry(QString::fromCFString(cfstr)); } #endif return QFileSystemEntry(); @@ -412,7 +412,7 @@ QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry) if (QCFType<CFDictionaryRef> dict = CFBundleCopyInfoDictionaryForURL(url)) { if (CFTypeRef name = (CFTypeRef)CFDictionaryGetValue(dict, kCFBundleNameKey)) { if (CFGetTypeID(name) == CFStringGetTypeID()) - return QCFString::toQString((CFStringRef)name); + return QString::fromCFString((CFStringRef)name); } } return QString(); |