forked from qt-creator/qt-creator
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:
@@ -54,6 +54,9 @@ public:
|
||||
void prependChild(TreeItem *item);
|
||||
void appendChild(TreeItem *item);
|
||||
void insertChild(int pos, TreeItem *item);
|
||||
void insertOrderedChild(TreeItem *item,
|
||||
const std::function<bool(const TreeItem *, const TreeItem *)> &cmp);
|
||||
|
||||
void removeChildAt(int pos);
|
||||
void removeChildren();
|
||||
void sortChildren(const std::function<bool(const TreeItem *, const TreeItem *)> &cmp);
|
||||
@@ -135,6 +138,14 @@ public:
|
||||
ParentType *parent() const {
|
||||
return static_cast<ParentType *>(TreeItem::parent());
|
||||
}
|
||||
|
||||
void insertOrderedChild(ChildType *item, const std::function<bool(const ChildType *, const ChildType *)> &cmp)
|
||||
{
|
||||
const auto cmp0 = [cmp](const TreeItem *lhs, const TreeItem *rhs) {
|
||||
return cmp(static_cast<const ChildType *>(lhs), static_cast<const ChildType *>(rhs));
|
||||
};
|
||||
TreeItem::insertOrderedChild(item, cmp0);
|
||||
}
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT StaticTreeItem : public TreeItem
|
||||
|
||||
Reference in New Issue
Block a user