Add missing "emit"s

Change-Id: I88a7397c7689b1e72cdd0e52077f8097443963c0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2021-11-01 16:09:36 +01:00
parent 24ebe5a0ec
commit d7ed48ac6f
17 changed files with 32 additions and 30 deletions

View File

@@ -208,7 +208,8 @@ Archive *Archive::unarchive(const FilePath &src, const FilePath &dest)
[archive]() {
if (!archive->m_process)
return;
archive->outputReceived(QString::fromUtf8(archive->m_process->readAllStandardOutput()));
emit archive->outputReceived(QString::fromUtf8(
archive->m_process->readAllStandardOutput()));
},
Qt::QueuedConnection);
QObject::connect(
@@ -218,7 +219,7 @@ Archive *Archive::unarchive(const FilePath &src, const FilePath &dest)
[archive] {
if (!archive->m_process)
return;
archive->finished(archive->m_process->result() == QtcProcess::FinishedWithSuccess);
emit archive->finished(archive->m_process->result() == QtcProcess::FinishedWithSuccess);
archive->m_process->deleteLater();
archive->m_process = nullptr;
archive->deleteLater();
@@ -231,8 +232,8 @@ Archive *Archive::unarchive(const FilePath &src, const FilePath &dest)
[archive](QProcess::ProcessError) {
if (!archive->m_process)
return;
archive->outputReceived(tr("Command failed."));
archive->finished(false);
emit archive->outputReceived(tr("Command failed."));
emit archive->finished(false);
archive->m_process->deleteLater();
archive->m_process = nullptr;
archive->deleteLater();
@@ -240,7 +241,7 @@ Archive *Archive::unarchive(const FilePath &src, const FilePath &dest)
Qt::QueuedConnection);
QTimer::singleShot(0, archive, [archive, tool, workingDirectory] {
archive->outputReceived(
emit archive->outputReceived(
tr("Running %1\nin \"%2\".\n\n", "Running <cmd> in <workingdirectory>")
.arg(tool->command.toUserOutput(), workingDirectory.toUserOutput()));
});

View File

@@ -671,7 +671,7 @@ void ClangTool::startTool(ClangTool::FileSelection fileSelection,
m_runControl->setTarget(project->activeTarget());
m_stopAction->disconnect();
connect(m_stopAction, &QAction::triggered, m_runControl, [this] {
m_runControl->appendMessage(tr("Clang-Tidy and Clazy tool stopped by user."),
emit m_runControl->appendMessage(tr("Clang-Tidy and Clazy tool stopped by user."),
NormalMessageFormat);
m_runControl->initiateStop();
setState(State::StoppedByUser);

View File

@@ -134,7 +134,8 @@ void GridProxyModel::setSourceModel(QAbstractItemModel *newModel)
[this] (const QModelIndex &topLeft,
const QModelIndex &bottomRight,
const QVector<int> &roles) {
QAbstractItemModel::dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
emit QAbstractItemModel::dataChanged(mapFromSource(topLeft),
mapFromSource(bottomRight), roles);
});
}
}

View File

@@ -744,7 +744,7 @@ HelpViewer *HelpWidget::insertViewer(int index, const QUrl &url)
connect(viewer, &HelpViewer::titleChanged, &m_model, [this, viewer] {
const int i = indexOf(viewer);
QTC_ASSERT(i >= 0, return );
m_model.dataChanged(m_model.index(i, 0), m_model.index(i, 0));
emit m_model.dataChanged(m_model.index(i, 0), m_model.index(i, 0));
});
connect(viewer, &HelpViewer::loadFinished, this, &HelpWidget::highlightSearchTerms);

View File

@@ -92,7 +92,7 @@ void MesonRunConfiguration::updateTargetInformation()
aspect<ProjectExplorer::ExecutableAspect>()->setExecutable(bti.targetFilePath);
aspect<ProjectExplorer::WorkingDirectoryAspect>()->setDefaultWorkingDirectory(
bti.workingDirectory);
aspect<ProjectExplorer::LocalEnvironmentAspect>()->environmentChanged();
emit aspect<ProjectExplorer::LocalEnvironmentAspect>()->environmentChanged();
}
MesonRunConfigurationFactory::MesonRunConfigurationFactory()

View File

@@ -140,7 +140,7 @@ bool NimProjectScanner::addFiles(const QStringList &filePaths)
return !filePaths.contains(f);
}));
requestReparse();
emit requestReparse();
return true;
}
@@ -149,7 +149,7 @@ RemovedFilesFromProject NimProjectScanner::removeFiles(const QStringList &filePa
{
setExcludedFiles(Utils::filteredUnique(excludedFiles() + filePaths));
requestReparse();
emit requestReparse();
return RemovedFilesFromProject::Ok;
}
@@ -160,7 +160,7 @@ bool NimProjectScanner::renameFile(const QString &, const QString &to)
files.removeOne(to);
setExcludedFiles(files);
requestReparse();
emit requestReparse();
return true;
}

View File

@@ -337,7 +337,7 @@ void BuildSystem::setRootProjectNode(std::unique_ptr<ProjectNode> &&root)
void BuildSystem::emitBuildSystemUpdated()
{
target()->buildSystemUpdated(this);
emit target()->buildSystemUpdated(this);
}
void BuildSystem::setExtraData(const QString &buildKey, Utils::Id dataKey, const QVariant &data)

View File

@@ -120,7 +120,7 @@ void DesktopRunConfiguration::updateTargetInformation()
else
setDefaultDisplayName(profile.completeBaseName());
aspect<EnvironmentAspect>()->environmentChanged();
emit aspect<EnvironmentAspect>()->environmentChanged();
auto wda = aspect<WorkingDirectoryAspect>();
wda->setDefaultWorkingDirectory(bti.workingDirectory);
@@ -144,7 +144,7 @@ void DesktopRunConfiguration::updateTargetInformation()
aspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.workingDirectory);
aspect<LocalEnvironmentAspect>()->environmentChanged();
emit aspect<LocalEnvironmentAspect>()->environmentChanged();
}
}

View File

@@ -962,7 +962,7 @@ void CheckBoxField::setChecked(bool value)
QTC_ASSERT(w, return);
w->setChecked(value);
w->clicked(value);
emit w->clicked(value);
}
bool CheckBoxField::validate(MacroExpander *expander, QString *message)

View File

@@ -851,7 +851,7 @@ void RunControlPrivate::onWorkerStopped(RunWorker *worker)
void RunControlPrivate::showError(const QString &msg)
{
if (!msg.isEmpty())
q->appendMessage(msg + '\n', ErrorMessageFormat);
emit q->appendMessage(msg + '\n', ErrorMessageFormat);
}
void RunControl::setupFormatter(OutputFormatter *formatter) const
@@ -1480,9 +1480,9 @@ void RunWorker::reportFailure(const QString &msg)
void RunWorker::appendMessage(const QString &msg, OutputFormat format, bool appendNewLine)
{
if (!appendNewLine || msg.endsWith('\n'))
d->runControl->appendMessage(msg, format);
emit d->runControl->appendMessage(msg, format);
else
d->runControl->appendMessage(msg + '\n', format);
emit d->runControl->appendMessage(msg + '\n', format);
}
IDevice::ConstPtr RunWorker::device() const

View File

@@ -139,7 +139,7 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
connect(DeviceManager::instance(), &DeviceManager::updated, this, &Target::updateDeviceState);
connect(this, &Target::parsingStarted, this, [this, project] {
project->anyParsingStarted(this);
emit project->anyParsingStarted(this);
});
connect(this, &Target::parsingFinished, this, [this, project](bool success) {
@@ -147,7 +147,7 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
updateDefaultRunConfigurations();
// For testing.
emit SessionManager::instance()->projectFinishedParsing(project);
project->anyParsingFinished(this, success);
emit project->anyParsingFinished(this, success);
}, Qt::QueuedConnection); // Must wait for run configs to change their enabled state.
KitManager *km = KitManager::instance();

View File

@@ -532,7 +532,7 @@ QWidget *QMakeStep::createConfigWidget()
qmakeBuildConfigChanged();
updateSummary();
emit updateSummary();
updateAbiWidgets();
updateEffectiveQMakeCall();

View File

@@ -460,7 +460,7 @@ void AssetExporter::State::change(const ParsingState &state)
qCDebug(loggerInfo()) << "Assetimporter State change: Old: " << m_state << "New: " << state;
if (m_state != state) {
m_state = state;
m_assetExporter.stateChanged(m_state);
emit m_assetExporter.stateChanged(m_state);
}
}

View File

@@ -178,7 +178,7 @@ QToolBar *CurveEditor::createToolBar(CurveEditorModel *model)
cfspin->setMaximum(std::numeric_limits<int>::max());
auto intSignal = static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged);
connect(cfspin, intSignal, [model](int val) { model->commitCurrentFrame(val); });
connect(cfspin, intSignal, [model](int val) { emit model->commitCurrentFrame(val); });
connect(m_view, &GraphicsView::currentFrameChanged, [cfspin](int val, bool notify) {
if (notify) {
cfspin->setValue(val);

View File

@@ -288,7 +288,7 @@ void GraphicsView::setCurrentFrame(int frame, bool notify)
m_playhead.moveToFrame(clampedFrame, this);
viewport()->update();
currentFrameChanged(clampedFrame, notify);
emit currentFrameChanged(clampedFrame, notify);
}
void GraphicsView::scrollContent(double x, double y)

View File

@@ -136,7 +136,7 @@ void TimelineMoveTool::mouseMoveEvent(TimelineMovableAbstractItem *item,
targetFrame = snappedTargetFrame;
}
scene()->statusBarMessageChanged(tr(TimelineConstants::statusBarKeyframe)
emit scene()->statusBarMessageChanged(tr(TimelineConstants::statusBarKeyframe)
.arg(targetFrame));
const QList<TimelineKeyframeItem *> selectedKeyframes = scene()->selectedKeyframes();
@@ -170,7 +170,7 @@ void TimelineMoveTool::mouseReleaseEvent(TimelineMovableAbstractItem *item,
if (limitFrame > -999999.) {
scene()->setCurrentFrame(limitFrame);
scene()->statusBarMessageChanged(
emit scene()->statusBarMessageChanged(
tr(TimelineConstants::statusBarPlayheadFrame).arg(limitFrame));
return;
}

View File

@@ -959,7 +959,7 @@ void TimelineBarItem::itemMoved(const QPointF &start, const QPointF &end)
else
dragHandle(rect(), end, min, max);
abstractScrollGraphicsScene()->statusBarMessageChanged(
emit abstractScrollGraphicsScene()->statusBarMessageChanged(
tr("Range from %1 to %2")
.arg(qRound(mapFromSceneToFrame(rect().x())))
.arg(qRound(mapFromSceneToFrame(rect().width() + rect().x()))));