Skip to content

Commit 2c8730d

Browse files
author
jan
committed
fix #1661
1 parent 5a545cf commit 2c8730d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

io.sloeber.core/src/io/sloeber/core/api/BoardDescription.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ protected BoardDescription(File boardsFile, String boardID) {
668668
String board_txt = section.getValue(KEY_SLOEBER_BOARD_TXT);
669669
myUploadPort = section.getValue(KEY_SLOEBER_UPLOAD_PORT);
670670
KeyValueTree optionsTree = section.getChild(KEY_SLOEBER_MENU_SELECTION);
671-
Map<String, String> options = optionsTree.toKeyValues(EMPTY, false);
671+
Map<String, String> options = optionsTree.toKeyValues(EMPTY);
672672

673673
myUserSelectedBoardsTxtFile = resolvePathEnvironmentString(new File(board_txt));
674674
mySloeberBoardTxtFile = new BoardTxtFile(myUserSelectedBoardsTxtFile);
@@ -864,7 +864,7 @@ public Map<String, String> getEnvVars() {
864864
String menuID = curOption.getKey();
865865
String SelectedMenuItemID = curOption.getValue();
866866
KeyValueTree curSelectedMenuItem = menuData.getChild(menuID + DOT + SelectedMenuItemID);
867-
allVars.putAll(curSelectedMenuItem.toKeyValues(EMPTY, false));
867+
allVars.putAll(curSelectedMenuItem.toKeyValues(EMPTY));
868868
}
869869

870870
//This moved last. See github issue 1410

io.sloeber.core/src/io/sloeber/core/txt/BoardTxtFile.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ public List<String> getAllBoardIDs() {
213213
*
214214
*/
215215
public Map<String, String> getBoardEnvironVars(String boardID) {
216-
return myData.getChild(boardID).toKeyValues(EMPTY, false);
216+
KeyValueTree boardTree= new KeyValueTree(myData.getChild(boardID));
217+
boardTree.removeChild(MENU);
218+
return boardTree.toKeyValues(EMPTY);
217219
}
218220

219221
public String getDefaultValueIDFromMenu(String boardID ,String menuID) {

io.sloeber.core/src/io/sloeber/core/txt/TxtFile.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,14 @@ public String getIDFromNiceName(String name) {
157157

158158
/**
159159
* Get all the key value pairs that need to be added to the environment
160-
* variables
160+
* variables excluding the menu. key
161161
*
162162
* prefix something to add at the beginning of each key name
163163
*/
164164
public Map<String, String> getAllEnvironVars(String prefix) {
165-
return myData.toKeyValues(prefix, true);
165+
KeyValueTree retKeyValue= new KeyValueTree(myData);
166+
retKeyValue.removeChild(MENU);
167+
return retKeyValue.toKeyValues(prefix);
166168
}
167169

168170
public KeyValueTree getData() {

0 commit comments

Comments
 (0)