]> git.lyx.org Git - lyx.git/commitdiff
Set window title before stting modified state
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 14 Sep 2016 20:33:56 +0000 (22:33 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 14 Sep 2016 20:37:06 +0000 (22:37 +0200)
Fixes message "QWidget::setWindowModified: The window title does not
contain a '[*]' placeholder" when opening a non-existent file.

src/frontends/qt4/GuiView.cpp

index 4c67ff03249fd37d931f5c2b147674d5f9f8c23d..251b664679edf366bd6f6ff94374402852a943ac 100644 (file)
@@ -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();