DarkRadiant: master 72ec80fa

Author Committer Branch Timestamp Parent
orbweaver orbweaver master 13.12.2022 21:12 master 465e0c54
Affected Issues  0006187: Prefab Selector spams infinite error dialogs on Linux
Changeset 0006187: fix "Wrong type" error dialogs in Prefab Chooser on Linux

The GTK treeview cell renderers do not support tree model cells
returning no data (or data of the wrong type), and show this "Wrong
type" dialog as a consequence. This was a problem in the Prefab Chooser
because certain rows do not contain the full range of data (e.g. the
root node and folder nodes do not have a "size" value).

(Note that there was never any problem with entire columns not being
displayed, or with hidden columns missing data. But if a column is
displayed and has a cell renderer attached, that cell renderer expects
to receive valid data for every row).

The implementation of TreeModel::GetValue() is now updated to return a
default wxVariant in the case of model nodes which do not contain an
explicit value for the requested column. For string and numeric column
types (which are all rendered as string data), this is just an empty
wxString(), so there is no visible change in the GUI.
mod - libs/wxutil/dataview/TreeModel.cpp Diff File