summaryrefslogtreecommitdiff
path: root/src/plugins/qtsupport/qtoptionspage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qtsupport/qtoptionspage.cpp')
-rw-r--r--src/plugins/qtsupport/qtoptionspage.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp
index 6e1da5f4a5..7397f56f87 100644
--- a/src/plugins/qtsupport/qtoptionspage.cpp
+++ b/src/plugins/qtsupport/qtoptionspage.cpp
@@ -45,6 +45,7 @@
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
#include <utils/runextensions.h>
+#include <utils/algorithm.h>
#include <QDir>
#include <QMessageBox>
@@ -609,13 +610,11 @@ void QtOptionsPageWidget::addQtDir()
if (BuildableHelperLibrary::isQtChooser(fi))
qtVersion = FileName::fromString(BuildableHelperLibrary::qtChooserToQmakePath(fi.symLinkTarget()));
- BaseQtVersion *version = 0;
- foreach (BaseQtVersion *v, m_versions) {
- if (v->qmakeCommand() == qtVersion) {
- version = v;
- break;
- }
- }
+ BaseQtVersion *version = Utils::findOr(m_versions,
+ 0,
+ [&qtVersion](BaseQtVersion *v) {
+ return v->qmakeCommand() == qtVersion;
+ });
if (version) {
// Already exist
QMessageBox::warning(this, tr("Qt Version Already Known"),