void XGUI_ActionsMgr::setActionChecked(const QString& theId, const bool theChecked)
{
- QAction* anAction = myActions[theId];
- if (anAction && anAction->isCheckable()) {
- anAction->setChecked(theChecked);
+ if (myActions.contains(theId)) {
+ QAction* anAction = myActions[theId];
+ if (anAction->isCheckable()) {
+ anAction->setChecked(theChecked);
+ }
}
}
QString aCmdDocKind;
if(aCmd) {
aCmdDocKind = aCmd->documentKind();
- }
- else {
+ } else {
QString aId = eachAction->data().toString();
if (!aId.isEmpty()) {
aCmdDocKind = aWorkshop->salomeConnector()->documentKind(aId);
void XGUI_ActionsMgr::setActionEnabled(const QString& theId, const bool theEnabled)
{
- QAction* anAction = myActions[theId];
- if (anAction) {
- anAction->setEnabled(theEnabled);
+ if (myActions.contains(theId)) {
+ myActions[theId]->setEnabled(theEnabled);
}
}