Projucer overwrites existing files without warning when using "Add new CPP & header file"


#1

I originally posted this to github here

Steps to reproduce:

  • Create a project in the Projucer (I’m using an audio effect project)
  • Click on an “Add new CPP & header file”
  • Select PluginEditor.h
  • Click OK

After reloading the files in the Projucer, they have become blank with only a comment at the top and a single preprocessor directive.

I just destroyed two of my files this way after accidentally clicking this option instead of the “Add existing files…”.
I’m using 64-bit Linux.


#2

There’s not much we can do if you’ve selected the file and chosen to overwrite it. The file browser dialog that is shown is the native platform dialog (not a JUCE one) and it looks like on Linux it doesn’t warn you about overwriting existing files.