void GuiMainWindow::createNewTab(Config *cfg, GuiBase::SplitType splittype) { int rc; GuiTerminalWindow *newWnd = new GuiTerminalWindow(tabArea, this); newWnd->cfg = *cfg; if ((rc=newWnd->initTerminal())) goto err_exit; if (this->setupLayout(newWnd, splittype)) goto err_exit; return; err_exit: delete newWnd; }
void GuiMainWindow::createNewTab(Config *cfg, GuiBase::SplitType splittype) { int rc; GuiTerminalWindow *newWnd = new GuiTerminalWindow(tabArea, this); newWnd->cfg = *cfg; auto config_name = QString(cfg->config_name); auto hostname = QString(cfg->host); if ((rc=newWnd->initTerminal())) goto err_exit; if (this->setupLayout(newWnd, splittype)) goto err_exit; // To set the current session to MRU list qutty_mru_sesslist.insertSession(config_name, hostname); return; err_exit: delete newWnd; }