File tree 2 files changed +6
-6
lines changed
arduino-core/src/processing/app
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,7 @@ private List<SketchFile> listSketchFiles(boolean showWarnings) throws IOExceptio
103
103
Set <SketchFile > result = new TreeSet <>(CODE_DOCS_COMPARATOR );
104
104
for (File file : FileUtils .listFiles (folder , false , EXTENSIONS )) {
105
105
if (BaseNoGui .isSanitaryName (file .getName ())) {
106
- FileUtils .SplitFile split = FileUtils .splitFilename (file );
107
- boolean isPrimary = split .basename .equals (folder .getName ()) && SKETCH_EXTENSIONS .contains (split .extension );
108
- result .add (new SketchFile (this , file , isPrimary ));
106
+ result .add (new SketchFile (this , file ));
109
107
} else if (showWarnings ) {
110
108
System .err .println (I18n .format (tr ("File name {0} is invalid: ignored" ), file .getName ()));
111
109
}
@@ -287,7 +285,7 @@ public SketchFile addFile(String newName) throws IOException {
287
285
checkNewFilename (newFile );
288
286
289
287
// Add a new sketchFile
290
- SketchFile sketchFile = new SketchFile (this , newFile , false );
288
+ SketchFile sketchFile = new SketchFile (this , newFile );
291
289
files .add (sketchFile );
292
290
Collections .sort (files , CODE_DOCS_COMPARATOR );
293
291
Original file line number Diff line number Diff line change @@ -91,10 +91,12 @@ public static interface TextStorage {
91
91
* @param primary
92
92
* Whether this file is the primary file of the sketch
93
93
*/
94
- public SketchFile (Sketch sketch , File file , boolean primary ) {
94
+ public SketchFile (Sketch sketch , File file ) {
95
95
this .sketch = sketch ;
96
96
this .file = file ;
97
- this .primary = primary ;
97
+ FileUtils .SplitFile split = FileUtils .splitFilename (file );
98
+ this .primary = split .basename .equals (sketch .getFolder ().getName ())
99
+ && Sketch .SKETCH_EXTENSIONS .contains (split .extension );
98
100
}
99
101
100
102
/**
You can’t perform that action at this time.
0 commit comments