From 16ac3928a000517aa2d2880a9ef899526fe6bac4 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Thu, 10 Jul 2014 12:57:06 +0200 Subject: Algorithms: Introduce helper Utils::equal Takes a member (function) pointer and a value and returns a functor, that takes a instance of the mfp's class and returns whether it's equal to value. Sounds complicated, but is a common pattern that is easy to understand. Change-Id: Iaaeb90488d34ddfd6940dadd4c66705381198fee Reviewed-by: Nikita Baryshnikov Reviewed-by: Tobias Hunger --- src/plugins/qtsupport/qtoptionspage.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/plugins/qtsupport/qtoptionspage.cpp') diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 8a4f514eb5..d891c82b60 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -609,11 +609,8 @@ void QtOptionsPageWidget::addQtDir() if (BuildableHelperLibrary::isQtChooser(fi)) qtVersion = FileName::fromString(BuildableHelperLibrary::qtChooserToQmakePath(fi.symLinkTarget())); - BaseQtVersion *version = Utils::findOr(m_versions, - 0, - [&qtVersion](BaseQtVersion *v) { - return v->qmakeCommand() == qtVersion; - }); + BaseQtVersion *version = Utils::findOrDefault(m_versions, + Utils::equal(&BaseQtVersion::qmakeCommand, qtVersion)); if (version) { // Already exist QMessageBox::warning(this, tr("Qt Version Already Known"), -- cgit v1.2.1