void ResourceHandler::addForeignResources( quint8 resourceType, ResourceList& resources ) { ResourceList *foreignList; switch( resourceType ) { case RESOURCE_TYPE_SPRITE: foreignList = &m_foreignSprites; break; case RESOURCE_TYPE_PICTURE: foreignList = &m_foreignPictures; break; } foreignList->append( resources ); }
bool QResourceInfo::loadResource(const QString &path) { ensureInitialized(); const ResourceList *list = resourceList(); for(int i = 0; i < list->size(); ++i) { QResource res = list->at(i); if(res.exists(path)) { if(related.isEmpty()) container = res.isContainer(path); else if(res.isContainer(path) != container) qWarning("Resource [%s] has both data and children!", file.toLatin1().constData()); related.append(res); } } return !related.isEmpty(); }