NOISSUE do not remake instance tools menu, refill it instead

This commit is contained in:
Petr Mrázek 2015-05-02 12:07:18 +02:00
parent 994c815bb9
commit 55f9117ce3

View File

@ -707,11 +707,16 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
void MainWindow::updateToolsMenu() void MainWindow::updateToolsMenu()
{ {
if (ui->actionLaunchInstance->menu()) QMenu *launchMenu = ui->actionLaunchInstance->menu();
if(launchMenu)
{ {
ui->actionLaunchInstance->menu()->deleteLater(); launchMenu->clear();
} }
QMenu *launchMenu = new QMenu(this); else
{
launchMenu = new QMenu(this);
}
QAction *normalLaunch = launchMenu->addAction(tr("Launch")); QAction *normalLaunch = launchMenu->addAction(tr("Launch"));
connect(normalLaunch, &QAction::triggered, [this]() connect(normalLaunch, &QAction::triggered, [this]()
{ doLaunch(); }); { doLaunch(); });