From 75e66a531bf481700ce237d009f0a83397693531 Mon Sep 17 00:00:00 2001 From: Oskar Linde Date: Sat, 3 May 2014 18:50:27 +0200 Subject: [PATCH] Mac: Give document windows proper proxy icons --- src/MainWindow.ui | 3 --- src/mainwin.cc | 14 +++++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 5335d465..98afbd8d 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -10,9 +10,6 @@ 647 - - MainWindow - diff --git a/src/mainwin.cc b/src/mainwin.cc index 356ea97d..e5385921 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -559,19 +559,31 @@ MainWindow::setFileName(const QString &filename) if (filename.isEmpty()) { this->fileName.clear(); this->top_ctx.setDocumentPath(currentdir); +#if QT_VERSION >= QT_VERSION_CHECK(4, 4, 0) + setWindowTitle(""); + setWindowFilePath("untitled.scad"); +#else setWindowTitle("OpenSCAD - New Document[*]"); +#endif } else { QFileInfo fileinfo(filename); - setWindowTitle("OpenSCAD - " + fileinfo.fileName() + "[*]"); // Check that the canonical file path exists - only update recent files // if it does. Should prevent empty list items on initial open etc. QString infoFileName = fileinfo.absoluteFilePath(); + if (!infoFileName.isEmpty()) { this->fileName = infoFileName; +#if QT_VERSION >= QT_VERSION_CHECK(4, 4, 0) + setWindowTitle(""); + this->setWindowFilePath(infoFileName); +#else + setWindowTitle("OpenSCAD - " + fileinfo.fileName() + "[*]"); +#endif } else { this->fileName = fileinfo.fileName(); + setWindowTitle("OpenSCAD - " + fileinfo.fileName() + "[*]"); } this->top_ctx.setDocumentPath(fileinfo.dir().absolutePath().toLocal8Bit().constData());