Tablature shown as treble staff in "Instruments" when Clef is hidden

• Jan 24, 2016 - 14:45
S4 - Minor

Nightly d08e14c (4 Jan 2016) on Win 7 HP / MS 2.0.2 on Win 10.

1. Create a new linked Guitar staff/TAB score.
2. Right click on tab staff, select "staff properties," then untick "show clef," and click "OK."
3. Open the Instruments window ("I").

Expected result: The words "Tablature" and "Tab 6 str. simple" should be visible.
Actual result: The line wrongly shows "Treble clef 8vb" and "Standard."


My findings are as follows :
The bug lies here….
The comparison done in the two loops in the following function…
fails because of inclusion of genClef comparison in the isSameStructure function.
If we remove that comparision from the isSameStructure itself, it will lead to some other breakdowns possibly ( wherever the staffTypes are compared using '==' , as this operator itself calls isSameStructure ).
So, a hack would be to modify the genClef values of both staves to be true in the instrwidget.cpp#171 StaffListItem::setStaffType before doing the comparison and restoring them on exit.
But this is clearly not an elegant approach to follow.
I would like to have the opinion of other developers on how to fix this.