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 @@ -149,18 +149,27 @@ static public PreferencesMap getBoardPreferences() {
149
149
TargetBoard board = getTargetBoard ();
150
150
if (board == null )
151
151
return null ;
152
+ String boardId = board .getId ();
152
153
153
154
PreferencesMap prefs = new PreferencesMap (board .getPreferences ());
155
+
156
+ String extendedName = prefs .get ("name" );
154
157
for (String menuId : board .getMenuIds ()) {
158
+ if (!board .hasMenu (menuId ))
159
+ continue ;
160
+
161
+ // Get "custom_[MENU_ID]" preference (for example "custom_cpu")
155
162
String entry = PreferencesData .get ("custom_" + menuId );
156
- if (board . hasMenu ( menuId ) && entry != null &&
157
- entry . startsWith ( board . getId ())) {
158
- String selectionId = entry .substring (entry . indexOf ( "_" ) + 1 );
163
+ if (entry != null && entry . startsWith ( boardId )) {
164
+
165
+ String selectionId = entry .substring (boardId . length ( ) + 1 );
159
166
prefs .putAll (board .getMenuPreferences (menuId , selectionId ));
160
- prefs .put ("name" , prefs .get ("name" ) + ", " +
161
- board .getMenuLabel (menuId , selectionId ));
167
+
168
+ // Update the name with the extended configuration
169
+ extendedName += ", " + board .getMenuLabel (menuId , selectionId );
162
170
}
163
171
}
172
+ prefs .put ("name" , extendedName );
164
173
return prefs ;
165
174
}
166
175
You can’t perform that action at this time.
0 commit comments