xml validation, removed redundant boxing, unknown files fail validation, caught a inverse logic error
This commit is contained in:
@@ -202,7 +202,7 @@ bool DataFile::validate( QString extension )
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -151,15 +151,13 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file,
|
||||
dataFileCreated = true;
|
||||
}
|
||||
|
||||
DataFile data(*dataFile);
|
||||
|
||||
// vestige previews are bug prone; fallback on 3xosc with volume of 0
|
||||
// without an instrument in preview track, it will segfault
|
||||
if(data.content().elementsByTagName( "vestige" ).length() == 0 )
|
||||
if(dataFile->content().elementsByTagName( "vestige" ).length() == 0 )
|
||||
{
|
||||
s_previewTC->previewInstrumentTrack()->
|
||||
loadTrackSpecificSettings(
|
||||
data.content().firstChild().toElement() );
|
||||
dataFile->content().firstChild().toElement() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -942,7 +942,7 @@ void Song::loadProject( const QString & fileName )
|
||||
DataFile dataFile( m_fileName );
|
||||
// if file could not be opened, head-node is null and we create
|
||||
// new project
|
||||
if( !dataFile.validate( _file_name.right(_file_name.lastIndexOf(".") ) ) )
|
||||
if( dataFile.validate( _file_name.right(_file_name.lastIndexOf(".") ) ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -466,7 +466,8 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me )
|
||||
if( !dataFile.validate( f->extension() ) )
|
||||
{
|
||||
QMessageBox::warning( 0, tr ( "Error" ),
|
||||
f->fullName() + " " + tr( "does not appear to be a valid") + " " + f->extension(),
|
||||
f->fullName() + " " + tr( "does not appear to be a valid" ) + " " + f->extension() +
|
||||
" " + tr( "file" ),
|
||||
QMessageBox::Ok, QMessageBox::NoButton );
|
||||
m_pphMutex.unlock();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user