summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-07-14 09:14:11 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-07-14 09:18:24 (GMT)
commitaf619623dd14055b8d37a49f48b14a33dc7ae048 (patch)
tree23612e75ad53b5d41caa186e3d7133d9b1f207ec /src/gui/kernel/qwidget_mac.mm
parente3c1fdc994a3743f5c69d944003b1c67698ba6d8 (diff)
downloadQt-af619623dd14055b8d37a49f48b14a33dc7ae048.zip
Qt-af619623dd14055b8d37a49f48b14a33dc7ae048.tar.gz
Qt-af619623dd14055b8d37a49f48b14a33dc7ae048.tar.bz2
Make the window title set by setWindowFilePath() match our docs.
On the mac, we were setting the absolute path of the file passed in while we document that we only set the filename. The filename is actually what all the other Mac apps do, so we should really do it. Unfortunately, this task laid around longer than it should, but the description text was bad. Additionally, fix a bug in the Cocoa version where we would set a proxy icon for items that didn't exist, this is not a good idea. Task-number: 220501 Reviewed-by: Trust Me
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm4
1 files changed, 3 insertions, 1 deletions
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;