File tree 1 file changed +14
-5
lines changed
arduino-core/src/processing/app
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -154,18 +154,27 @@ static public PreferencesMap getBoardPreferences() {
154
154
TargetBoard board = getTargetBoard ();
155
155
if (board == null )
156
156
return null ;
157
+ String boardId = board .getId ();
157
158
158
159
PreferencesMap prefs = new PreferencesMap (board .getPreferences ());
160
+
161
+ String extendedName = prefs .get ("name" );
159
162
for (String menuId : board .getMenuIds ()) {
163
+ if (!board .hasMenu (menuId ))
164
+ continue ;
165
+
166
+ // Get "custom_[MENU_ID]" preference (for example "custom_cpu")
160
167
String entry = PreferencesData .get ("custom_" + menuId );
161
- if (board . hasMenu ( menuId ) && entry != null &&
162
- entry . startsWith ( board . getId ())) {
163
- String selectionId = entry .substring (entry . indexOf ( "_" ) + 1 );
168
+ if (entry != null && entry . startsWith ( boardId )) {
169
+
170
+ String selectionId = entry .substring (boardId . length ( ) + 1 );
164
171
prefs .putAll (board .getMenuPreferences (menuId , selectionId ));
165
- prefs .put ("name" , prefs .get ("name" ) + ", " +
166
- board .getMenuLabel (menuId , selectionId ));
172
+
173
+ // Update the name with the extended configuration
174
+ extendedName += ", " + board .getMenuLabel (menuId , selectionId );
167
175
}
168
176
}
177
+ prefs .put ("name" , extendedName );
169
178
return prefs ;
170
179
}
171
180
You can’t perform that action at this time.
0 commit comments