Add support for upgrading presets

This is in addition to songs.  Simply use multimediaProject.  Don't
screw around with Song().  Also, needed to move creation of xml
preamble (processing instruction) due to duplicate entry when
doing a load/save.

Conflicts:
	src/core/main.cpp
This commit is contained in:
Paul Giblock
2012-05-28 00:57:18 -04:00
parent b2dc6375b9
commit 8bbbdacfcb
2 changed files with 28 additions and 29 deletions

View File

@@ -2,6 +2,7 @@
* mmp.cpp - implementation of class multimediaProject
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2012-2013 Paul Giblock <p/at/pgiblock.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -66,6 +67,7 @@ multimediaProject::multimediaProject( ProjectTypes _project_type ) :
m_head(),
m_type( _project_type )
{
appendChild( createProcessingInstruction("xml", "version=\"1.0\""));
QDomElement root = createElement( "multimedia-project" );
root.setAttribute( "version", MMP_VERSION_STRING );
root.setAttribute( "type", typeName( _project_type ) );
@@ -189,7 +191,7 @@ bool multimediaProject::writeFile( const QString & _fn )
).arg( fn ) );
return false;
}
QString xml = "<?xml version=\"1.0\"?>\n" + toString( 2 );
QString xml = toString( 2 );
if( fn.section( '.', -1 ) == "mmpz" )
{
outfile.write( qCompress( xml.toUtf8() ) );