Wed, 09 Mar 2022 13:14:40 +0200
show unnamed tabs as "<unnamed>" in the tab list
src/mainwindow.cpp | file | annotate | diff | comparison | revisions |
--- a/src/mainwindow.cpp Wed Mar 09 13:01:50 2022 +0200 +++ b/src/mainwindow.cpp Wed Mar 09 13:14:40 2022 +0200 @@ -199,7 +199,12 @@ this->statusBar()->showMessage(newStatusText); }); const QFileInfo fileInfo{*this->documents.modelPath(modelId)}; - this->ui->tabs->addTab(document, fileInfo.baseName()); + QString tabName = fileInfo.baseName(); + if (tabName.isEmpty()) + { + tabName = tr("<unnamed>"); + } + this->ui->tabs->addTab(document, tabName); this->ui->tabs->setCurrentWidget(document); document->restoreSplitterState(this->documentSplitterState); }