From 5eab68bbee6c9633f0702c87c05e119ec4d910e0 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Thu, 17 Jan 2019 21:07:35 +0100 Subject: QProcess: mark obsolete functions as deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QProcess::finished(int)/readChannelMode()/setReadChannelMode() are obsolete but were not marked as deprecated. Explicit mark them as deprecated so they can be removed with Qt6. Change-Id: Iedbfd80a3c987f35caf93181e9277913a18961d9 Reviewed-by: Thiago Macieira Reviewed-by: MÃ¥rten Nordheim --- src/corelib/io/qprocess.cpp | 10 ++++++++-- src/corelib/io/qprocess.h | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index e1f4a3a311..83849980ae 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -813,6 +813,7 @@ void QProcessPrivate::Channel::clear() \a newState argument is the state QProcess changed to. */ +#if QT_DEPRECATED_SINCE(5, 13) /*! \fn void QProcess::finished(int exitCode) \obsolete @@ -820,6 +821,7 @@ void QProcessPrivate::Channel::clear() Use finished(int exitCode, QProcess::ExitStatus status) instead. */ +#endif /*! \fn void QProcess::finished(int exitCode, QProcess::ExitStatus exitStatus) @@ -1172,7 +1174,9 @@ bool QProcessPrivate::_q_processDied() //emit q->standardOutputClosed(); //emit q->standardErrorClosed(); +#if QT_DEPRECATED_SINCE(5, 13) emit q->finished(exitCode); +#endif emit q->finished(exitCode, exitStatus); } #if defined QPROCESS_DEBUG @@ -1264,6 +1268,7 @@ QProcess::~QProcess() d->cleanup(); } +#if QT_DEPRECATED_SINCE(5, 13) /*! \obsolete Returns the read channel mode of the QProcess. This function is @@ -1287,6 +1292,7 @@ void QProcess::setReadChannelMode(ProcessChannelMode mode) { setProcessChannelMode(mode); } +#endif /*! \since 4.2 @@ -2473,7 +2479,7 @@ QProcess::ExitStatus QProcess::exitStatus() const int QProcess::execute(const QString &program, const QStringList &arguments) { QProcess process; - process.setReadChannelMode(ForwardedChannels); + process.setProcessChannelMode(ForwardedChannels); process.start(program, arguments); if (!process.waitForFinished(-1) || process.error() == FailedToStart) return -2; @@ -2496,7 +2502,7 @@ int QProcess::execute(const QString &program, const QStringList &arguments) int QProcess::execute(const QString &command) { QProcess process; - process.setReadChannelMode(ForwardedChannels); + process.setProcessChannelMode(ForwardedChannels); process.start(command); if (!process.waitForFinished(-1) || process.error() == FailedToStart) return -2; diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h index 5e022e3a52..42cf769698 100644 --- a/src/corelib/io/qprocess.h +++ b/src/corelib/io/qprocess.h @@ -172,8 +172,12 @@ public: QStringList arguments() const; void setArguments(const QStringList & arguments); +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X("Use QProcess::processChannelMode() instead") ProcessChannelMode readChannelMode() const; + QT_DEPRECATED_X("Use QProcess::setProcessChannelMode() instead") void setReadChannelMode(ProcessChannelMode mode); +#endif ProcessChannelMode processChannelMode() const; void setProcessChannelMode(ProcessChannelMode mode); InputChannelMode inputChannelMode() const; @@ -269,7 +273,10 @@ public Q_SLOTS: Q_SIGNALS: void started(QPrivateSignal); +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X("Use QProcess::finished(int, QProcess::ExitStatus) instead") void finished(int exitCode); // ### Qt 6: merge the two signals with a default value +#endif void finished(int exitCode, QProcess::ExitStatus exitStatus); #if QT_DEPRECATED_SINCE(5,6) void error(QProcess::ProcessError error); -- cgit v1.2.3