summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-06-15 07:38:54 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2010-06-15 07:38:54 +0200
commit37d71b2653b9f31ee73fdd09b0d2be757d4537bd (patch)
tree5877aa8f77e34db7ab6d9c58180d32952c65b49c /src
parenteaa981c943293bf346a041aa4ad3d254e99ebd78 (diff)
parentdd2be9c7e7540870ddc532f02bd83860273cbbd6 (diff)
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into qt-4.7-from-4.6
Diffstat (limited to 'src')
-rw-r--r--src/network/socket/qlocalsocket_win.cpp13
-rw-r--r--src/plugins/imageformats/gif/qgifhandler.cpp4
-rw-r--r--src/plugins/imageformats/mng/qmnghandler.cpp1
-rw-r--r--src/tools/moc/main.cpp7
4 files changed, 18 insertions, 7 deletions
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index 2223ebe9da..5486f4769f 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -485,6 +485,8 @@ void QLocalSocketPrivate::_q_notified()
if (!completeAsyncRead()) {
pipeClosed = true;
emit q->readChannelFinished();
+ if (actualReadBufferSize == 0)
+ QTimer::singleShot(0, q, SLOT(_q_pipeClosed()));
return;
}
startAsyncRead();
@@ -568,11 +570,22 @@ bool QLocalSocket::waitForReadyRead(int msecs)
if (d->state != QLocalSocket::ConnectedState)
return false;
+ // We already know that the pipe is gone, but did not enter the event loop yet.
+ if (d->pipeClosed) {
+ close();
+ return false;
+ }
+
Q_ASSERT(d->readSequenceStarted);
DWORD result = WaitForSingleObject(d->overlapped.hEvent, msecs == -1 ? INFINITE : msecs);
switch (result) {
case WAIT_OBJECT_0:
d->_q_notified();
+ // We just noticed that the pipe is gone.
+ if (d->pipeClosed) {
+ close();
+ return false;
+ }
return true;
case WAIT_TIMEOUT:
return false;
diff --git a/src/plugins/imageformats/gif/qgifhandler.cpp b/src/plugins/imageformats/gif/qgifhandler.cpp
index 8abc2d1eea..2da822d883 100644
--- a/src/plugins/imageformats/gif/qgifhandler.cpp
+++ b/src/plugins/imageformats/gif/qgifhandler.cpp
@@ -1026,7 +1026,7 @@ inline QRgb QGIFFormat::color(uchar index) const
QGifHandler::QGifHandler()
{
gifFormat = new QGIFFormat;
- nextDelay = 0;
+ nextDelay = 100;
loopCnt = 1;
frameNumber = -1;
scanIsCached = false;
@@ -1061,7 +1061,7 @@ bool QGifHandler::imageIsComing() const
bool QGifHandler::canRead() const
{
- if (!nextDelay && canRead(device())) {
+ if (canRead(device())) {
setFormat("gif");
return true;
}
diff --git a/src/plugins/imageformats/mng/qmnghandler.cpp b/src/plugins/imageformats/mng/qmnghandler.cpp
index d408e6cdf7..9dbb8857d3 100644
--- a/src/plugins/imageformats/mng/qmnghandler.cpp
+++ b/src/plugins/imageformats/mng/qmnghandler.cpp
@@ -271,7 +271,6 @@ bool QMngHandlerPrivate::getNextImage(QImage *result)
}
if ((MNG_NOERROR == ret) || (MNG_NEEDTIMERWAIT == ret)) {
*result = image;
- image.fill(0);
frameIndex = nextIndex++;
if (haveReadAll && (frameCount == 0))
frameCount = nextIndex;
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index ebe1834a5a..499769041f 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -359,11 +359,10 @@ int runMoc(int _argc, char **_argv)
if (autoInclude) {
+ int spos = filename.lastIndexOf(QDir::separator().toLatin1());
int ppos = filename.lastIndexOf('.');
- moc.noInclude = (ppos >= 0
- && tolower(filename[ppos + 1]) != 'h'
- && tolower(filename[ppos + 1]) != QDir::separator().toLatin1()
- );
+ // spos >= -1 && ppos > spos => ppos >= 0
+ moc.noInclude = (ppos > spos && tolower(filename[ppos + 1]) != 'h');
}
if (moc.includeFiles.isEmpty()) {
if (moc.includePath.isEmpty()) {