fix Rests button in Inspector if no rests present

This commit is contained in:
Marc Sabatella 2015-02-14 16:40:16 -07:00
parent 962551c49f
commit 1cfd3ad10c

View file

@ -124,14 +124,11 @@ void InspectorGroupElement::notesClicked()
Score* score = inspector->el().front()->score();
QList<Element*> el = score->selection().elements();
QList<Element*> nel;
bool elementFound = false;
score->deselectAll();
for (Element* e : el) {
if (e->type() == Element::Type::NOTE) {
nel.append(e);
if (!elementFound)
score->deselectAll();
score->selection().add(e);
elementFound = true;
}
}
inspector->setElements(nel);
@ -147,14 +144,11 @@ void InspectorGroupElement::restsClicked()
Score* score = inspector->el().front()->score();
QList<Element*> el = score->selection().elements();
QList<Element*> nel;
bool elementFound = false;
score->deselectAll();
for (Element* e : el) {
if (e->type() == Element::Type::REST) {
nel.append(e);
if (!elementFound)
score->deselectAll();
score->selection().add(e);
elementFound = true;
}
}
inspector->setElements(nel);