Commit e6f60265 authored by hjk's avatar hjk
Browse files

Valgrind: Random cleanups



Remove unneeded function arguments, Qt 5 connects etc.

Change-Id: I95faf80e7b5ccc574e2457b841f7913bc2aa05d3
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent d01627bb
......@@ -84,7 +84,7 @@ private slots:
signals:
/// Must be emitted when the engine is starting.
void starting(const Analyzer::AnalyzerRunControl *);
void starting();
private:
bool supportsReRunning() const { return false; }
......
......@@ -307,7 +307,7 @@ static Core::Id toolchainType(ProjectExplorer::RunConfiguration *runConfiguratio
bool ClangStaticAnalyzerRunControl::startEngine()
{
m_success = false;
emit starting(this);
emit starting();
QTC_ASSERT(m_projectInfo.isValid(), emit finished(); return false);
const Utils::FileName projectFile = m_projectInfo.project()->projectFilePath();
......
......@@ -115,7 +115,7 @@ bool QmlProfilerRunControl::startEngine()
d->m_noDebugOutputTimer.start();
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppRunning);
emit starting(this);
emit starting();
return true;
}
......
......@@ -162,7 +162,7 @@ public slots:
void takeParserDataFromRunControl(CallgrindRunControl *rc);
void takeParserData(ParseData *data);
void engineStarting(const AnalyzerRunControl *);
void engineStarting();
void engineFinished();
void editorOpened(IEditor *);
......@@ -806,7 +806,7 @@ void CallgrindToolPrivate::clearTextMarks()
m_textMarks.clear();
}
void CallgrindToolPrivate::engineStarting(const AnalyzerRunControl *)
void CallgrindToolPrivate::engineStarting()
{
// enable/disable actions
m_resetAction->setEnabled(true);
......
......@@ -51,7 +51,6 @@ public:
ValgrindRunControl *createRunControl(ProjectExplorer::RunConfiguration *runConfiguration = 0);
QWidget *createWidgets();
public slots:
void handleShowCostsOfFunction();
private:
......
......@@ -429,53 +429,43 @@ MemcheckRunControl *MemcheckTool::createRunControl(RunConfiguration *runConfigur
m_frameFinder->setFiles(runConfiguration ? runConfiguration->target()
->project()->files(Project::AllFiles) : QStringList());
MemcheckRunControl *engine = 0;
MemcheckRunControl *runControl = 0;
if (runMode == MEMCHECK_RUN_MODE)
engine = new MemcheckRunControl(runConfiguration, runMode);
runControl = new MemcheckRunControl(runConfiguration, runMode);
else
engine = new MemcheckWithGdbRunControl(runConfiguration);
connect(engine, &MemcheckRunControl::starting, this, &MemcheckTool::engineStarting);
connect(engine, &MemcheckRunControl::parserError, this, &MemcheckTool::parserError);
connect(engine, &MemcheckRunControl::internalParserError, this, &MemcheckTool::internalParserError);
connect(engine, &MemcheckRunControl::finished, this, &MemcheckTool::engineFinished);
return engine;
runControl = new MemcheckWithGdbRunControl(runConfiguration);
connect(runControl, &MemcheckRunControl::starting,
this, [this, runControl]() { engineStarting(runControl); });
connect(runControl, &MemcheckRunControl::parserError, this, &MemcheckTool::parserError);
connect(runControl, &MemcheckRunControl::internalParserError, this, &MemcheckTool::internalParserError);
connect(runControl, &MemcheckRunControl::finished, this, &MemcheckTool::engineFinished);
return runControl;
}
void MemcheckTool::engineStarting(const AnalyzerRunControl *engine)
void MemcheckTool::engineStarting(const MemcheckRunControl *runControl)
{
setBusyCursor(true);
clearErrorView();
m_loadExternalLogFile->setDisabled(true);
QString dir;
if (RunConfiguration *rc = engine->runConfiguration())
if (RunConfiguration *rc = runControl->runConfiguration())
dir = rc->target()->project()->projectDirectory().toString() + QLatin1Char('/');
const MemcheckRunControl *mEngine = dynamic_cast<const MemcheckRunControl *>(engine);
QTC_ASSERT(mEngine, return);
const QString name = Utils::FileName::fromString(mEngine->executable()).fileName();
const QString name = Utils::FileName::fromString(runControl->executable()).fileName();
m_errorView->setDefaultSuppressionFile(dir + name + QLatin1String(".supp"));
foreach (const QString &file, mEngine->suppressionFiles()) {
foreach (const QString &file, runControl->suppressionFiles()) {
QAction *action = m_filterMenu->addAction(Utils::FileName::fromString(file).fileName());
action->setToolTip(file);
action->setData(file);
connect(action, &QAction::triggered, this, &MemcheckTool::suppressionActionTriggered);
connect(action, &QAction::triggered, this, [this, file]() {
Core::EditorManager::openEditorAt(file, 0);
});
m_suppressionActions.append(action);
}
}
void MemcheckTool::suppressionActionTriggered()
{
QAction *action = qobject_cast<QAction *>(sender());
QTC_ASSERT(action, return);
const QString file = action->data().toString();
QTC_ASSERT(!file.isEmpty(), return);
Core::EditorManager::openEditorAt(file, 0);
}
void MemcheckTool::loadExternalXmlLogFile()
{
const QString filePath = QFileDialog::getOpenFileName(
......
......@@ -88,22 +88,20 @@ public:
MemcheckRunControl *createRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
Core::Id runMode);
private slots:
private:
void settingsDestroyed(QObject *settings);
void maybeActiveRunConfigurationChanged();
void engineStarting(const Analyzer::AnalyzerRunControl *engine);
void engineStarting(const MemcheckRunControl *engine);
void engineFinished();
void loadingExternalXmlLogFileFinished();
void parserError(const Valgrind::XmlProtocol::Error &error);
void internalParserError(const QString &errorString);
void updateErrorFilter();
void suppressionActionTriggered();
void loadExternalXmlLogFile();
private:
void setBusyCursor(bool busy);
void clearErrorView();
......
......@@ -65,13 +65,9 @@ ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core:
m_settings = ValgrindPlugin::globalSettings();
}
ValgrindRunControl::~ValgrindRunControl()
{
}
bool ValgrindRunControl::startEngine()
{
emit starting(this);
emit starting();
FutureProgress *fp = ProgressManager::addTimedTask(m_progress, progressTitle(), "valgrind", 100);
fp->setKeepOnFinish(FutureProgress::HideOnFinish);
......
......@@ -45,7 +45,6 @@ class ValgrindRunControl : public Analyzer::AnalyzerRunControl
public:
ValgrindRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
Core::Id runMode);
~ValgrindRunControl();
bool startEngine();
void stopEngine();
......@@ -67,7 +66,7 @@ protected:
Utils::Environment m_environment;
ProjectExplorer::ApplicationLauncher::Mode m_localRunMode;
private slots:
private:
void handleProgressCanceled();
void handleProgressFinished();
void runnerFinished();
......@@ -75,7 +74,6 @@ private slots:
void receiveProcessOutput(const QString &output, Utils::OutputFormat format);
void receiveProcessError(const QString &message, QProcess::ProcessError error);
private:
QStringList genericToolArguments() const;
private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment