move the setToolTip lines outside the if(action) inside it.
do not crash if there is no action.
const int index = urlNavigator->historyIndex();
QAction* backAction = actionCollection()->action("go_back");
const int index = urlNavigator->historyIndex();
QAction* backAction = actionCollection()->action("go_back");
- backAction->setToolTip(i18nc("@info", "Go back"));
+ backAction->setToolTip(i18nc("@info", "Go back"));
backAction->setEnabled(index < urlNavigator->historySize() - 1);
}
QAction* forwardAction = actionCollection()->action("go_forward");
backAction->setEnabled(index < urlNavigator->historySize() - 1);
}
QAction* forwardAction = actionCollection()->action("go_forward");
- forwardAction->setToolTip(i18nc("@info", "Go forward"));
+ forwardAction->setToolTip(i18nc("@info", "Go forward"));
forwardAction->setEnabled(index > 0);
}
}
forwardAction->setEnabled(index > 0);
}
}