MultimediaProject: splitted constructor for loading either file or data

The old constructor treated the string argument either as filename or
as raw XML data, depending on 2nd parameter. This is a mess and quickly
leads to confusion.

Now we have two constructors taking either a filename as string or a
QByteArray with XML data. Loading actual data has been separated into
MultimediaProject::loadData( const QByteArray & ).

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 5a00ebd360)
This commit is contained in:
Tobias Doerffel
2009-06-05 00:55:25 +02:00
parent 3d9dc25f0b
commit 57c4a5abc5
7 changed files with 82 additions and 108 deletions

View File

@@ -1,7 +1,7 @@
/*
* audio_file_processor.cpp - instrument for using audio-files
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -424,7 +424,7 @@ void audioFileProcessorView::dropEvent( QDropEvent * _de )
}
else if( type == QString( "tco_%1" ).arg( track::SampleTrack ) )
{
multimediaProject mmp( value, FALSE );
multimediaProject mmp( value.toUtf8() );
castModel<audioFileProcessor>()->setAudioFile( mmp.content().
firstChild().toElement().attribute( "src" ) );
_de->accept();