I vote yes to put it in except that the trunk is broken now so I can not test your patch.
A few questions: 1. You mentioned file format change but no lyx2lyx stuff in your patch. 2. Should caption be removed from the listings dialog? Or should the caption inset automatically reflects the changes there? 3. I think that this caption stuff is more important in the insert->child document dialog, because listings inset tends to replace small code pieces (maybe originally in lyx-code environment) without caption, and \lstinputlisting tends to have a big trunk of code that needs a caption. We still get a chance to revoke all child document stuff and use the listings inset to handle \lstinputlisting. The advantage is that 1. all three kinds of listings (inline, normal, file) are handled at the same place. This is conceptually cleaner. 2. we do not need to call the listings dialog from the include child document dialog. 3. Frankly, insert a file using that dialog is cumbersome. (insert->child document, browse, choose type, no way to enter caption...). What do you think? Cheers, Bo