File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
arduino-core/src/processing/app Expand file tree Collapse file tree 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() {
149149 TargetBoard board = getTargetBoard ();
150150 if (board == null )
151151 return null ;
152+ String boardId = board .getId ();
152153
153154 PreferencesMap prefs = new PreferencesMap (board .getPreferences ());
155+
156+ String extendedName = prefs .get ("name" );
154157 for (String menuId : board .getMenuIds ()) {
158+ if (!board .hasMenu (menuId ))
159+ continue ;
160+
161+ // Get "custom_[MENU_ID]" preference (for example "custom_cpu")
155162 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 );
159166 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 );
162170 }
163171 }
172+ prefs .put ("name" , extendedName );
164173 return prefs ;
165174 }
166175
You can’t perform that action at this time.
0 commit comments