diff options
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index c21ebda..5f076ff 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5443,8 +5443,6 @@ QString QWidget::windowIconText() const \list \o The file name of the specified path, obtained using QFileInfo::fileName(). - \o An optional \c{*} character, if the \l windowModified property is set, - as per the Apple Human Interface Guidelines. \endlist On Windows and X11: @@ -5493,7 +5491,7 @@ void QWidgetPrivate::setWindowFilePath_helper(const QString &filePath) { if (extra->topextra && extra->topextra->caption.isEmpty()) { #ifdef Q_WS_MAC - setWindowTitle_helper(filePath); + setWindowTitle_helper(QFileInfo(filePath).fileName()); #else Q_Q(QWidget); Q_UNUSED(filePath); diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 6cdb5fe..5577224 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -83,6 +83,7 @@ #include "qcursor.h" #include "qdesktopwidget.h" #include "qevent.h" +#include "qfileinfo.h" #include "qimage.h" #include "qlayout.h" #include "qmenubar.h" @@ -2886,7 +2887,8 @@ void QWidgetPrivate::setWindowFilePath_sys(const QString &filePath) Q_Q(QWidget); #ifdef QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; - [qt_mac_window_for(q) setRepresentedFilename:reinterpret_cast<const NSString *>(static_cast<CFStringRef>(QCFString(filePath)))]; + QFileInfo fi(filePath); + [qt_mac_window_for(q) setRepresentedFilename:fi.exists() ? qt_mac_QStringToNSString(filePath) : @""]; #else bool validRef = false; FSRef ref; |