Version: (using KDE KDE 3.3.0) Installed from: Compiled From Sources Compiler: Pentium III 800 MHz OS: Linux Reproduce: * In kdevelop, choose file > new, or click the new file icon. * Enter a directory and a filename that already exists * Click OK * The file will now be overwritten without warning! Suggestion: In case the file already exists, show a dialog telling the user so. The option to overwrite should not even exist. The "new file dialog" is not the place for file management!
Oh I forgot, this concerns kdevelop version 3.1
CVS commit by dagerbo: Don't overwrite existing files CCMAIL: 90446-done@bugs.kde.org M +14 -0 filecreate_newfile.cpp 1.14.2.1 M +1 -0 filecreate_newfile.h 1.4.2.1 --- kdevelop/parts/filecreate/filecreate_newfile.cpp #1.14:1.14.2.1 @@ -25,4 +25,6 @@ #include <klocale.h> #include <kdebug.h> +#include <kmessagebox.h> + namespace FileCreate { @@ -144,3 +146,15 @@ namespace FileCreate { } + void NewFileChooser::accept() + { + QFileInfo file( url().path() ); + if ( file.exists() ) + { + KMessageBox::sorry( 0, i18n("A file with this name already exists."), i18n("File Exists") ); + return; + } + KDialogBase::accept(); + } + } + --- kdevelop/parts/filecreate/filecreate_newfile.h #1.4:1.4.2.1 @@ -43,4 +43,5 @@ namespace FileCreate { protected: void addType(const FileType * filetype); + void accept(); QGridLayout *m_grid;