Skip to content
Snippets Groups Projects
Commit f3d32730 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

after failed loading from XML, don't add empty item (#997)

parent 91ba180c
No related branches found
No related tags found
1 merge request!2644after failed loading from XML, don't add empty item (#997)
Pipeline #150059 passed
......@@ -106,8 +106,10 @@ void InstrumentView::createActions(QToolBar* toolbar)
m_load_action->setIcon(QIcon(":/images/library.svg"));
m_load_action->setToolTip("Load an instrument from the instrument library");
toolbar->addAction(m_load_action);
connect(m_load_action, &QAction::triggered,
[this] { m_set->add_item(IO::loadComponentFromXML<InstrumentItem>("instrument")); });
connect(m_load_action, &QAction::triggered, [this] {
if (InstrumentItem* t = IO::loadComponentFromXML<InstrumentItem>("instrument"))
m_set->add_item(t);
});
//... Actions on selected instrument
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment