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:
Tobias Doerffel
2008-03-03 22:51:50 +00:00
parent 8586a7d30f
commit 2843a5d743
3 changed files with 3 additions and 19 deletions

View File

@@ -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 )
{

View File

@@ -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."

View File

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