예제 #1
0
bool Toys::Load(EosLog &log, const QString &path, QStringList &lines, int &index)
{
	Clear();

	while(index>=0 && index<lines.size())
	{
		m_Loading = true;
		
		QStringList items;
		Utils::GetItemsFromQuotedString(lines[index], items);

		if(items.size() > 0)
		{
			bool ok = false;
			int n = items[0].toInt(&ok);
			if(ok && n>=0 && n<Toy::TOY_COUNT)
			{
				Toy *toy = AddToy( static_cast<Toy::EnumToyType>(n) );
				if( toy )
					toy->Load(log, path, lines, index);
				else
					index++;
			}
			else
				index++;
		}
		else
			index++;
		
		m_Loading = false;
	}
	
	BuildRecvWidgetsTable();

	return true;
}