Tools: Improve wording
We start an executable and that results in a process. "program" is not very well defined here. Change-Id: Iec00ec806843c93951f0dcfbfe46984bf599470f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
parent
6fb7a51ab4
commit
3a54b30784
|
@ -104,11 +104,11 @@ void QmlPreviewApplication::parseArguments()
|
|||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
|
||||
parser.addPositionalArgument(QLatin1String("program"),
|
||||
tr("The program to be started and previewed."),
|
||||
QLatin1String("[program]"));
|
||||
parser.addPositionalArgument(QLatin1String("executable"),
|
||||
tr("The executable to be started and previewed."),
|
||||
QLatin1String("[executable]"));
|
||||
parser.addPositionalArgument(QLatin1String("parameters"),
|
||||
tr("Parameters for the program to be started."),
|
||||
tr("Parameters for the executable to be started."),
|
||||
QLatin1String("[parameters...]"));
|
||||
|
||||
parser.process(*this);
|
||||
|
@ -120,12 +120,12 @@ void QmlPreviewApplication::parseArguments()
|
|||
if (parser.isSet(verbose))
|
||||
m_verbose = true;
|
||||
|
||||
m_programArguments = parser.positionalArguments();
|
||||
if (!m_programArguments.isEmpty())
|
||||
m_programPath = m_programArguments.takeFirst();
|
||||
m_arguments = parser.positionalArguments();
|
||||
if (!m_arguments.isEmpty())
|
||||
m_executablePath = m_arguments.takeFirst();
|
||||
|
||||
if (m_programPath.isEmpty()) {
|
||||
logError(tr("You have to specify a program to start."));
|
||||
if (m_executablePath.isEmpty()) {
|
||||
logError(tr("You have to specify an executable to start."));
|
||||
parser.showHelp(2);
|
||||
}
|
||||
}
|
||||
|
@ -143,17 +143,17 @@ void QmlPreviewApplication::run()
|
|||
m_process.reset(new QProcess(this));
|
||||
QStringList arguments;
|
||||
arguments << QString("-qmljsdebugger=file:%1,block,services:QmlPreview").arg(m_socketFile);
|
||||
arguments << m_programArguments;
|
||||
arguments << m_arguments;
|
||||
|
||||
m_process->setProcessChannelMode(QProcess::MergedChannels);
|
||||
connect(m_process.data(), &QIODevice::readyRead,
|
||||
this, &QmlPreviewApplication::processHasOutput);
|
||||
connect(m_process.data(), static_cast<void(QProcess::*)(int)>(&QProcess::finished),
|
||||
this, [this](int){ processFinished(); });
|
||||
logStatus(QString("Starting '%1 %2' ...").arg(m_programPath, arguments.join(QLatin1Char(' '))));
|
||||
m_process->start(m_programPath, arguments);
|
||||
logStatus(QString("Starting '%1 %2' ...").arg(m_executablePath, arguments.join(QLatin1Char(' '))));
|
||||
m_process->start(m_executablePath, arguments);
|
||||
if (!m_process->waitForStarted()) {
|
||||
logError(QString("Could not run '%1': %2").arg(m_programPath, m_process->errorString()));
|
||||
logError(QString("Could not run '%1': %2").arg(m_executablePath, m_process->errorString()));
|
||||
exit(1);
|
||||
}
|
||||
m_connectTimer.start();
|
||||
|
|
|
@ -63,8 +63,8 @@ private:
|
|||
bool sendFile(const QString &path);
|
||||
void sendDirectory(const QString &path);
|
||||
|
||||
QString m_programPath;
|
||||
QStringList m_programArguments;
|
||||
QString m_executablePath;
|
||||
QStringList m_arguments;
|
||||
QScopedPointer<QProcess> m_process;
|
||||
bool m_verbose;
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ static const char commandTextC[] =
|
|||
" Stop recording if it is running, then output the\n"
|
||||
" data, and finally clear it from memory.\n"
|
||||
"'q', 'quit'\n"
|
||||
" Terminate the program if started from qmlprofiler,\n"
|
||||
" and qmlprofiler itself.";
|
||||
" Terminate the target process if started from\n"
|
||||
" qmlprofiler, and qmlprofiler itself.";
|
||||
|
||||
static const char *features[] = {
|
||||
"javascript",
|
||||
|
@ -199,11 +199,11 @@ void QmlProfilerApplication::parseArguments()
|
|||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
|
||||
parser.addPositionalArgument(QLatin1String("program"),
|
||||
tr("The program to be started and profiled."),
|
||||
QLatin1String("[program]"));
|
||||
parser.addPositionalArgument(QLatin1String("executable"),
|
||||
tr("The executable to be started and profiled."),
|
||||
QLatin1String("[executable]"));
|
||||
parser.addPositionalArgument(QLatin1String("parameters"),
|
||||
tr("Parameters for the program to be started."),
|
||||
tr("Parameters for the executable to be started."),
|
||||
QLatin1String("[parameters...]"));
|
||||
|
||||
parser.process(*this);
|
||||
|
@ -252,17 +252,17 @@ void QmlProfilerApplication::parseArguments()
|
|||
if (parser.isSet(verbose))
|
||||
m_verbose = true;
|
||||
|
||||
m_programArguments = parser.positionalArguments();
|
||||
if (!m_programArguments.isEmpty())
|
||||
m_programPath = m_programArguments.takeFirst();
|
||||
m_arguments = parser.positionalArguments();
|
||||
if (!m_arguments.isEmpty())
|
||||
m_executablePath = m_arguments.takeFirst();
|
||||
|
||||
if (m_runMode == LaunchMode && m_programPath.isEmpty()) {
|
||||
logError(tr("You have to specify either --attach or a program to start."));
|
||||
if (m_runMode == LaunchMode && m_executablePath.isEmpty()) {
|
||||
logError(tr("You have to specify either --attach or an executable to start."));
|
||||
parser.showHelp(2);
|
||||
}
|
||||
|
||||
if (m_runMode == AttachMode && !m_programPath.isEmpty()) {
|
||||
logError(tr("--attach cannot be used when starting a program."));
|
||||
if (m_runMode == AttachMode && !m_executablePath.isEmpty()) {
|
||||
logError(tr("--attach cannot be used when starting an executable."));
|
||||
parser.showHelp(3);
|
||||
}
|
||||
}
|
||||
|
@ -469,17 +469,17 @@ void QmlProfilerApplication::run()
|
|||
arguments << QString::fromLatin1("-qmljsdebugger=%1:%2,block,services:CanvasFrameRate")
|
||||
.arg(QLatin1String(m_socketFile.isEmpty() ? "port" : "file"))
|
||||
.arg(m_socketFile.isEmpty() ? QString::number(m_port) : m_socketFile);
|
||||
arguments << m_programArguments;
|
||||
arguments << m_arguments;
|
||||
|
||||
m_process->setProcessChannelMode(QProcess::MergedChannels);
|
||||
connect(m_process, &QIODevice::readyRead, this, &QmlProfilerApplication::processHasOutput);
|
||||
connect(m_process, static_cast<void(QProcess::*)(int)>(&QProcess::finished),
|
||||
this, [this](int){ processFinished(); });
|
||||
logStatus(QString("Starting '%1 %2' ...").arg(m_programPath,
|
||||
logStatus(QString("Starting '%1 %2' ...").arg(m_executablePath,
|
||||
arguments.join(QLatin1Char(' '))));
|
||||
m_process->start(m_programPath, arguments);
|
||||
m_process->start(m_executablePath, arguments);
|
||||
if (!m_process->waitForStarted()) {
|
||||
logError(QString("Could not run '%1': %2").arg(m_programPath,
|
||||
logError(QString("Could not run '%1': %2").arg(m_executablePath,
|
||||
m_process->errorString()));
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -91,8 +91,8 @@ private:
|
|||
} m_runMode;
|
||||
|
||||
// LaunchMode
|
||||
QString m_programPath;
|
||||
QStringList m_programArguments;
|
||||
QString m_executablePath;
|
||||
QStringList m_arguments;
|
||||
QProcess *m_process;
|
||||
|
||||
QString m_socketFile;
|
||||
|
|
Loading…
Reference in New Issue