Skip to content

Commit

Permalink
fix #224121: Crash when clearing palette cell with filter active
Browse files Browse the repository at this point in the history
  • Loading branch information
Soerboe committed May 19, 2018
1 parent d31cfd9 commit 8498f90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions mscore/paletteBoxButton.cpp
Expand Up @@ -52,6 +52,8 @@ void PaletteBoxButton::contextMenuEvent(QContextMenuEvent* event)
QAction* actionEdit = menu.addAction(tr("Enable Editing"));
actionEdit->setCheckable(true);
actionEdit->setChecked(!palette->readOnly());
if (palette->isFilterActive())
actionEdit->setVisible(false);

bool _systemPalette = palette->systemPalette();
actionProperties->setDisabled(_systemPalette);
Expand Down
2 changes: 1 addition & 1 deletion mscore/paletteBoxButton.h
Expand Up @@ -52,10 +52,10 @@ class PaletteBoxButton : public QToolButton {
void upTriggered() { emit paletteCmd(PaletteCommand::UP, id); }
void downTriggered() { emit paletteCmd(PaletteCommand::DOWN, id); }
void newTriggered() { emit paletteCmd(PaletteCommand::NEW, id); }
void enableEditing(bool);

public slots:
void showPalette(bool);
void enableEditing(bool);

signals:
void paletteCmd(PaletteCommand, int);
Expand Down
8 changes: 4 additions & 4 deletions mscore/palettebox.cpp
Expand Up @@ -119,13 +119,13 @@ void PaletteBox::filterPalettes(const QString& text)
bool f = p->filter(text);
b->setVisible(!f);
if (b->isVisible()) {
if (text.isEmpty())
b->showPalette(false);
else
b->showPalette(true);
b->showPalette(!text.isEmpty());
}
else
b->showPalette(false);

// disable editing while palette is filtered
b->enableEditing(text.isEmpty());
}
}

Expand Down

0 comments on commit 8498f90

Please sign in to comment.