TilesetDock: Fallback to filename when tileset name is empty by SIDDHAARTHAA · Pull Request #4360 · mapeditor/tiled (original) (raw)

Yeah I don't think a comment is necessary because the name and implementation of the function already explain quite well what it is doing. I've just changed the code to rely on displayName since it seems to serve our purposes better (it's also what is used to set the tab text for the open documents).

There is one remaining issue, where the tab text fails to update for embedded tilesets where the file name of the map the tileset is embedded in changes. But since we're dealing with a rather rare case here anyway, I don't think it's worth the complexity to handle that case. With embedded tilesets, the name will also refresh anyway when switching between maps.

So I think this can be merged, thanks @SIDDHAARTHAA!