diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 20872d82a5..d4620d8ced 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -1034,8 +1034,8 @@ void MainWindow::updateWindowTitle() if (stackedWidgetIndex == DatabaseTabScreen && tabWidgetIndex != -1) { customWindowTitlePart = m_ui->tabWidget->tabName(tabWidgetIndex); if (isModified) { - // remove asterisk '*' from title - customWindowTitlePart.remove(customWindowTitlePart.size() - 1, 1); + // Remove asterisk '*' from title + customWindowTitlePart.replace("*", ""); } m_ui->actionDatabaseSave->setEnabled(m_ui->tabWidget->canSave(tabWidgetIndex)); } else if (stackedWidgetIndex == 1) { @@ -1055,8 +1055,9 @@ void MainWindow::updateWindowTitle() setWindowFilePath(m_ui->tabWidget->databaseWidgetFromIndex(tabWidgetIndex)->database()->filePath()); } - setWindowTitle(windowTitle); + setWindowTitle("[*]"); // Reset title to the placeholder first setWindowModified(isModified); + setWindowTitle(windowTitle); updateTrayIcon(); }