Commit da4ab870 authored by Daniel Teske's avatar Daniel Teske

Vcs: Simplify code by using Utils::equal

Change-Id: I8c58010e85c7e2a4b8a7c01fb81ce6b528f77b7d
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent dd7eff03
......@@ -225,9 +225,7 @@ QList<IVersionControl *> VcsManager::versionControls()
IVersionControl *VcsManager::versionControl(Id id)
{
return Utils::findOrDefault(versionControls(), [id](const Core::IVersionControl *vc) {
return vc->id() == id;
});
return Utils::findOrDefault(versionControls(), Utils::equal(&Core::IVersionControl::id, id));
}
void VcsManager::resetVersionControlForDirectory(const QString &inputDirectory)
......
......@@ -357,7 +357,7 @@ Core::IEditor *DiffEditor::duplicate()
Core::Id id = currentView()->id();
IDiffView *view = Utils::findOr(editor->m_views, editor->m_views.at(0),
[id](IDiffView *v) { return v->id() == id; });
Utils::equal(&IDiffView::id, id));
QTC_ASSERT(view, view = editor->currentView());
editor->setupView(view);
......@@ -607,7 +607,8 @@ IDiffView *DiffEditor::loadSettings()
Core::Id id = Core::Id::fromSetting(s->value(QLatin1String(diffViewKeyC)));
s->endGroup();
IDiffView *view = Utils::findOr(m_views, m_views.at(0), [id](IDiffView *v) { return v->id() == id; });
IDiffView *view = Utils::findOr(m_views, m_views.at(0),
Utils::equal(&IDiffView::id, id));
QTC_CHECK(view);
return view;
......
Markdown is supported
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