ValveSoftware / vogl

OpenGL capture / playback debugger.
MIT License
1.42k stars 126 forks source link

UI: move some logic to constructors #182

Closed lawlove closed 9 years ago

lawlove commented 9 years ago

Some code cleanup while reading through the code:

In creating the apicall tree, the client (vogleditor_QApiCallTreeModel) creates the calltree objects (vogleditor_apiCallTreeItem objects). If the object is constructed with a parent then the client must then add the new object to the child list of the object's parent after the object has been constructed.

Instead of the client having to know/remember to do this for the object, it's now done in the object's constructor. This makes for easier comprehension/reading of the code in my opinion.

Signed-off-by: Lawrence L Love lawrencex.l.love@intel.com

lawlove commented 9 years ago

I branched this off the current master vogleditor directory which is not yet clang-formatted and forgot to clang-format it before submitting. But also found an additional constructor that should have itself added to its parent. Will clang-format it with the changes, add the constructor modification, and re-submit

lawlove commented 9 years ago

Never mind - it is clang-formatted - don't know what I was comparing it against. The constructor I was looking at was the wrong type so original should be good to go...

PeterLValve commented 9 years ago

Thank you Lawrence!