Skip to content

Commit 65028dd

Browse files
authored
fix(cpn): remove custom switches from global functions (#6019)
1 parent fe41e75 commit 65028dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

companion/src/datamodels/compounditemmodels.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,12 @@ void RawSwitchItemModel::addItems(const RawSwitchType & type, int count)
264264
QStandardItem * modelItem = new QStandardItem();
265265
modelItem->setData(rs.toValue(), IMDR_Id);
266266
modelItem->setData(type, IMDR_Type);
267+
if (type == SWITCH_TYPE_SWITCH) {
268+
if (Boards::isSwitchFunc(div(abs(rs.index) - 1, 3).quot, boardType))
269+
context &= ~RawSwitch::GlobalFunctionsContext;
270+
else
271+
context |= RawSwitch::GlobalFunctionsContext;
272+
}
267273
modelItem->setData(context, IMDR_Flags);
268274
setDynamicItemData(modelItem, rs);
269275
appendRow(modelItem);

0 commit comments

Comments
 (0)