Valgrind: Remove starting() signal

It's only used internally as one-time communication between
worker and the *Tool singleton that handles toolbar button
states.

We basically start immediately after creation of the worker, so
any pre-start tool bar specific operations can be done at
RunWorker creation time.

Medium term, the runworker should proably steer "their" buttons
more directly.

Change-Id: Id6df703746ece5eebc23507739cd2a92ec55d11d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2017-06-27 17:30:32 +02:00
parent 228e4a7542
commit 682cd36b15
4 changed files with 10 additions and 37 deletions

View File

@@ -135,7 +135,6 @@ signals:
void pauseToggled(bool checked); void pauseToggled(bool checked);
public: public:
void slotClear();
void slotRequestDump(); void slotRequestDump();
void loadExternalLogFile(); void loadExternalLogFile();
@@ -158,7 +157,6 @@ public:
void handleFilterProjectCosts(); void handleFilterProjectCosts();
void handleShowCostsOfFunction(); void handleShowCostsOfFunction();
void slotGoToOverview();
void stackBrowserChanged(); void stackBrowserChanged();
/// If \param busy is true, all widgets get a busy cursor when hovered /// If \param busy is true, all widgets get a busy cursor when hovered
@@ -172,7 +170,6 @@ public:
void takeParserDataFromRunControl(CallgrindToolRunner *rc); void takeParserDataFromRunControl(CallgrindToolRunner *rc);
void takeParserData(ParseData *data); void takeParserData(ParseData *data);
void engineStarting();
void engineFinished(); void engineFinished();
void editorOpened(IEditor *); void editorOpened(IEditor *);
@@ -526,16 +523,6 @@ CallgrindTool::~CallgrindTool()
qDeleteAll(m_textMarks); qDeleteAll(m_textMarks);
} }
void CallgrindTool::slotGoToOverview()
{
selectFunction(0);
}
void CallgrindTool::slotClear()
{
doClear(true);
}
void CallgrindTool::doClear(bool clearParseData) void CallgrindTool::doClear(bool clearParseData)
{ {
if (clearParseData) // Crashed when done from destructor. if (clearParseData) // Crashed when done from destructor.
@@ -760,7 +747,6 @@ ValgrindToolRunner *CallgrindTool::createRunTool(RunControl *runControl)
auto toolRunner = new CallgrindToolRunner(runControl); auto toolRunner = new CallgrindToolRunner(runControl);
connect(toolRunner, &CallgrindToolRunner::parserDataReady, this, &CallgrindTool::takeParserDataFromRunControl); connect(toolRunner, &CallgrindToolRunner::parserDataReady, this, &CallgrindTool::takeParserDataFromRunControl);
connect(toolRunner, &CallgrindToolRunner::starting, this, &CallgrindTool::engineStarting);
connect(runControl, &RunControl::finished, this, &CallgrindTool::engineFinished); connect(runControl, &RunControl::finished, this, &CallgrindTool::engineFinished);
connect(this, &CallgrindTool::dumpRequested, toolRunner, &CallgrindToolRunner::dump); connect(this, &CallgrindTool::dumpRequested, toolRunner, &CallgrindToolRunner::dump);
@@ -790,6 +776,13 @@ ValgrindToolRunner *CallgrindTool::createRunTool(RunControl *runControl)
m_toolBusy = true; m_toolBusy = true;
updateRunActions(); updateRunActions();
// enable/disable actions
m_resetAction->setEnabled(true);
m_dumpAction->setEnabled(true);
m_loadExternalLogFile->setEnabled(false);
clearTextMarks();
doClear(true);
return toolRunner; return toolRunner;
} }
@@ -813,16 +806,6 @@ void CallgrindTool::clearTextMarks()
m_textMarks.clear(); m_textMarks.clear();
} }
void CallgrindTool::engineStarting()
{
// enable/disable actions
m_resetAction->setEnabled(true);
m_dumpAction->setEnabled(true);
m_loadExternalLogFile->setEnabled(false);
clearTextMarks();
slotClear();
}
void CallgrindTool::engineFinished() void CallgrindTool::engineFinished()
{ {
m_toolBusy = false; m_toolBusy = false;
@@ -943,7 +926,7 @@ void CallgrindTool::takeParserData(ParseData *data)
// clear first // clear first
clearTextMarks(); clearTextMarks();
slotClear(); doClear(true);
setParseData(data); setParseData(data);
createTextMarks(); createTextMarks();

View File

@@ -250,7 +250,6 @@ private:
void settingsDestroyed(QObject *settings); void settingsDestroyed(QObject *settings);
void maybeActiveRunConfigurationChanged(); void maybeActiveRunConfigurationChanged();
void engineStarting(const MemcheckToolRunner *engine);
void engineFinished(); void engineFinished();
void loadingExternalXmlLogFileFinished(); void loadingExternalXmlLogFileFinished();
@@ -565,8 +564,6 @@ RunWorker *MemcheckTool::createRunWorker(RunControl *runControl)
auto runTool = new MemcheckToolRunner(runControl, runControl->runMode() == MEMCHECK_WITH_GDB_RUN_MODE); auto runTool = new MemcheckToolRunner(runControl, runControl->runMode() == MEMCHECK_WITH_GDB_RUN_MODE);
connect(runTool, &MemcheckToolRunner::starting,
this, [this, runTool] { engineStarting(runTool); });
connect(runTool, &MemcheckToolRunner::parserError, this, &MemcheckTool::parserError); connect(runTool, &MemcheckToolRunner::parserError, this, &MemcheckTool::parserError);
connect(runTool, &MemcheckToolRunner::internalParserError, this, &MemcheckTool::internalParserError); connect(runTool, &MemcheckToolRunner::internalParserError, this, &MemcheckTool::internalParserError);
connect(runTool, &MemcheckToolRunner::stopped, this, &MemcheckTool::engineFinished); connect(runTool, &MemcheckToolRunner::stopped, this, &MemcheckTool::engineFinished);
@@ -576,11 +573,6 @@ RunWorker *MemcheckTool::createRunWorker(RunControl *runControl)
m_toolBusy = true; m_toolBusy = true;
updateRunActions(); updateRunActions();
return runTool;
}
void MemcheckTool::engineStarting(const MemcheckToolRunner *runTool)
{
setBusyCursor(true); setBusyCursor(true);
clearErrorView(); clearErrorView();
m_loadExternalLogFile->setDisabled(true); m_loadExternalLogFile->setDisabled(true);
@@ -601,6 +593,8 @@ void MemcheckTool::engineStarting(const MemcheckToolRunner *runTool)
}); });
m_suppressionActions.append(action); m_suppressionActions.append(action);
} }
return runTool;
} }
void MemcheckTool::loadExternalXmlLogFile() void MemcheckTool::loadExternalXmlLogFile()

View File

@@ -66,7 +66,6 @@ ValgrindToolRunner::ValgrindToolRunner(RunControl *runControl)
void ValgrindToolRunner::start() void ValgrindToolRunner::start()
{ {
emit starting();
FutureProgress *fp = ProgressManager::addTimedTask(m_progress, progressTitle(), "valgrind", 100); FutureProgress *fp = ProgressManager::addTimedTask(m_progress, progressTitle(), "valgrind", 100);
fp->setKeepOnFinish(FutureProgress::HideOnFinish); fp->setKeepOnFinish(FutureProgress::HideOnFinish);
connect(fp, &FutureProgress::canceled, connect(fp, &FutureProgress::canceled,

View File

@@ -49,9 +49,6 @@ public:
QString executable() const; QString executable() const;
signals:
void starting();
protected: protected:
virtual QString progressTitle() const = 0; virtual QString progressTitle() const = 0;
virtual QStringList toolArguments() const = 0; virtual QStringList toolArguments() const = 0;