ZynAddSubFX/QtXmlWrapper: fixed loading of oddly formatted presets
Some ZynAddSubFX presets have one or more leading blank lines which
confuses the QtXml module. Therefore dynamically remove characters from
the beginning of the data until we encounter a '<' character.
Closes #3047560.
(cherry picked from commit 32dbda5b33)
This commit is contained in:
@@ -279,16 +279,10 @@ int QtXmlWrapper::loadXMLfile(const std::string &filename)
|
||||
}
|
||||
|
||||
QByteArray b( xmldata );
|
||||
if( b[0] != '<' )
|
||||
while( !b.isEmpty() && b[0] != '<' )
|
||||
{
|
||||
// remove first blank line
|
||||
b.remove( 0,
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
2
|
||||
#else
|
||||
1
|
||||
#endif
|
||||
);
|
||||
b.remove( 0, 1 );
|
||||
}
|
||||
|
||||
if( !d->m_doc.setContent( b ) )
|
||||
|
||||
Reference in New Issue
Block a user