@@ -2823,6 +2823,8 @@ void QgisApp::fileSave()
2823
2823
lastUsedDir, QObject::tr (" QGis files (*.qgs)" )) );
2824
2824
2825
2825
saveFileDialog->setMode (QFileDialog::AnyFile);
2826
+ saveFileDialog->setAcceptMode (QFileDialog::AcceptSave);
2827
+ saveFileDialog->setConfirmOverwrite ( true );
2826
2828
2827
2829
if (saveFileDialog->exec () == QDialog::Accepted)
2828
2830
{
@@ -2845,28 +2847,6 @@ void QgisApp::fileSave()
2845
2847
fullPath.setFile ( newFilePath );
2846
2848
}
2847
2849
2848
- // Check to see if the file exists before just blasting it into
2849
- // oblivion; abort saving the project if the user does not want to
2850
- // over-write an existing file.
2851
-
2852
- if ( fullPath.exists () )
2853
- {
2854
- if ( QMessageBox::No == QMessageBox::warning ( 0x0 ,
2855
- tr (" Project file exists." ),
2856
- tr (" The given project file exists. Do you wish to over-write it with a new one?" ),
2857
- QMessageBox::Yes | QMessageBox::Default,
2858
- QMessageBox::No | QMessageBox::Escape,
2859
- Qt::NoButton ) )
2860
- {
2861
- return ; // abort saving the file since the user
2862
- // doesn't want to over-write
2863
- }
2864
-
2865
- }
2866
- else
2867
- {
2868
- QgsDebug ( " project file does not already exist" );
2869
- }
2870
2850
2871
2851
#ifdef QGISDEBUG
2872
2852
const char * filePathStr = fullPath.filePath ().ascii (); // debugger probe
0 commit comments