all repos — mgba @ 89a4b427a1bd6703c1f5791778ff67e9c6e63127

mGBA Game Boy Advance Emulator

Qt: Fix library view redrawing way too much
Vicki Pfau vi@endrift.com
Sat, 03 Jun 2017 17:46:25 -0700
commit

89a4b427a1bd6703c1f5791778ff67e9c6e63127

parent

0a898f66b4c3cf63e32bc90d73dae33fee41a29a

1 files changed, 3 insertions(+), 6 deletions(-)

jump to
M src/platform/qt/library/LibraryTree.cppsrc/platform/qt/library/LibraryTree.cpp

@@ -147,15 +147,12 @@

LibraryEntryRef currentGame = selectedEntry(); int count = m_widget->topLevelItemCount(); - for (int a = 0; a < count; a++) { - m_widget->takeTopLevelItem(0); + for (int a = count - 1; a >= 0; --a) { + m_widget->takeTopLevelItem(a); } for (QTreeWidgetItem* i : m_pathNodes.values()) { - count = i->childCount(); - for (int a = 0; a < count; a++) { - i->takeChild(0); - } + i->takeChildren(); } if (m_currentStyle == LibraryStyle::STYLE_TREE) {