From 2843a5d743d2bcade5097fe0748c8178fdd44ab7 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 3 Mar 2008 22:51:50 +0000 Subject: [PATCH] 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 --- include/mmp.h | 2 +- src/core/song.cpp | 3 +-- src/lib/mmp.cpp | 17 +---------------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/include/mmp.h b/include/mmp.h index 508f6bb63..f082a7203 100644 --- a/include/mmp.h +++ b/include/mmp.h @@ -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 ) { diff --git a/src/core/song.cpp b/src/core/song.cpp index 508d47de6..08bddab33 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -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." diff --git a/src/lib/mmp.cpp b/src/lib/mmp.cpp index 5eace5c53..ae8b75c69 100644 --- a/src/lib/mmp.cpp +++ b/src/lib/mmp.cpp @@ -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 "