p_error=i18n("%1 is not a valid tag inside tag %2. Valid tags are %3, %4, %5, %6 and %7").arg(name).arg(prev).arg("color").arg("name").arg("ignore").arg("capital").arg("flag");
if(!b)p_error=i18n("File %1 does not exist").arg(p_path+p_contents);
}
elseif(aux=="division")
{
p_division->setRGB(p_red,p_green,p_blue);
b=p_divisionNameSet;
if(!b)p_error=i18n("There is a division without name");
b=b&&p_map->addDivision(p_division);
if(!b)p_error=i18n("There is already either a division called %1 or a division with the same colors as %2").arg(p_division->getName()).arg(p_division->getName());
b=b&&(p_capitalSet||!p_division->canAsk(false));
if(!b)p_error=i18n("Division %1 has no capital").arg(p_division->getName());
}
elseif(p_previousTags==":map:division:name")
{
p_divisionNameSet=true;
p_division->setName(p_contents);
}
elseif(p_previousTags==":map:division:capital")
{
p_capitalSet=true;
p_division->setCapital(p_contents);
}
elseif(aux=="color")
{
if(p_red==-1)
{
b=false;
p_error=i18n("Tag %1 has not the %2 tag.").arg("<color>").arg("<red>");
}
elseif(p_green==-1)
{
b=false;
p_error=i18n("Tag %1 has not the %2 tag.").arg("<color>").arg("<green>");
}
elseif(p_blue==-1)
{
b=false;
p_error=i18n("Tag %1 has not the %2 tag.").arg("<color>").arg("<blue>");
}
elsep_colorSet=true;
}
elseif(aux=="red")
{
p_red=p_contents.toInt();
}
elseif(aux=="green")
{
p_green=p_contents.toInt();
}
elseif(aux=="blue")
{
p_blue=p_contents.toInt();
}
elseif(aux=="ignore")
{
p_divisionIgnoreSet=true;
if(p_contents.lower()=="yes")
{
p_division->setIgnore(true,false);
}
elseif(p_contents.lower()=="no")
{
p_division->setIgnore(false,false);
}
elseif(p_contents.lower()=="allowclickmode")
{
p_division->setIgnore(true,true);
}
else
{
b=false;
p_error=i18n("Invalid value in tag %1").arg("<ignore>");