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:
Tobias Doerffel
2014-08-18 23:19:17 +02:00
parent a09fd51060
commit 327aaee695
2 changed files with 6 additions and 0 deletions

View File

@@ -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" );

View File

@@ -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() );