Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 1799:bea6e7bced25
Fix accidental removal of empty-pane/layer addition shortcuts
author | Chris Cannam |
---|---|
date | Wed, 02 May 2018 14:32:01 +0100 |
parents | 2f828631c9be |
children | e5229958a10c |
comparison
equal
deleted
inserted
replaced
1798:ea66d37669bf | 1799:bea6e7bced25 |
---|---|
1609 MainWindow::updateLayerShortcutsFor(Model *model) | 1609 MainWindow::updateLayerShortcutsFor(Model *model) |
1610 { | 1610 { |
1611 set<LayerFactory::LayerType> seen; | 1611 set<LayerFactory::LayerType> seen; |
1612 | 1612 |
1613 for (auto &a : m_paneActions) { | 1613 for (auto &a : m_paneActions) { |
1614 if (!a.second.sourceModel) continue; // empty pane/layer shortcut | |
1614 auto type = a.second.layer; | 1615 auto type = a.second.layer; |
1615 if (a.second.sourceModel == model && seen.find(type) == seen.end()) { | 1616 if (a.second.sourceModel == model && seen.find(type) == seen.end()) { |
1616 a.first->setShortcut(shortcutFor(type, true)); | 1617 a.first->setShortcut(shortcutFor(type, true)); |
1617 seen.insert(type); | 1618 seen.insert(type); |
1618 } else { | 1619 } else { |
1621 } | 1622 } |
1622 | 1623 |
1623 seen.clear(); | 1624 seen.clear(); |
1624 | 1625 |
1625 for (auto &a : m_layerActions) { | 1626 for (auto &a : m_layerActions) { |
1627 if (!a.second.sourceModel) continue; // empty pane/layer shortcut | |
1626 auto type = a.second.layer; | 1628 auto type = a.second.layer; |
1627 if (a.second.sourceModel == model && seen.find(type) == seen.end()) { | 1629 if (a.second.sourceModel == model && seen.find(type) == seen.end()) { |
1628 a.first->setShortcut(shortcutFor(type, false)); | 1630 a.first->setShortcut(shortcutFor(type, false)); |
1629 seen.insert(type); | 1631 seen.insert(type); |
1630 } else { | 1632 } else { |