* use QTextStream to save uncompressed XML-files

* when encountering problems while parsing XML-file, print line and column of problem



git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1387 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-07-28 06:45:16 +00:00
parent dc14b0c869
commit f5b849fd30
2 changed files with 11 additions and 2 deletions

View File

@@ -125,6 +125,8 @@ multimediaProject::multimediaProject( const QString & _in_file_name,
}
if( error )
{
printf( "at line %d column %d: %s\n", line, col,
error_msg.toAscii().constData() );
QMessageBox::critical( NULL, songEditor::tr( "Error in "
"multimedia-project" ),
songEditor::tr( "The multimedia-"
@@ -236,14 +238,14 @@ bool multimediaProject::writeFile( const QString & _fn )
).arg( fn ) );
return( FALSE );
}
QString xml = "<?xml version=\"1.0\"?>\n" + toString( 1 );
QString xml = "<?xml version=\"1.0\"?>\n" + toString( 2 );
if( fn.section( '.', -1 ) == "mmpz" )
{
outfile.write( qCompress( xml.toAscii() ) );
}
else
{
outfile.write( xml.toUtf8().constData(), xml.length() );
QTextStream( &outfile ) << xml;
}
outfile.close();