Load preset palettes faster

Load all queued resources on each onTick() instead of one per tick.
This commit is contained in:
David Capello 2017-05-30 14:58:49 -03:00
parent f1454da7c2
commit 399314b407

View File

@ -177,22 +177,20 @@ void ResourcesListBox::onTick()
base::UniquePtr<Resource> resource;
std::string name;
if (!m_resourcesLoader->next(resource)) {
if (m_resourcesLoader->isDone()) {
stop();
}
return;
while (m_resourcesLoader->next(resource)) {
base::UniquePtr<ResourceListItem> listItem(onCreateResourceItem(resource));
insertChild(getItemsCount()-1, listItem);
layout();
if (View* view = View::getView(this))
view->updateView();
resource.release();
listItem.release();
}
base::UniquePtr<ResourceListItem> listItem(onCreateResourceItem(resource));
insertChild(getItemsCount()-1, listItem);
layout();
if (View* view = View::getView(this))
view->updateView();
resource.release();
listItem.release();
if (m_resourcesLoader->isDone())
stop();
}
void ResourcesListBox::stop()