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

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.

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.

0001-added-warning-when-overwriting-files-to-zenity.patch (1.8 KB)

There is an option in zenity to show a warning. This patch enables that when the corresponding flag is set.

2 Likes

I’ll get this merged in, thanks!