summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-01-17 21:07:35 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-01-23 18:49:12 +0000
commit5eab68bbee6c9633f0702c87c05e119ec4d910e0 (patch)
tree6c22d32d45ef32b20a65206dd01591618330f12b /src
parent7bebdb472a396bad05c9448e7b5d86fceb0fbe33 (diff)
QProcess: mark obsolete functions as deprecated
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 <thiago.macieira@intel.com> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qprocess.cpp10
-rw-r--r--src/corelib/io/qprocess.h7
2 files changed, 15 insertions, 2 deletions
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);