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.
This commit is contained in:
1 parent
8286c1031d
commit
32dbda5b33
1 file changed
+2
-8
@@ -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