File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -652,14 +652,13 @@ protected boolean saveAs() throws IOException {
652652 // make sure there doesn't exist a .cpp file with that name already
653653 // but ignore this situation for the first tab, since it's probably being
654654 // resaved (with the same name) to another location/folder.
655- for (SketchCode code : data .getCodes ()) {
656- if (newName .equalsIgnoreCase (code .getPrettyName ()) && code .isExtension ("cpp" )) {
655+ for (int i = 0 ; i < data .getCodeCount (); i ++) {
656+ SketchCode code = data .getCode (i );
657+ if (newName .equalsIgnoreCase (code .getPrettyName ())) {
657658 Base .showMessage (tr ("Error" ),
658- I18n .format (
659- tr ("You can't save the sketch as \" {0}\" \n " +
660- "because the sketch already has a .cpp file with that name." ),
661- newName
662- ));
659+ I18n .format (tr ("You can't save the sketch as \" {0}\" \n " +
660+ "because the sketch already has a file with that name." ), newName
661+ ));
663662 return false ;
664663 }
665664 }
You can’t perform that action at this time.
0 commit comments