Add foreach support for TreeItem

Also, removed a few examples from the build list to save some pipeline time
This commit is contained in:
Grim Maple 2022-11-05 21:27:30 +03:00
parent 9a3b140fb1
commit 14065d7621
3 changed files with 6 additions and 13 deletions

View File

@ -38,21 +38,9 @@ jobs:
# In this mode, `mainSourceFile` is excluded and `version (unittest)` are included
# See https://dub.pm/package-format-json.html#configurations
dub test
cd examples/bezier
dub build -b=release
cd ../dminer
dub build -b=release
cd ../dmledit
dub build -b=release
cd ../dragon
dub build -b=release
cd ../example1
cd examples/example1
dub build -b=release
cd ../helloworld
dub build -b=release
cd ../ircclient
dub build -b=release
cd ../opengl
dub build -b=release
cd ../tetris
dub build -b=release

1
.gitignore vendored
View File

@ -27,3 +27,4 @@ lib/res
*.lst
*.a
dlangui-test-default
.vscode

View File

@ -268,6 +268,10 @@ class TreeItem {
return this;
}
/// Support foreach
int opApply(int delegate(ref TreeItem) callback) {
return _children.opApply(callback);
}
/// returns true if item has at least one child
@property bool hasChildren() { return childCount > 0; }