Move pre-1.1 mixer check to DataFile::upgrade() (#2924)

This commit is contained in:
grejppi
2016-07-20 23:19:08 +03:00
committed by GitHub
parent c9c8ac26b1
commit ddc2591611
3 changed files with 19 additions and 11 deletions

View File

@@ -794,6 +794,20 @@ void DataFile::upgrade_0_4_0_rc2()
}
void DataFile::upgrade_1_1_0()
{
QDomNodeList list = elementsByTagName("fxchannel");
for (int i = 1; !list.item(i).isNull(); ++i)
{
QDomElement el = list.item(i).toElement();
QDomElement send = createElement("send");
send.setAttribute("channel", "0");
send.setAttribute("amount", "1");
el.appendChild(send);
}
}
void DataFile::upgrade_1_1_91()
{
// Upgrade to version 1.1.91 from some version less than 1.1.91
@@ -881,6 +895,10 @@ void DataFile::upgrade()
{
upgrade_0_4_0_rc2();
}
if( version < ProjectVersion("1.1.0", CompareType::Release) )
{
upgrade_1_1_0();
}
if( version < ProjectVersion("1.1.91", CompareType::Release) )
{
upgrade_1_1_91();