summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qprocess_win.cpp')
-rw-r--r--src/corelib/io/qprocess_win.cpp33
1 files changed, 9 insertions, 24 deletions
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 9e60daa5b4..cef961ecbd 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -41,7 +41,6 @@
#include <qelapsedtimer.h>
#include <qfileinfo.h>
#include <qregexp.h>
-#include <qtimer.h>
#include <qwineventnotifier.h>
#include <private/qthread_p.h>
#include <qdebug.h>
@@ -58,8 +57,6 @@ QT_BEGIN_NAMESPACE
//#define QPROCESS_DEBUG
-#define NOTIFYTIMEOUT 100
-
static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe)
{
// Anomymous pipes do not support asynchronous I/O. Thus we
@@ -543,9 +540,6 @@ void QProcessPrivate::startProcess()
processFinishedNotifier = new QWinEventNotifier(pid->hProcess, q);
QObject::connect(processFinishedNotifier, SIGNAL(activated(HANDLE)), q, SLOT(_q_processDied()));
processFinishedNotifier->setEnabled(true);
- notifier = new QTimer(q);
- QObject::connect(notifier, SIGNAL(timeout()), q, SLOT(_q_notified()));
- notifier->start(NOTIFYTIMEOUT);
}
_q_startupNotification();
@@ -810,6 +804,8 @@ qint64 QProcessPrivate::writeToStdin(const char *data, qint64 maxlen)
if (!stdinChannel.writer) {
stdinChannel.writer = new QWindowsPipeWriter(stdinChannel.pipe[1], q);
+ QObjectPrivate::connect(stdinChannel.writer, &QWindowsPipeWriter::canWrite,
+ this, &QProcessPrivate::_q_canWrite);
stdinChannel.writer->start();
}
@@ -828,17 +824,6 @@ bool QProcessPrivate::waitForWrite(int msecs)
return false;
}
-void QProcessPrivate::_q_notified()
-{
- notifier->stop();
-
- if (!stdinChannel.buffer.isEmpty() && (!stdinChannel.writer || stdinChannel.writer->waitForWrite(0)))
- _q_canWrite();
-
- if (processState != QProcess::NotRunning)
- notifier->start(NOTIFYTIMEOUT);
-}
-
bool QProcessPrivate::startDetached(const QString &program, const QStringList &arguments, const QString &workingDir, qint64 *pid)
{
QString args = qt_create_commandline(program, arguments);