use setWindowModified() to indicate modified state and window title

This commit is contained in:
Max Wilfinger
2024-03-08 20:00:33 +01:00
committed by Yorik van Havre
parent b4ad517ed6
commit 241ce40b5f
2 changed files with 5 additions and 2 deletions

View File

@@ -453,7 +453,10 @@ QString MDIView::buildWindowTitle()
QString windowTitle;
if (Gui::Document* document = getGuiDocument()) {
if (document->isModified()) {
windowTitle = QString::fromUtf8("* ");
getMainWindow()->setWindowModified(TRUE);
}
else {
getMainWindow()->setWindowModified(FALSE);
}
windowTitle.append(QString::fromUtf8(getAppDocument()->getName()));

View File

@@ -2537,7 +2537,7 @@ void MainWindow::setWindowTitle(const QString& string)
}
if (!string.isEmpty()) {
title = QString::fromUtf8("%1 - %2").arg(string, title);
title = QString::fromUtf8("[*] %1 - %2").arg(string, title);
}
QMainWindow::setWindowTitle(title);