forked from qt-creator/qt-creator
Valgrind: Port to Qt5-style connect
Change-Id: If5f36bb262b932b60133d4301ab614311ce1feee Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -103,10 +103,10 @@ void CallgrindController::run(Option option)
|
||||
connection ? connection->connectionParameters() : QSsh::SshConnectionParameters(),
|
||||
connection, this);
|
||||
|
||||
connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)),
|
||||
SLOT(processFinished(int,QProcess::ExitStatus)));
|
||||
connect(m_process, SIGNAL(error(QProcess::ProcessError)),
|
||||
SLOT(processError(QProcess::ProcessError)));
|
||||
connect(m_process, &ValgrindProcess::finished,
|
||||
this, &CallgrindController::processFinished);
|
||||
connect(m_process, &ValgrindProcess::error,
|
||||
this, &CallgrindController::processError);
|
||||
|
||||
// save back current running operation
|
||||
m_lastOption = option;
|
||||
@@ -209,8 +209,8 @@ void CallgrindController::getLocalDataFile()
|
||||
// if there are files like callgrind.out.PID.NUM, set it to the most recent one of those
|
||||
QString cmd = QString::fromLatin1("ls -t %1* | head -n 1").arg(fileName);
|
||||
m_findRemoteFile = m_ssh->createRemoteProcess(cmd.toUtf8());
|
||||
connect(m_findRemoteFile.data(), SIGNAL(readyReadStandardOutput()), this,
|
||||
SLOT(foundRemoteFile()));
|
||||
connect(m_findRemoteFile.data(), &QSsh::SshRemoteProcess::readyReadStandardOutput,
|
||||
this, &CallgrindController::foundRemoteFile);
|
||||
m_findRemoteFile->start();
|
||||
} else {
|
||||
QDir dir(workingDir, QString::fromLatin1("%1.*").arg(baseFileName), QDir::Time);
|
||||
@@ -228,9 +228,10 @@ void CallgrindController::foundRemoteFile()
|
||||
m_remoteFile = m_findRemoteFile->readAllStandardOutput().trimmed();
|
||||
|
||||
m_sftp = m_ssh->createSftpChannel();
|
||||
connect(m_sftp.data(), SIGNAL(finished(QSsh::SftpJobId,QString)),
|
||||
this, SLOT(sftpJobFinished(QSsh::SftpJobId,QString)));
|
||||
connect(m_sftp.data(), SIGNAL(initialized()), this, SLOT(sftpInitialized()));
|
||||
connect(m_sftp.data(), &QSsh::SftpChannel::finished,
|
||||
this, &CallgrindController::sftpJobFinished);
|
||||
connect(m_sftp.data(), &QSsh::SftpChannel::initialized,
|
||||
this, &CallgrindController::sftpInitialized);
|
||||
m_sftp->initialize();
|
||||
}
|
||||
|
||||
|
||||
@@ -44,13 +44,12 @@ CallgrindRunner::CallgrindRunner(QObject *parent)
|
||||
, m_parser(new Parser(this))
|
||||
, m_paused(false)
|
||||
{
|
||||
connect(m_controller,
|
||||
SIGNAL(finished(Valgrind::Callgrind::CallgrindController::Option)),
|
||||
SLOT(controllerFinished(Valgrind::Callgrind::CallgrindController::Option)));
|
||||
connect(m_controller, SIGNAL(localParseDataAvailable(QString)),
|
||||
this, SLOT(localParseDataAvailable(QString)));
|
||||
connect(m_controller, SIGNAL(statusMessage(QString)),
|
||||
this, SIGNAL(statusMessage(QString)));
|
||||
connect(m_controller, &CallgrindController::finished,
|
||||
this, &CallgrindRunner::controllerFinished);
|
||||
connect(m_controller, &CallgrindController::localParseDataAvailable,
|
||||
this, &CallgrindRunner::localParseDataAvailable);
|
||||
connect(m_controller, &CallgrindController::statusMessage,
|
||||
this, &CallgrindRunner::statusMessage);
|
||||
}
|
||||
|
||||
QString CallgrindRunner::tool() const
|
||||
|
||||
@@ -50,7 +50,8 @@ CallgrindRunControl::CallgrindRunControl(const AnalyzerStartParameters &sp,
|
||||
{
|
||||
connect(&m_runner, &Callgrind::CallgrindRunner::finished,
|
||||
this, &CallgrindRunControl::slotFinished);
|
||||
connect(m_runner.parser(), SIGNAL(parserDataReady()), this, SLOT(slotFinished()));
|
||||
connect(m_runner.parser(), &Callgrind::Parser::parserDataReady,
|
||||
this, &CallgrindRunControl::slotFinished);
|
||||
connect(&m_runner, &Callgrind::CallgrindRunner::statusMessage,
|
||||
this, &CallgrindRunControl::showStatusMessage);
|
||||
}
|
||||
|
||||
@@ -234,9 +234,8 @@ Visualisation::Private::Private(Visualisation *qq)
|
||||
|
||||
// setup model
|
||||
m_model->setMinimumInclusiveCostRatio(0.1);
|
||||
connect(m_model,
|
||||
SIGNAL(filterFunctionChanged(const Function*,const Function*)),
|
||||
qq, SLOT(populateScene()));
|
||||
connect(m_model, &DataProxyModel::filterFunctionChanged,
|
||||
qq, &Visualisation::populateScene);
|
||||
}
|
||||
|
||||
void Visualisation::Private::handleMousePressEvent(QMouseEvent *event,
|
||||
@@ -326,32 +325,24 @@ void Visualisation::setModel(QAbstractItemModel *model)
|
||||
QTC_ASSERT(!d->m_model->sourceModel() && model, return); // only set once!
|
||||
d->m_model->setSourceModel(model);
|
||||
|
||||
connect(model,
|
||||
SIGNAL(columnsInserted(QModelIndex,int,int)),
|
||||
SLOT(populateScene()));
|
||||
connect(model,
|
||||
SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
|
||||
SLOT(populateScene()));
|
||||
connect(model,
|
||||
SIGNAL(columnsRemoved(QModelIndex,int,int)),
|
||||
SLOT(populateScene()));
|
||||
connect(model,
|
||||
SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
SLOT(populateScene()));
|
||||
connect(model,
|
||||
SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
|
||||
SLOT(populateScene()));
|
||||
connect(model, SIGNAL(layoutChanged()), SLOT(populateScene()));
|
||||
connect(model, SIGNAL(modelReset()), SLOT(populateScene()));
|
||||
connect(model,
|
||||
SIGNAL(rowsInserted(QModelIndex,int,int)),
|
||||
SLOT(populateScene()));
|
||||
connect(model,
|
||||
SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
|
||||
SLOT(populateScene()));
|
||||
connect(model,
|
||||
SIGNAL(rowsRemoved(QModelIndex,int,int)),
|
||||
SLOT(populateScene()));
|
||||
connect(model, &QAbstractItemModel::columnsInserted,
|
||||
this, &Visualisation::populateScene);
|
||||
connect(model, &QAbstractItemModel::columnsMoved,
|
||||
this, &Visualisation::populateScene);
|
||||
connect(model, &QAbstractItemModel::columnsRemoved,
|
||||
this, &Visualisation::populateScene);
|
||||
connect(model, &QAbstractItemModel::dataChanged,
|
||||
this, &Visualisation::populateScene);
|
||||
connect(model, &QAbstractItemModel::headerDataChanged,
|
||||
this, &Visualisation::populateScene);
|
||||
connect(model, &QAbstractItemModel::layoutChanged, this, &Visualisation::populateScene);
|
||||
connect(model, &QAbstractItemModel::modelReset, this, &Visualisation::populateScene);
|
||||
connect(model, &QAbstractItemModel::rowsInserted,
|
||||
this, &Visualisation::populateScene);
|
||||
connect(model, &QAbstractItemModel::rowsMoved,
|
||||
this, &Visualisation::populateScene);
|
||||
connect(model, &QAbstractItemModel::rowsRemoved,
|
||||
this, &Visualisation::populateScene);
|
||||
|
||||
populateScene();
|
||||
}
|
||||
|
||||
@@ -118,8 +118,8 @@ void MemcheckRunner::logSocketConnected()
|
||||
{
|
||||
d->logSocket = d->logServer.nextPendingConnection();
|
||||
QTC_ASSERT(d->logSocket, return);
|
||||
connect(d->logSocket, SIGNAL(readyRead()),
|
||||
this, SLOT(readLogSocket()));
|
||||
connect(d->logSocket, &QIODevice::readyRead,
|
||||
this, &MemcheckRunner::readLogSocket);
|
||||
d->logServer.close();
|
||||
}
|
||||
|
||||
@@ -141,7 +141,8 @@ bool MemcheckRunner::startServers(const QHostAddress &localHostAddress)
|
||||
return false;
|
||||
}
|
||||
d->xmlServer.setMaxPendingConnections(1);
|
||||
connect(&d->xmlServer, SIGNAL(newConnection()), SLOT(xmlSocketConnected()));
|
||||
connect(&d->xmlServer, &QTcpServer::newConnection,
|
||||
this, &MemcheckRunner::xmlSocketConnected);
|
||||
check = d->logServer.listen(localHostAddress);
|
||||
if (!check) {
|
||||
emit processErrorReceived( tr("LogServer on %1:").arg(ip) + QLatin1Char(' ')
|
||||
@@ -149,7 +150,8 @@ bool MemcheckRunner::startServers(const QHostAddress &localHostAddress)
|
||||
return false;
|
||||
}
|
||||
d->logServer.setMaxPendingConnections(1);
|
||||
connect(&d->logServer, SIGNAL(newConnection()), SLOT(logSocketConnected()));
|
||||
connect(&d->logServer, &QTcpServer::newConnection,
|
||||
this, &MemcheckRunner::logSocketConnected);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,8 +84,8 @@ bool MemcheckRunControl::startEngine()
|
||||
|
||||
void MemcheckRunControl::stopEngine()
|
||||
{
|
||||
disconnect(&m_parser, SIGNAL(internalError(QString)),
|
||||
this, SIGNAL(internalParserError(QString)));
|
||||
disconnect(&m_parser, &ThreadedParser::internalError,
|
||||
this, &MemcheckRunControl::internalParserError);
|
||||
ValgrindRunControl::stopEngine();
|
||||
}
|
||||
|
||||
|
||||
@@ -364,8 +364,8 @@ QWidget *MemcheckTool::createWidgets()
|
||||
errorDock->show();
|
||||
mw->splitDockWidget(mw->toolBarDockWidget(), errorDock, Qt::Vertical);
|
||||
|
||||
connect(ProjectExplorerPlugin::instance(),
|
||||
SIGNAL(updateRunActions()), SLOT(maybeActiveRunConfigurationChanged()));
|
||||
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions,
|
||||
this, &MemcheckTool::maybeActiveRunConfigurationChanged);
|
||||
|
||||
//
|
||||
// The Control Widget.
|
||||
|
||||
@@ -166,10 +166,14 @@ SuppressionDialog::SuppressionDialog(MemcheckErrorView *view, const QList<Error>
|
||||
|
||||
m_suppressionEdit->setPlainText(suppressions);
|
||||
|
||||
connect(m_fileChooser, SIGNAL(validChanged()), SLOT(validate()));
|
||||
connect(m_suppressionEdit->document(), SIGNAL(contentsChanged()), SLOT(validate()));
|
||||
connect(m_buttonBox, SIGNAL(accepted()), SLOT(accept()));
|
||||
connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||
connect(m_fileChooser, static_cast<void (Utils::PathChooser:: *)()>(&Utils::PathChooser::validChanged),
|
||||
this, &SuppressionDialog::validate);
|
||||
connect(m_suppressionEdit->document(), &QTextDocument::contentsChanged,
|
||||
this, &SuppressionDialog::validate);
|
||||
connect(m_buttonBox, &QDialogButtonBox::accepted,
|
||||
this, &SuppressionDialog::accept);
|
||||
connect(m_buttonBox, &QDialogButtonBox::rejected,
|
||||
this, &SuppressionDialog::reject);
|
||||
}
|
||||
|
||||
void SuppressionDialog::maybeShow(MemcheckErrorView *view)
|
||||
|
||||
@@ -67,8 +67,8 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings,
|
||||
|
||||
connect(m_ui->valgrindExeChooser, &Utils::PathChooser::changed,
|
||||
m_settings, &ValgrindBaseSettings::setValgrindExecutable);
|
||||
connect(m_settings, SIGNAL(valgrindExecutableChanged(QString)),
|
||||
m_ui->valgrindExeChooser, SLOT(setPath(QString)));
|
||||
connect(m_settings, &ValgrindBaseSettings::valgrindExecutableChanged,
|
||||
m_ui->valgrindExeChooser, &Utils::PathChooser::setPath);
|
||||
connect(m_ui->smcDetectionComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
m_settings, &ValgrindBaseSettings::setSelfModifyingCodeDetection);
|
||||
|
||||
@@ -84,38 +84,38 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings,
|
||||
//
|
||||
connect(m_ui->enableCacheSim, &QCheckBox::toggled,
|
||||
m_settings, &ValgrindBaseSettings::setEnableCacheSim);
|
||||
connect(m_settings, SIGNAL(enableCacheSimChanged(bool)),
|
||||
m_ui->enableCacheSim, SLOT(setChecked(bool)));
|
||||
connect(m_settings, &ValgrindBaseSettings::enableCacheSimChanged,
|
||||
m_ui->enableCacheSim, &QAbstractButton::setChecked);
|
||||
|
||||
connect(m_ui->enableBranchSim, &QCheckBox::toggled,
|
||||
m_settings, &ValgrindBaseSettings::setEnableBranchSim);
|
||||
connect(m_settings, SIGNAL(enableBranchSimChanged(bool)),
|
||||
m_ui->enableBranchSim, SLOT(setChecked(bool)));
|
||||
connect(m_settings, &ValgrindBaseSettings::enableBranchSimChanged,
|
||||
m_ui->enableBranchSim, &QAbstractButton::setChecked);
|
||||
|
||||
connect(m_ui->collectSystime, &QCheckBox::toggled,
|
||||
m_settings, &ValgrindBaseSettings::setCollectSystime);
|
||||
connect(m_settings, SIGNAL(collectSystimeChanged(bool)),
|
||||
m_ui->collectSystime, SLOT(setChecked(bool)));
|
||||
connect(m_settings, &ValgrindBaseSettings::collectSystimeChanged,
|
||||
m_ui->collectSystime, &QAbstractButton::setChecked);
|
||||
|
||||
connect(m_ui->collectBusEvents, &QCheckBox::toggled,
|
||||
m_settings, &ValgrindBaseSettings::setCollectBusEvents);
|
||||
connect(m_settings, SIGNAL(collectBusEventsChanged(bool)),
|
||||
m_ui->collectBusEvents, SLOT(setChecked(bool)));
|
||||
connect(m_settings, &ValgrindBaseSettings::collectBusEventsChanged,
|
||||
m_ui->collectBusEvents, &QAbstractButton::setChecked);
|
||||
|
||||
connect(m_ui->enableEventToolTips, &QGroupBox::toggled,
|
||||
m_settings, &ValgrindBaseSettings::setEnableEventToolTips);
|
||||
connect(m_settings, SIGNAL(enableEventToolTipsChanged(bool)),
|
||||
m_ui->enableEventToolTips, SLOT(setChecked(bool)));
|
||||
connect(m_settings, &ValgrindBaseSettings::enableEventToolTipsChanged,
|
||||
m_ui->enableEventToolTips, &QGroupBox::setChecked);
|
||||
|
||||
connect(m_ui->minimumInclusiveCostRatio, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
||||
m_settings, &ValgrindBaseSettings::setMinimumInclusiveCostRatio);
|
||||
connect(m_settings, SIGNAL(minimumInclusiveCostRatioChanged(double)),
|
||||
m_ui->minimumInclusiveCostRatio, SLOT(setValue(double)));
|
||||
connect(m_settings, &ValgrindBaseSettings::minimumInclusiveCostRatioChanged,
|
||||
m_ui->minimumInclusiveCostRatio, &QDoubleSpinBox::setValue);
|
||||
|
||||
connect(m_ui->visualisationMinimumInclusiveCostRatio, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
||||
m_settings, &ValgrindBaseSettings::setVisualisationMinimumInclusiveCostRatio);
|
||||
connect(m_settings, SIGNAL(visualisationMinimumInclusiveCostRatioChanged(double)),
|
||||
m_ui->visualisationMinimumInclusiveCostRatio, SLOT(setValue(double)));
|
||||
connect(m_settings, &ValgrindBaseSettings::visualisationMinimumInclusiveCostRatioChanged,
|
||||
m_ui->visualisationMinimumInclusiveCostRatio, &QDoubleSpinBox::setValue);
|
||||
|
||||
//
|
||||
// Memcheck
|
||||
@@ -128,28 +128,30 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings,
|
||||
|
||||
connect(m_ui->numCallers, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||
m_settings, &ValgrindBaseSettings::setNumCallers);
|
||||
connect(m_settings, SIGNAL(numCallersChanged(int)), m_ui->numCallers, SLOT(setValue(int)));
|
||||
connect(m_settings, &ValgrindBaseSettings::numCallersChanged,
|
||||
m_ui->numCallers, &QSpinBox::setValue);
|
||||
|
||||
connect(m_ui->leakCheckOnFinish, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
m_settings, &ValgrindBaseSettings::setLeakCheckOnFinish);
|
||||
connect(m_settings, SIGNAL(leakCheckOnFinishChanged(int)),
|
||||
m_ui->leakCheckOnFinish, SLOT(setCurrentIndex(int)));
|
||||
connect(m_settings, &ValgrindBaseSettings::leakCheckOnFinishChanged,
|
||||
m_ui->leakCheckOnFinish, &QComboBox::setCurrentIndex);
|
||||
|
||||
connect(m_ui->showReachable, &QCheckBox::toggled, m_settings, &ValgrindBaseSettings::setShowReachable);
|
||||
connect(m_settings, SIGNAL(showReachableChanged(bool)),
|
||||
m_ui->showReachable, SLOT(setChecked(bool)));
|
||||
connect(m_ui->showReachable, &QCheckBox::toggled,
|
||||
m_settings, &ValgrindBaseSettings::setShowReachable);
|
||||
connect(m_settings, &ValgrindBaseSettings::showReachableChanged,
|
||||
m_ui->showReachable, &QAbstractButton::setChecked);
|
||||
|
||||
connect(m_ui->trackOrigins, &QCheckBox::toggled, m_settings, &ValgrindBaseSettings::setTrackOrigins);
|
||||
connect(m_settings, SIGNAL(trackOriginsChanged(bool)),
|
||||
m_ui->trackOrigins, SLOT(setChecked(bool)));
|
||||
connect(m_settings, &ValgrindBaseSettings::trackOriginsChanged,
|
||||
m_ui->trackOrigins, &QAbstractButton::setChecked);
|
||||
|
||||
connect(m_settings, &ValgrindBaseSettings::suppressionFilesRemoved,
|
||||
this, &ValgrindConfigWidget::slotSuppressionsRemoved);
|
||||
connect(m_settings, &ValgrindBaseSettings::suppressionFilesAdded,
|
||||
this, &ValgrindConfigWidget::slotSuppressionsAdded);
|
||||
|
||||
connect(m_ui->suppressionList->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||
this, SLOT(slotSuppressionSelectionChanged()));
|
||||
connect(m_ui->suppressionList->selectionModel(), &QItemSelectionModel::selectionChanged,
|
||||
this, &ValgrindConfigWidget::slotSuppressionSelectionChanged);
|
||||
slotSuppressionSelectionChanged();
|
||||
|
||||
if (!global) {
|
||||
|
||||
@@ -169,10 +169,10 @@ void ValgrindRunControl::runnerFinished()
|
||||
|
||||
m_progress.reportFinished();
|
||||
|
||||
disconnect(runner(), SIGNAL(processOutputReceived(QString,Utils::OutputFormat)),
|
||||
this, SLOT(receiveProcessOutput(QString,Utils::OutputFormat)));
|
||||
disconnect(runner(), SIGNAL(finished()),
|
||||
this, SLOT(runnerFinished()));
|
||||
disconnect(runner(), &ValgrindRunner::processOutputReceived,
|
||||
this, &ValgrindRunControl::receiveProcessOutput);
|
||||
disconnect(runner(), &ValgrindRunner::finished,
|
||||
this, &ValgrindRunControl::runnerFinished);
|
||||
}
|
||||
|
||||
void ValgrindRunControl::receiveProcessOutput(const QString &output, OutputFormat format)
|
||||
|
||||
@@ -38,13 +38,15 @@
|
||||
#include <QDebug>
|
||||
#include <QEventLoop>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace Valgrind {
|
||||
|
||||
ValgrindProcess::ValgrindProcess(bool isLocal, const QSsh::SshConnectionParameters &sshParams,
|
||||
QSsh::SshConnection *connection, QObject *parent)
|
||||
: QObject(parent),
|
||||
m_isLocal(isLocal),
|
||||
m_localRunMode(ProjectExplorer::ApplicationLauncher::Gui)
|
||||
m_localRunMode(ApplicationLauncher::Gui)
|
||||
{
|
||||
m_remote.m_params = sshParams;
|
||||
m_remote.m_connection = connection;
|
||||
@@ -110,7 +112,7 @@ void ValgrindProcess::setEnvironment(const Utils::Environment &environment)
|
||||
///TODO: remote anything that should/could be done here?
|
||||
}
|
||||
|
||||
void ValgrindProcess::setLocalRunMode(ProjectExplorer::ApplicationLauncher::Mode localRunMode)
|
||||
void ValgrindProcess::setLocalRunMode(ApplicationLauncher::Mode localRunMode)
|
||||
{
|
||||
m_localRunMode = localRunMode;
|
||||
}
|
||||
@@ -140,14 +142,14 @@ void ValgrindProcess::close()
|
||||
void ValgrindProcess::run()
|
||||
{
|
||||
if (isLocal()) {
|
||||
connect(&m_localProcess, SIGNAL(processExited(int,QProcess::ExitStatus)),
|
||||
this, SIGNAL(finished(int,QProcess::ExitStatus)));
|
||||
connect(&m_localProcess, SIGNAL(processStarted()),
|
||||
this, SLOT(localProcessStarted()));
|
||||
connect(&m_localProcess, SIGNAL(error(QProcess::ProcessError)),
|
||||
this, SIGNAL(error(QProcess::ProcessError)));
|
||||
connect(&m_localProcess, SIGNAL(appendMessage(QString,Utils::OutputFormat)),
|
||||
this, SIGNAL(processOutput(QString,Utils::OutputFormat)));
|
||||
connect(&m_localProcess, &ApplicationLauncher::processExited,
|
||||
this, &ValgrindProcess::finished);
|
||||
connect(&m_localProcess, &ApplicationLauncher::processStarted,
|
||||
this, &ValgrindProcess::localProcessStarted);
|
||||
connect(&m_localProcess, &ApplicationLauncher::error,
|
||||
this, &ValgrindProcess::error);
|
||||
connect(&m_localProcess, &ApplicationLauncher::appendMessage,
|
||||
this, &ValgrindProcess::processOutput);
|
||||
|
||||
m_localProcess.start(m_localRunMode, m_valgrindExecutable,
|
||||
argumentString(Utils::HostOsInfo::hostOs()));
|
||||
@@ -161,9 +163,10 @@ void ValgrindProcess::run()
|
||||
m_remote.m_connection = new QSsh::SshConnection(m_remote.m_params, this);
|
||||
|
||||
if (m_remote.m_connection->state() != QSsh::SshConnection::Connected) {
|
||||
connect(m_remote.m_connection, SIGNAL(connected()), this, SLOT(connected()));
|
||||
connect(m_remote.m_connection, SIGNAL(error(QSsh::SshError)),
|
||||
this, SLOT(handleError(QSsh::SshError)));
|
||||
connect(m_remote.m_connection, &QSsh::SshConnection::connected,
|
||||
this, &ValgrindProcess::connected);
|
||||
connect(m_remote.m_connection, &QSsh::SshConnection::error,
|
||||
this, &ValgrindProcess::handleError);
|
||||
if (m_remote.m_connection->state() == QSsh::SshConnection::Unconnected)
|
||||
m_remote.m_connection->connectToHost();
|
||||
} else {
|
||||
@@ -239,14 +242,14 @@ void ValgrindProcess::connected()
|
||||
cmd += m_remote.m_valgrindExe + QLatin1Char(' ') + argumentString(Utils::OsTypeLinux);
|
||||
|
||||
m_remote.m_process = m_remote.m_connection->createRemoteProcess(cmd.toUtf8());
|
||||
connect(m_remote.m_process.data(), SIGNAL(readyReadStandardError()),
|
||||
this, SLOT(handleRemoteStderr()));
|
||||
connect(m_remote.m_process.data(), SIGNAL(readyReadStandardOutput()),
|
||||
this, SLOT(handleRemoteStdout()));
|
||||
connect(m_remote.m_process.data(), SIGNAL(closed(int)),
|
||||
this, SLOT(closed(int)));
|
||||
connect(m_remote.m_process.data(), SIGNAL(started()),
|
||||
this, SLOT(remoteProcessStarted()));
|
||||
connect(m_remote.m_process.data(), &QSsh::SshRemoteProcess::readyReadStandardError,
|
||||
this, &ValgrindProcess::handleRemoteStderr);
|
||||
connect(m_remote.m_process.data(), &QSsh::SshRemoteProcess::readyReadStandardOutput,
|
||||
this, &ValgrindProcess::handleRemoteStdout);
|
||||
connect(m_remote.m_process.data(), &QSsh::SshRemoteProcess::closed,
|
||||
this, &ValgrindProcess::closed);
|
||||
connect(m_remote.m_process.data(), &QSsh::SshRemoteProcess::started,
|
||||
this, &ValgrindProcess::remoteProcessStarted);
|
||||
m_remote.m_process->start();
|
||||
}
|
||||
|
||||
@@ -285,10 +288,10 @@ void ValgrindProcess::remoteProcessStarted()
|
||||
).arg(proc, Utils::FileName::fromString(m_remote.m_debuggee).fileName());
|
||||
|
||||
m_remote.m_findPID = m_remote.m_connection->createRemoteProcess(cmd.toUtf8());
|
||||
connect(m_remote.m_findPID.data(), SIGNAL(readyReadStandardError()),
|
||||
this, SLOT(handleRemoteStderr()));
|
||||
connect(m_remote.m_findPID.data(), SIGNAL(readyReadStandardOutput()),
|
||||
this, SLOT(findPIDOutputReceived()));
|
||||
connect(m_remote.m_findPID.data(), &QSsh::SshRemoteProcess::readyReadStandardError,
|
||||
this, &ValgrindProcess::handleRemoteStderr);
|
||||
connect(m_remote.m_findPID.data(), &QSsh::SshRemoteProcess::readyReadStandardOutput,
|
||||
this, &ValgrindProcess::findPIDOutputReceived);
|
||||
m_remote.m_findPID->start();
|
||||
}
|
||||
|
||||
|
||||
@@ -94,16 +94,16 @@ void ValgrindRunner::Private::run(ValgrindProcess *_process)
|
||||
// consider appending our options last so they override any interfering user-supplied options
|
||||
// -q as suggested by valgrind manual
|
||||
|
||||
QObject::connect(process, SIGNAL(processOutput(QString,Utils::OutputFormat)),
|
||||
q, SIGNAL(processOutputReceived(QString,Utils::OutputFormat)));
|
||||
QObject::connect(process, SIGNAL(started()),
|
||||
q, SLOT(processStarted()));
|
||||
QObject::connect(process, SIGNAL(finished(int,QProcess::ExitStatus)),
|
||||
q, SLOT(processFinished(int,QProcess::ExitStatus)));
|
||||
QObject::connect(process, SIGNAL(error(QProcess::ProcessError)),
|
||||
q, SLOT(processError(QProcess::ProcessError)));
|
||||
QObject::connect(process, SIGNAL(localHostAddressRetrieved(QHostAddress)), q,
|
||||
SLOT(localHostAddressRetrieved(QHostAddress)));
|
||||
QObject::connect(process, &ValgrindProcess::processOutput,
|
||||
q, &ValgrindRunner::processOutputReceived);
|
||||
QObject::connect(process, &ValgrindProcess::started,
|
||||
q, &ValgrindRunner::started);
|
||||
QObject::connect(process, &ValgrindProcess::finished,
|
||||
q, &ValgrindRunner::processFinished);
|
||||
QObject::connect(process, &ValgrindProcess::error,
|
||||
q, &ValgrindRunner::processError);
|
||||
QObject::connect(process, &ValgrindProcess::localHostAddressRetrieved, q,
|
||||
&ValgrindRunner::localHostAddressRetrieved);
|
||||
|
||||
process->setValgrindExecutable(valgrindExecutable);
|
||||
process->setValgrindArguments(q->fullValgrindArguments());
|
||||
@@ -234,7 +234,7 @@ void ValgrindRunner::waitForFinished() const
|
||||
return;
|
||||
|
||||
QEventLoop loop;
|
||||
connect(this, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
connect(this, &ValgrindRunner::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
}
|
||||
|
||||
@@ -275,11 +275,6 @@ void ValgrindRunner::localHostAddressRetrieved(const QHostAddress &localHostAddr
|
||||
Q_UNUSED(localHostAddress);
|
||||
}
|
||||
|
||||
void ValgrindRunner::processStarted()
|
||||
{
|
||||
emit started();
|
||||
}
|
||||
|
||||
QString ValgrindRunner::errorString() const
|
||||
{
|
||||
if (d->process)
|
||||
|
||||
@@ -101,7 +101,6 @@ signals:
|
||||
|
||||
protected slots:
|
||||
virtual void processError(QProcess::ProcessError);
|
||||
virtual void processStarted();
|
||||
virtual void processFinished(int, QProcess::ExitStatus);
|
||||
virtual void localHostAddressRetrieved(const QHostAddress &localHostAddress);
|
||||
|
||||
|
||||
@@ -108,29 +108,30 @@ void ThreadedParser::parse(QIODevice *device)
|
||||
Parser *parser = new Parser;
|
||||
qRegisterMetaType<Valgrind::XmlProtocol::Status>();
|
||||
qRegisterMetaType<Valgrind::XmlProtocol::Error>();
|
||||
connect(parser, SIGNAL(status(Valgrind::XmlProtocol::Status)),
|
||||
SIGNAL(status(Valgrind::XmlProtocol::Status)),
|
||||
connect(parser, &Parser::status,
|
||||
this, &ThreadedParser::status,
|
||||
Qt::QueuedConnection);
|
||||
connect(parser, SIGNAL(error(Valgrind::XmlProtocol::Error)),
|
||||
SIGNAL(error(Valgrind::XmlProtocol::Error)),
|
||||
connect(parser, &Parser::error,
|
||||
this, &ThreadedParser::error,
|
||||
Qt::QueuedConnection);
|
||||
connect(parser, SIGNAL(internalError(QString)),
|
||||
SLOT(slotInternalError(QString)),
|
||||
connect(parser, &Parser::internalError,
|
||||
this, &ThreadedParser::slotInternalError,
|
||||
Qt::QueuedConnection);
|
||||
connect(parser, SIGNAL(errorCount(qint64,qint64)),
|
||||
SIGNAL(errorCount(qint64,qint64)),
|
||||
connect(parser, &Parser::errorCount,
|
||||
this, &ThreadedParser::errorCount,
|
||||
Qt::QueuedConnection);
|
||||
connect(parser, SIGNAL(suppressionCount(QString,qint64)),
|
||||
SIGNAL(suppressionCount(QString,qint64)),
|
||||
connect(parser, &Parser::suppressionCount,
|
||||
this, &ThreadedParser::suppressionCount,
|
||||
Qt::QueuedConnection);
|
||||
connect(parser, SIGNAL(finished()), SIGNAL(finished()),
|
||||
connect(parser, &Parser::finished,
|
||||
this, &ThreadedParser::finished,
|
||||
Qt::QueuedConnection);
|
||||
|
||||
|
||||
Thread *thread = new Thread;
|
||||
d->parserThread = thread;
|
||||
connect(thread, SIGNAL(finished()),
|
||||
thread, SLOT(deleteLater()));
|
||||
connect(thread, &QThread::finished,
|
||||
thread, &QObject::deleteLater);
|
||||
device->setParent(0);
|
||||
device->moveToThread(thread);
|
||||
parser->moveToThread(thread);
|
||||
|
||||
Reference in New Issue
Block a user