move variable closer to context where it is used

This commit is contained in:
Andrew Meadows 2017-03-21 15:15:15 -07:00
parent 18544581e6
commit f6d6c62fab

View file

@ -471,10 +471,10 @@ void Menu::removeSeparator(const QString& menuName, const QString& separatorName
int textAt = findPositionOfMenuItem(menu, separatorName);
QList<QAction*> menuActions = menu->actions();
if (textAt > 0 && textAt < menuActions.size()) {
QAction* separatorText = menuActions[textAt];
QAction* separatorLine = menuActions[textAt - 1];
if (separatorLine) {
if (separatorLine->isSeparator()) {
QAction* separatorText = menuActions[textAt];
menu->removeAction(separatorText);
menu->removeAction(separatorLine);
separatorRemoved = true;