summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp6
-rw-r--r--src/corelib/io/qprocess.cpp2
-rw-r--r--src/corelib/io/qprocess_win.cpp1
-rw-r--r--src/corelib/io/qtemporarydir.cpp5
-rw-r--r--src/corelib/io/qtextstream.cpp5
-rw-r--r--src/corelib/io/qurl_mac.mm8
6 files changed, 18 insertions, 9 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index feb86d2895..10326dea06 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -83,13 +83,13 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e
if (suffix.length() > 0) {
// First step: is the extension known ?
- CFStringRef extensionRef = QCFString::toCFStringRef(suffix);
- CFStringRef uniformTypeIdentifier = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extensionRef, NULL);
+ QCFType<CFStringRef> extensionRef = QCFString::toCFStringRef(suffix);
+ QCFType<CFStringRef> uniformTypeIdentifier = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extensionRef, NULL);
if (UTTypeConformsTo(uniformTypeIdentifier, kUTTypeBundle))
return true;
// Second step: check if an application knows the package type
- CFStringRef path = QCFString::toCFStringRef(entry.filePath());
+ QCFType<CFStringRef> path = QCFString::toCFStringRef(entry.filePath());
QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, path, kCFURLPOSIXPathStyle, true);
UInt32 type, creator;
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index a7d521fc6c..408f07f00e 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1043,9 +1043,9 @@ bool QProcessPrivate::_q_processDied()
return false;
#endif
#ifdef Q_OS_WIN
- drainOutputPipes();
if (processFinishedNotifier)
processFinishedNotifier->setEnabled(false);
+ drainOutputPipes();
#endif
// the process may have died before it got a chance to report that it was
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index ee6b7e13f4..9e60daa5b4 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -785,6 +785,7 @@ bool QProcessPrivate::waitForFinished(int msecs)
void QProcessPrivate::findExitCode()
{
DWORD theExitCode;
+ Q_ASSERT(pid);
if (GetExitCodeProcess(pid->hProcess, &theExitCode)) {
exitCode = theExitCode;
crashed = (exitCode == 0xf291 // our magic number, see killProcess
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index 5e0def74ee..5f0c500183 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -128,8 +128,11 @@ static char *q_mkdtemp(char *templateName)
QFile::ReadOwner |
QFile::WriteOwner |
QFile::ExeOwner, error);
- if (error.error() != 0)
+ if (error.error() != 0) {
+ if (!QFileSystemEngine::removeDirectory(fileSystemEntry, false))
+ qWarning() << "Unable to remove unused directory" << templateNameStr;
continue;
+ }
return templateName;
}
}
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index f870fb11e3..fa455c0e8c 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -1574,11 +1574,10 @@ QString QTextStream::readAll()
the stream contains lines longer than this, then the lines will be
split after \a maxlen characters and returned in parts.
- If \a maxlen is 0, the lines can be of any length. A common value
- for \a maxlen is 75.
+ If \a maxlen is 0, the lines can be of any length.
The returned line has no trailing end-of-line characters ("\\n"
- or "\\r\\n"), so calling QString::trimmed() is unnecessary.
+ or "\\r\\n"), so calling QString::trimmed() can be unnecessary.
If the stream has read to the end of the file, \l {QTextStream::readLine()}{readLine()}
will return a null QString. For strings, or for devices that support it,
diff --git a/src/corelib/io/qurl_mac.mm b/src/corelib/io/qurl_mac.mm
index c235365ad8..4468bf0f2b 100644
--- a/src/corelib/io/qurl_mac.mm
+++ b/src/corelib/io/qurl_mac.mm
@@ -54,7 +54,13 @@ QUrl QUrl::fromCFURL(CFURLRef url)
CFURLRef QUrl::toCFURL() const
{
- return CFURLCreateWithString(0, toString(FullyEncoded).toCFString(), 0);
+ CFURLRef url = 0;
+ CFStringRef str = toString(FullyEncoded).toCFString();
+ if (str) {
+ url = CFURLCreateWithString(0, str, 0);
+ CFRelease(str);
+ }
+ return url;
}
QUrl QUrl::fromNSURL(const NSURL *url)