File tree 2 files changed +11
-3
lines changed
arduino-core/src/processing/app 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
105
105
if (BaseNoGui .isSanitaryName (file .getName ())) {
106
106
FileUtils .SplitFile split = FileUtils .splitFilename (file );
107
107
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 ));
109
109
} else if (showWarnings ) {
110
110
System .err .println (I18n .format (tr ("File name {0} is invalid: ignored" ), file .getName ()));
111
111
}
@@ -305,7 +305,7 @@ public SketchFile addFile(String newName) throws IOException {
305
305
checkNewFilename (newFile );
306
306
307
307
// Add a new sketchFile
308
- SketchFile sketchFile = new SketchFile (newFile , false );
308
+ SketchFile sketchFile = new SketchFile (this , newFile , false );
309
309
files .add (sketchFile );
310
310
Collections .sort (files , CODE_DOCS_COMPARATOR );
311
311
Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ public class SketchFile {
45
45
*/
46
46
private File file ;
47
47
48
+ /**
49
+ * The sketch this file belongs to.
50
+ */
51
+ private Sketch sketch ;
52
+
48
53
/**
49
54
* Is this the primary file in the sketch?
50
55
*/
@@ -79,12 +84,15 @@ public static interface TextStorage {
79
84
/**
80
85
* Create a new SketchFile
81
86
*
87
+ * @param sketch
88
+ * The sketch this file belongs to
82
89
* @param file
83
90
* The file this SketchFile represents
84
91
* @param primary
85
92
* Whether this file is the primary file of the sketch
86
93
*/
87
- public SketchFile (File file , boolean primary ) {
94
+ public SketchFile (Sketch sketch , File file , boolean primary ) {
95
+ this .sketch = sketch ;
88
96
this .file = file ;
89
97
this .primary = primary ;
90
98
}
You can’t perform that action at this time.
0 commit comments