File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
arduino-core/src/processing/app Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ private List<SketchFile> listSketchFiles(boolean showWarnings) throws IOExceptio
105105 if (BaseNoGui .isSanitaryName (file .getName ())) {
106106 FileUtils .SplitFile split = FileUtils .splitFilename (file );
107107 boolean isPrimary = split .basename .equals (folder .getName ()) && SKETCH_EXTENSIONS .contains (split .extension );
108- result .add (new SketchFile (file , isPrimary ));
108+ result .add (new SketchFile (this , file , isPrimary ));
109109 } else if (showWarnings ) {
110110 System .err .println (I18n .format (tr ("File name {0} is invalid: ignored" ), file .getName ()));
111111 }
@@ -305,7 +305,7 @@ public SketchFile addFile(String newName) throws IOException {
305305 checkNewFilename (newFile );
306306
307307 // Add a new sketchFile
308- SketchFile sketchFile = new SketchFile (newFile , false );
308+ SketchFile sketchFile = new SketchFile (this , newFile , false );
309309 files .add (sketchFile );
310310 Collections .sort (files , CODE_DOCS_COMPARATOR );
311311
Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ public class SketchFile {
4545 */
4646 private File file ;
4747
48+ /**
49+ * The sketch this file belongs to.
50+ */
51+ private Sketch sketch ;
52+
4853 /**
4954 * Is this the primary file in the sketch?
5055 */
@@ -79,12 +84,15 @@ public static interface TextStorage {
7984 /**
8085 * Create a new SketchFile
8186 *
87+ * @param sketch
88+ * The sketch this file belongs to
8289 * @param file
8390 * The file this SketchFile represents
8491 * @param primary
8592 * Whether this file is the primary file of the sketch
8693 */
87- public SketchFile (File file , boolean primary ) {
94+ public SketchFile (Sketch sketch , File file , boolean primary ) {
95+ this .sketch = sketch ;
8896 this .file = file ;
8997 this .primary = primary ;
9098 }
You can’t perform that action at this time.
0 commit comments