cinder / TinderBox

TinderBox
14 stars 6 forks source link

Block searching #12

Closed sansumbrella closed 6 years ago

sansumbrella commented 8 years ago

Search for cinder blocks in directory adjacent to Cinder version as well as the blocks directory.

Makes using Cinder and blocks as submodules of a larger project more convenient.

QtCreator cleaned up some trailing whitespace.

Almost solves issue #1. Punts on adding gui elements while supporting what (for me) is a very handy use-case.

richardeakin commented 8 years ago

Nice stopgap solution. So it searches the following folders for blocks?

cinder/blocks/*
blocks/*

This is actually the file structure of the project I'm working on at the moment as well.

Does it handle the case when there is a cinderblock with the same folder name in both directories?

sansumbrella commented 8 years ago

All it does is search an additional directory. I haven't checked the code to see whether/how the cinder block manager handles duplicate cinder block xml files.

It searches

./cinder/blocks/*
./*

Would make sense to look just in directories named blocks, since that would avoid dipping back into the cinder directory.

richardeakin commented 8 years ago

How difficult would it be to detect if there are two cinderblocks with the same name, and if so give it a an id that contains the unique part of the subpath? It seems like this is what smarter IDEs such as the Jetbrains ones do.

Would make sense to look just in directories named blocks, since that would avoid dipping back into the cinder directory.

Seems like it would be nice to not have to name the folder blocks for it to be searched in the long run. The search doesn't recurse into directories, does it? If it did you could keep the paths in a std::set which would guarantee uniqueness, but not sure that it matters if you're only searching the top level of each directory.