diff options
author | Daniel Teske <daniel.teske@digia.com> | 2014-07-10 12:57:06 +0200 |
---|---|---|
committer | Daniel Teske <daniel.teske@digia.com> | 2014-07-16 18:21:03 +0200 |
commit | 16ac3928a000517aa2d2880a9ef899526fe6bac4 (patch) | |
tree | 0eebbc19072eed0ef5d7187100c42848e4fd4ec4 /src/plugins/qtsupport/qtoptionspage.cpp | |
parent | eccf1dc1e397303e218eaaf48977fd612cbd3d6a (diff) | |
download | qt-creator-16ac3928a000517aa2d2880a9ef899526fe6bac4.tar.gz |
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 <nib952051@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/qtsupport/qtoptionspage.cpp')
-rw-r--r-- | src/plugins/qtsupport/qtoptionspage.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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"), |