removed overwrite-check as in Qt4 QFileDialog does this on its own
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@754 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -59,7 +59,7 @@ public:
|
||||
|
||||
QString nameWithExtension( const QString & _fn ) const;
|
||||
|
||||
bool writeFile( QString & _fn, bool _overwrite_check = TRUE );
|
||||
bool writeFile( const QString & _fn );
|
||||
|
||||
inline QDomElement & content( void )
|
||||
{
|
||||
|
||||
@@ -891,8 +891,7 @@ bool song::saveProject( void )
|
||||
m_playPos[Mode_PlaySong].m_timeLine->saveState( mmp, mmp.content() );
|
||||
|
||||
m_fileName = mmp.nameWithExtension( m_fileName );
|
||||
if( mmp.writeFile( m_fileName, m_oldFileName == "" ||
|
||||
m_fileName != m_oldFileName ) == TRUE )
|
||||
if( mmp.writeFile( m_fileName ) == TRUE )
|
||||
{
|
||||
textFloat::displayMessage( tr( "Project saved" ),
|
||||
tr( "The project %1 is now saved."
|
||||
|
||||
@@ -226,7 +226,7 @@ QString multimediaProject::nameWithExtension( const QString & _fn ) const
|
||||
|
||||
|
||||
|
||||
bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check )
|
||||
bool multimediaProject::writeFile( const QString & _fn )
|
||||
{
|
||||
if( type() == SongProject || type() == SongProjectTemplate
|
||||
|| type() == InstrumentTrackSettings )
|
||||
@@ -237,21 +237,6 @@ bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check )
|
||||
|
||||
QString fn = nameWithExtension( _fn );
|
||||
QFile outfile( fn );
|
||||
if( _overwrite_check == TRUE &&
|
||||
outfile.exists() == TRUE &&
|
||||
QMessageBox::question( NULL,
|
||||
songEditor::tr( "File already exists" ),
|
||||
songEditor::tr( "The file %1 already "
|
||||
"exists.\nDo you want "
|
||||
"to overwrite it?"
|
||||
).arg( fn ),
|
||||
QMessageBox::Yes, QMessageBox::No )
|
||||
== QMessageBox::No )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
|
||||
{
|
||||
QMessageBox::critical( NULL, songEditor::tr( "Could not write "
|
||||
|
||||
Reference in New Issue
Block a user