ProjectExplorer: Order projects in session alphabetically again

Task-number: QTCREATORBUG-18337
Change-Id: I716369a1012f93c6c676e89c3b32cd1a406996a5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2017-08-16 16:44:22 +02:00
parent b0bba662f8
commit 06569e5f3a
3 changed files with 30 additions and 11 deletions

View File

@@ -689,6 +689,13 @@ void TreeItem::insertChild(int pos, TreeItem *item)
}
}
void TreeItem::insertOrderedChild(TreeItem *item,
const std::function<bool (const TreeItem *, const TreeItem *)> &cmp)
{
auto where = std::lower_bound(begin(), end(), item, cmp);
insertChild(int(where - begin()), item);
}
void TreeItem::removeChildAt(int pos)
{
QTC_ASSERT(0 <= pos && pos < m_children.count(), return);