DataFile: write new header information only for song projects

No need to write these for presets etc.
This commit is contained in:
Tobias Doerffel
2014-08-18 22:02:16 +02:00
parent d037b9d2ed
commit 86f3854782

View File

@@ -689,16 +689,19 @@ void DataFile::upgrade()
documentElement().setAttribute( "creator", "LMMS" );
documentElement().setAttribute( "creatorversion", LMMS_VERSION );
// Time-signature
if ( !m_head.hasAttribute( "timesig_numerator" ) )
if( type() == SongProject || type() == SongProjectTemplate )
{
m_head.setAttribute( "timesig_numerator", 4 );
m_head.setAttribute( "timesig_denominator", 4 );
}
// Time-signature
if ( !m_head.hasAttribute( "timesig_numerator" ) )
{
m_head.setAttribute( "timesig_numerator", 4 );
m_head.setAttribute( "timesig_denominator", 4 );
}
if( !m_head.hasAttribute( "mastervol" ) )
{
m_head.setAttribute( "mastervol", 100 );
if( !m_head.hasAttribute( "mastervol" ) )
{
m_head.setAttribute( "mastervol", 100 );
}
}
//printf("%s\n", toString( 2 ).toUtf8().constData());
}