Song, InstrumentTrack: use DataFile::LocaleHelper
Always save projects and presets with default C locale in order to avoid problems in the future. At the same time properly load floating point strings which have been saved with different locale settings. Closes #1051.
This commit is contained in:
@@ -896,6 +896,8 @@ void song::loadProject( const QString & _file_name )
|
||||
return;
|
||||
}
|
||||
|
||||
DataFile::LocaleHelper localeHelper( DataFile::LocaleHelper::ModeLoad );
|
||||
|
||||
engine::mixer()->lock();
|
||||
|
||||
// get the header information from the DOM
|
||||
@@ -1004,6 +1006,8 @@ void song::loadProject( const QString & _file_name )
|
||||
// only save current song as _filename and do nothing else
|
||||
bool song::saveProjectFile( const QString & _filename )
|
||||
{
|
||||
DataFile::LocaleHelper localeHelper( DataFile::LocaleHelper::ModeSave );
|
||||
|
||||
DataFile dataFile( DataFile::SongProject );
|
||||
|
||||
m_tempoModel.saveSettings( dataFile, dataFile.head(), "bpm" );
|
||||
|
||||
@@ -1369,6 +1369,8 @@ void InstrumentTrackWindow::saveSettingsBtnClicked()
|
||||
!sfd.selectedFiles().isEmpty() &&
|
||||
!sfd.selectedFiles().first().isEmpty() )
|
||||
{
|
||||
DataFile::LocaleHelper localeHelper( DataFile::LocaleHelper::ModeSave );
|
||||
|
||||
DataFile dataFile( DataFile::InstrumentTrackSettings );
|
||||
m_track->setSimpleSerializing();
|
||||
m_track->saveSettings( dataFile, dataFile.content() );
|
||||
|
||||
Reference in New Issue
Block a user