| 746 | } |
| 747 | |
| 748 | void WorkspaceWidgetPrivate::onCloseRequested() |
| 749 | { |
| 750 | if (tabWidgetList.size() == 1) |
| 751 | return; |
| 752 | |
| 753 | TabWidget *tabWidget = qobject_cast<TabWidget *>(sender()); |
| 754 | if (!tabWidget) |
| 755 | return; |
| 756 | |
| 757 | if (focusTabWidget == tabWidget) |
| 758 | focusTabWidget = nullptr; |
| 759 | |
| 760 | tabWidgetList.removeOne(tabWidget); |
| 761 | tabWidget->deleteLater(); |
| 762 | |
| 763 | if (!tabWidgetList.isEmpty()) { |
| 764 | tabWidgetList.last()->setFocus(); |
| 765 | editor.switchedFile(tabWidgetList.last()->currentFile()); |
| 766 | auto symbolWidget = SymbolWidgetGenerator::instance()->symbolWidget(); |
| 767 | symbolWidget->setEditor(tabWidgetList.last()->currentEditor()); |
| 768 | } |
| 769 | |
| 770 | if (tabWidgetList.size() == 1) |
| 771 | tabWidgetList.first()->setCloseButtonVisible(false); |
| 772 | } |
| 773 | |
| 774 | void WorkspaceWidgetPrivate::handleOpenFile(const QString &workspace, const QString &fileName) |
| 775 | { |
nothing calls this directly
no test coverage detected