Removed usage of ASCII C strings in several places
Still QString::toAscii() & friends were used in several places causing
problems such as failed access to files with non-ASCII characters in
name.
Closes #2884115.
(cherry picked from commit 1633cf2593)
This commit is contained in:
@@ -1874,7 +1874,8 @@ extern "C"
|
||||
// neccessary for getting instance out of shared lib
|
||||
Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data )
|
||||
{
|
||||
return new FlpImport( static_cast<const char *>( _data ) );
|
||||
return new FlpImport( QString::fromUtf8(
|
||||
static_cast<const char *>( _data ) ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -563,12 +563,10 @@ extern "C"
|
||||
// neccessary for getting instance out of shared lib
|
||||
Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data )
|
||||
{
|
||||
return new MidiImport( static_cast<const char *>( _data ) );
|
||||
return new MidiImport( QString::fromUtf8(
|
||||
static_cast<const char *>( _data ) ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#undef pos
|
||||
#undef setValue
|
||||
|
||||
@@ -210,7 +210,7 @@ patmanInstrument::LoadErrors patmanInstrument::loadPatch(
|
||||
{
|
||||
unloadCurrentPatch();
|
||||
|
||||
FILE * fd = fopen( _filename.toAscii().constData() , "rb" );
|
||||
FILE * fd = fopen( _filename.toUtf8().constData() , "rb" );
|
||||
if( !fd )
|
||||
{
|
||||
perror( "fopen" );
|
||||
|
||||
@@ -79,10 +79,10 @@ QPixmap getIconPixmap( const char * _name, int _w, int _h )
|
||||
p = QPixmap( 1, 1 );
|
||||
}
|
||||
}
|
||||
return( p );
|
||||
return p;
|
||||
}
|
||||
return( getIconPixmap( _name ).scaled( _w, _h, Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation ) );
|
||||
return getIconPixmap( _name ).
|
||||
scaled( _w, _h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ QPixmap getIconPixmap( const char * _name, int _w, int _h )
|
||||
QString getText( const char * _name )
|
||||
{
|
||||
const embed::descriptor & e = findEmbeddedData( _name );
|
||||
return( QString::fromLatin1( (const char *) e.data, e.size ) );
|
||||
return QString::fromUtf8( (const char *) e.data, e.size );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user