summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qfilesystementry.cpp16
-rw-r--r--src/corelib/io/qfilesystemwatcher_win.cpp2
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp11
-rw-r--r--src/corelib/io/qwinoverlappedionotifier.cpp16
4 files changed, 27 insertions, 18 deletions
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index c590d81f7a..9bd31932b3 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -260,17 +260,21 @@ QString QFileSystemEntry::completeSuffix() const
bool QFileSystemEntry::isRelative() const
{
resolveFilePath();
- return (m_filePath.isEmpty() || (!m_filePath.isEmpty() && (m_filePath.at(0).unicode() != '/')
- && (!(m_filePath.length() >= 2 && m_filePath.at(1).unicode() == ':'))));
+ return (m_filePath.isEmpty()
+ || (m_filePath.at(0).unicode() != '/'
+ && !(m_filePath.length() >= 2 && m_filePath.at(1).unicode() == ':')));
}
bool QFileSystemEntry::isAbsolute() const
{
resolveFilePath();
- return (!m_filePath.isEmpty() && ((m_filePath.length() >= 3
- && (m_filePath.at(0).isLetter() && m_filePath.at(1).unicode() == ':' && m_filePath.at(2).unicode() == '/'))
- || (m_filePath.length() >= 2 && (m_filePath.at(0) == QLatin1Char('/') && m_filePath.at(1) == QLatin1Char('/')))
- ));
+ return ((m_filePath.length() >= 3
+ && m_filePath.at(0).isLetter()
+ && m_filePath.at(1).unicode() == ':'
+ && m_filePath.at(2).unicode() == '/')
+ || (m_filePath.length() >= 2
+ && m_filePath.at(0) == QLatin1Char('/')
+ && m_filePath.at(1) == QLatin1Char('/')));
}
#else
bool QFileSystemEntry::isRelative() const
diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp
index 410753868e..582aa3bbe9 100644
--- a/src/corelib/io/qfilesystemwatcher_win.cpp
+++ b/src/corelib/io/qfilesystemwatcher_win.cpp
@@ -165,7 +165,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
// now look for a thread to insert
bool found = false;
foreach(QWindowsFileSystemWatcherEngineThread *thread, threads) {
- QMutexLocker(&(thread->mutex));
+ QMutexLocker locker(&(thread->mutex));
if (thread->handles.count() < MAXIMUM_WAIT_OBJECTS) {
DEBUG() << "Added handle" << handle.handle << "for" << absolutePath << "to watch" << fileInfo.absoluteFilePath()
<< "to existing thread " << thread;
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index fd14523d45..21df5d0643 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -43,13 +43,8 @@ QWindowsPipeWriter::QWindowsPipeWriter(HANDLE pipe, QObject * parent)
quitNow(false),
hasWritten(false)
{
-#if !defined(Q_OS_WINCE) || (_WIN32_WCE >= 0x600)
DuplicateHandle(GetCurrentProcess(), pipe, GetCurrentProcess(),
&writePipe, 0, FALSE, DUPLICATE_SAME_ACCESS);
-#else
- Q_UNUSED(pipe);
- writePipe = GetCurrentProcess();
-#endif
}
QWindowsPipeWriter::~QWindowsPipeWriter()
@@ -60,9 +55,7 @@ QWindowsPipeWriter::~QWindowsPipeWriter()
lock.unlock();
if (!wait(30000))
terminate();
-#if !defined(Q_OS_WINCE) || (_WIN32_WCE >= 0x600)
CloseHandle(writePipe);
-#endif
}
bool QWindowsPipeWriter::waitForWrite(int msecs)
@@ -153,7 +146,6 @@ void QWindowsPipeWriter::run()
msleep(100);
continue;
}
-#ifndef Q_OS_WINCE
if (writeError != ERROR_IO_PENDING) {
qErrnoWarning(writeError, "QWindowsPipeWriter: async WriteFile failed.");
return;
@@ -162,9 +154,6 @@ void QWindowsPipeWriter::run()
qErrnoWarning(GetLastError(), "QWindowsPipeWriter: GetOverlappedResult failed.");
return;
}
-#else
- return;
-#endif
}
totalWritten += written;
#if defined QPIPEWRITER_DEBUG
diff --git a/src/corelib/io/qwinoverlappedionotifier.cpp b/src/corelib/io/qwinoverlappedionotifier.cpp
index 0cefa374fa..dee263c664 100644
--- a/src/corelib/io/qwinoverlappedionotifier.cpp
+++ b/src/corelib/io/qwinoverlappedionotifier.cpp
@@ -75,6 +75,22 @@ QT_BEGIN_NAMESPACE
or WriteFile() is ignored and can be used for other purposes.
\warning This class is only available on Windows.
+
+ Due to peculiarities of the Windows I/O completion port API, users of
+ QWinOverlappedIoNotifier must pay attention to the following restrictions:
+ \list
+ \li File handles with a QWinOverlappedIoNotifer are assigned to an I/O
+ completion port until the handle is closed. It is impossible to
+ disassociate the file handle from the I/O completion port.
+ \li There can be only one QWinOverlappedIoNotifer per file handle. Creating
+ another QWinOverlappedIoNotifier for that file, even with a duplicated
+ handle, will fail.
+ \li Certain Windows API functions are unavailable for file handles that are
+ assigned to an I/O completion port. This includes the functions
+ \c{ReadFileEx} and \c{WriteFileEx}.
+ \endlist
+ See also the remarks in the MSDN documentation for the
+ \c{CreateIoCompletionPort} function.
*/
struct IOResult