forked from qt-creator/qt-creator
Utils: Remove FilePath::toString from QtcProcess
Change-Id: I59df98547255bb5c282b190e0195323e0044214d Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1224,15 +1224,15 @@ void QtcProcess::setRemoteProcessHooks(const DeviceProcessHooks &hooks)
|
|||||||
s_deviceHooks = hooks;
|
s_deviceHooks = hooks;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool askToKill(const QString &command)
|
static bool askToKill(const CommandLine &command)
|
||||||
{
|
{
|
||||||
#ifdef QT_GUI_LIB
|
#ifdef QT_GUI_LIB
|
||||||
if (!isMainThread())
|
if (!isMainThread())
|
||||||
return true;
|
return true;
|
||||||
const QString title = QtcProcess::tr("Process Not Responding");
|
const QString title = QtcProcess::tr("Process Not Responding");
|
||||||
QString msg = command.isEmpty() ?
|
QString msg = command.isEmpty() ? QtcProcess::tr("The process is not responding.")
|
||||||
QtcProcess::tr("The process is not responding.") :
|
: QtcProcess::tr("The process \"%1\" is not responding.")
|
||||||
QtcProcess::tr("The process \"%1\" is not responding.").arg(command);
|
.arg(command.executable().toUserOutput());
|
||||||
msg += ' ';
|
msg += ' ';
|
||||||
msg += QtcProcess::tr("Terminate the process?");
|
msg += QtcProcess::tr("Terminate the process?");
|
||||||
// Restore the cursor that is set to wait while running.
|
// Restore the cursor that is set to wait while running.
|
||||||
@@ -1287,7 +1287,7 @@ bool QtcProcess::readDataFromProcess(QByteArray *stdOut, QByteArray *stdErr, int
|
|||||||
}
|
}
|
||||||
// Prompt user, pretend we have data if says 'No'.
|
// Prompt user, pretend we have data if says 'No'.
|
||||||
const bool hang = !hasData && !finished;
|
const bool hang = !hasData && !finished;
|
||||||
hasData = hang && !askToKill(d->m_setup.m_commandLine.executable().path());
|
hasData = hang && !askToKill(d->m_setup.m_commandLine);
|
||||||
} while (hasData && !finished);
|
} while (hasData && !finished);
|
||||||
if (syncDebug)
|
if (syncDebug)
|
||||||
qDebug() << "<readDataFromProcess" << finished;
|
qDebug() << "<readDataFromProcess" << finished;
|
||||||
@@ -1924,8 +1924,7 @@ void QtcProcessPrivate::slotTimeout()
|
|||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << Q_FUNC_INFO << "HANG detected, killing";
|
qDebug() << Q_FUNC_INFO << "HANG detected, killing";
|
||||||
m_waitingForUser = true;
|
m_waitingForUser = true;
|
||||||
const bool terminate = !m_timeOutMessageBoxEnabled
|
const bool terminate = !m_timeOutMessageBoxEnabled || askToKill(m_setup.m_commandLine);
|
||||||
|| askToKill(m_setup.m_commandLine.executable().toString());
|
|
||||||
m_waitingForUser = false;
|
m_waitingForUser = false;
|
||||||
if (terminate) {
|
if (terminate) {
|
||||||
q->stop();
|
q->stop();
|
||||||
|
Reference in New Issue
Block a user