summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorabcd <qt-info@nokia.com>2009-09-09 00:55:15 (GMT)
committerabcd <qt-info@nokia.com>2009-09-09 00:55:15 (GMT)
commit03050f1495a9071a7123ed70caff83466df8c6e5 (patch)
treef96e3af0b0d9389626b826f7030cdeac71dc74e8 /src
parentf52dc5bf1e885c9a4d226c2484249e7d9faf0a99 (diff)
downloadQt-03050f1495a9071a7123ed70caff83466df8c6e5.zip
Qt-03050f1495a9071a7123ed70caff83466df8c6e5.tar.gz
Qt-03050f1495a9071a7123ed70caff83466df8c6e5.tar.bz2
Fix windows implemetation of QLocalSocket to emit bytesWritten() signal
Have QWindowsPipeWriter emit a bytesWritten signal and have QLocalSocket connect this to its own bytesWritten signal. This change contains an autotest to check for the signal emission. Previously there was no implementation to emit the signal.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp1
-rw-r--r--src/corelib/io/qwindowspipewriter_p.h1
-rw-r--r--src/network/socket/qlocalsocket_win.cpp3
3 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index f32eb92..0e707f3 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -160,6 +160,7 @@ void QWindowsPipeWriter::run()
hasWritten = true;
lock.unlock();
}
+ emit bytesWritten(totalWritten);
emit canWrite();
}
CloseHandle(overl.hEvent);
diff --git a/src/corelib/io/qwindowspipewriter_p.h b/src/corelib/io/qwindowspipewriter_p.h
index d651629..8f8c4a0 100644
--- a/src/corelib/io/qwindowspipewriter_p.h
+++ b/src/corelib/io/qwindowspipewriter_p.h
@@ -121,6 +121,7 @@ class Q_CORE_EXPORT QWindowsPipeWriter : public QThread
Q_SIGNALS:
void canWrite();
+ void bytesWritten(qint64 bytes);
public:
QWindowsPipeWriter(HANDLE writePipe, QObject * parent = 0);
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index 96dfa6e..e15ac65 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -302,8 +302,9 @@ qint64 QLocalSocket::writeData(const char *data, qint64 maxSize)
Q_D(QLocalSocket);
if (!d->pipeWriter) {
d->pipeWriter = new QWindowsPipeWriter(d->handle, this);
- d->pipeWriter->start();
connect(d->pipeWriter, SIGNAL(canWrite()), this, SLOT(_q_canWrite()));
+ connect(d->pipeWriter, SIGNAL(bytesWritten(qint64)), this, SIGNAL(bytesWritten(qint64)));
+ d->pipeWriter->start();
}
return d->pipeWriter->write(data, maxSize);
}