Bug #10466 2007-02-23 14:21

pauliusz

Adding new file with the same name already in project

After adding new file with the same name already in project through new file wizard cb adds duplicate entry in project files list. Also I think that file overwrite message should be displayed not in file browse window, but after clicking finish button, since it is possible to enter new file name by hand in edit box.

Category
Application::WrongBehaviour
Group
 
Status
Closed
Close date
2007-02-28 12:18
Assigned to
biplab
pauliusz 2007-02-23 14:25

By the way... It happens on Windows XP SP2. Code::Blocks svn 3635

dermeister 2007-02-23 21:06

Confirmed on Linux with revision 3635 (wxGTK 2.6.3.3).

I think moving the overwrite message could be quite hard as it is generated by the FileOpenDialog which is a standard dialog and is provided by wxWidgets and/or its base libraries like WinAPI on Windows or GTK on Linux. Therefore it would require to write an own FileOpenDialog if this message cannot be suppresed by a flag and I don't think this is worth the costs.

dermeister 2007-02-23 21:10

I just looked at the documentation of wxFileDialog and there is a flag to activate or deactivate this message. Thus it should be easy to move this message ;)

dermeister 2007-02-23 21:24

OK, I looked through some more lines of code and I came to the conclusion that this bug should not exist. Why? Well, because cbProject::AddFile, which is called to add new files to a project, already HAS a check that looks for duplicate file names and returns the old file if it finds one. But I don't know why this check fails here and a new file with the old filename is created.

biplab 2007-02-28 12:18

Bug fixed. In revision 3652.

Thanks for reporting.