Yes, but the problem is that you CAN'T do this just by comparing strings. In many cases, to be sure, you could tell that the file is loaded by comparing strings. But you can't be sure it isn't loaded just by comparing strings. Maybe it's loaded, but under a different pathname.
I'd think that this could be circumvented pretty easily. When the InsetInclude needs to load the file with the "user specified file name" FileName::user_defined, it resolves the "normalized" name, caches it as FileName::normalized and loads the file. Now the file is in the BufferList under the normalized name (and we could make sure that the normalized name is just everywhere internally). loadIfNeeded would then only have to check whether the FileName::normalized is in the BufferList (when it is not empty of course). This can be a simple string comparison.
I pretty much think (and Georg sort of agreed) that this was the design behind the FileName class, but things got messed up when using qt-stuff as the real backbone.
Vincent
