From 9313f8565b41c9de4b1990e155fe3fe8468f3446 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 14 Sep 2016 22:33:56 +0200 Subject: [PATCH] Set window title before stting modified state Fixes message "QWidget::setWindowModified: The window title does not contain a '[*]' placeholder" when opening a non-existent file. --- src/frontends/qt4/GuiView.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 4c67ff0324..251b664679 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1170,12 +1170,6 @@ void GuiView::updateWindowTitle(GuiWorkArea * wa) || wa->bufferView().buffer().isInternal()) return; Buffer const & buf = wa->bufferView().buffer(); - // Sets the path for the window: this is used by OSX to - // allow a context click on the title bar showing a menu - // with the path up to the file - setWindowFilePath(toqstr(buf.absFileName())); - // Tell Qt whether the current document is changed - setWindowModified(!buf.isClean()); // Set the windows title docstring title = buf.fileName().displayName(130) + from_ascii("[*]"); #ifndef Q_WS_MAC @@ -1183,6 +1177,12 @@ void GuiView::updateWindowTitle(GuiWorkArea * wa) title += from_ascii(" ") + char_type(0x2014) + from_ascii(" LyX"); #endif setWindowTitle(toqstr(title)); + // Sets the path for the window: this is used by OSX to + // allow a context click on the title bar showing a menu + // with the path up to the file + setWindowFilePath(toqstr(buf.absFileName())); + // Tell Qt whether the current document is changed + setWindowModified(!buf.isClean()); if (buf.isReadonly()) read_only_->show(); -- 2.39.2