Even more algorithm usage in ProjectExplorer

Add Utils::transform and anyOf that take a member function pointer.
Remove bestElementOr it's unused.

Use declval<T> in transform's return type, because msvc does evaluate
T() and for types that don't have simple constructor this fails.
Add std::remove_reference since decltype returns a reference for
lvalues.

Change-Id: I22248b226748eeb27af0d300182d574438d7f756
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Daniel Teske
2014-07-07 19:02:26 +02:00
parent 71b56d2b9c
commit eccf1dc1e3
29 changed files with 219 additions and 247 deletions

View File

@@ -864,12 +864,8 @@ void MiniProjectTargetSelector::doLayout(bool keepSize)
onlySummary = true;
} else {
if (visibleLineCount < 3) {
foreach (Project *p, SessionManager::projects()) {
if (p->needsConfiguration()) {
visibleLineCount = 3;
break;
}
}
if (Utils::anyOf(SessionManager::projects(), &Project::needsConfiguration))
visibleLineCount = 3;
}
if (visibleLineCount)
summaryLabelHeight = visibleLineCount * QFontMetrics(m_summaryLabel->font()).height()