summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-07-14 08:36:39 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-07-14 09:18:22 (GMT)
commit4993acb83e7b9e118bfad45f02864a26013797f5 (patch)
tree67203da1375ab56553fd0b6bcfa83bd8a56ee245 /src/gui
parent3ccf773d344625ae306c55855cedd5d718212718 (diff)
downloadQt-4993acb83e7b9e118bfad45f02864a26013797f5.zip
Qt-4993acb83e7b9e118bfad45f02864a26013797f5.tar.gz
Qt-4993acb83e7b9e118bfad45f02864a26013797f5.tar.bz2
use qt_mac_QStringToNString & qt_mac_NSStringToQString
These functions hide all this horrible casting and we've had them for a while. When I see them, I try to replace them as it keeps the code much more readable.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget_mac.mm6
-rw-r--r--src/gui/widgets/qcocoatoolbardelegate_mac.mm5
2 files changed, 5 insertions, 6 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 5e2dfb6..6cdb5fe 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2864,8 +2864,7 @@ void QWidgetPrivate::setWindowTitle_sys(const QString &caption)
SetWindowTitleWithCFString(qt_mac_window_for(q), QCFString(caption));
#else
QMacCocoaAutoReleasePool pool;
- [qt_mac_window_for(q)
- setTitle:reinterpret_cast<const NSString *>(static_cast<CFStringRef>(QCFString(caption)))];
+ [qt_mac_window_for(q) setTitle:qt_mac_QStringToNSString(caption)];
#endif
}
}
@@ -2977,8 +2976,7 @@ void QWidgetPrivate::setWindowIconText_sys(const QString &iconText)
SetWindowAlternateTitle(qt_mac_window_for(q), QCFString(iconText));
#else
QMacCocoaAutoReleasePool pool;
- [qt_mac_window_for(q)
- setMiniwindowTitle:reinterpret_cast<const NSString *>(static_cast<CFStringRef>(QCFString(iconText)))];
+ [qt_mac_window_for(q) setMiniwindowTitle:qt_mac_QStringToNSString(iconText)];
#endif
}
}
diff --git a/src/gui/widgets/qcocoatoolbardelegate_mac.mm b/src/gui/widgets/qcocoatoolbardelegate_mac.mm
index 894028e..865069e 100644
--- a/src/gui/widgets/qcocoatoolbardelegate_mac.mm
+++ b/src/gui/widgets/qcocoatoolbardelegate_mac.mm
@@ -43,6 +43,7 @@
#ifdef QT_MAC_USE_COCOA
#include <private/qmainwindowlayout_p.h>
#include <private/qt_mac_p.h>
+#include <private/qt_cocoa_helpers_mac_p.h>
#include <private/qcocoaview_mac_p.h>
#include <private/qwidget_p.h>
#include <qtoolbar.h>
@@ -99,7 +100,7 @@ QT_FORWARD_DECLARE_CLASS(QCFString);
{
Q_UNUSED(flag);
Q_UNUSED(nstoolbar);
- QToolBar *tb = mainWindowLayout->cocoaItemIDToToolbarHash.value(QCFString::toQString(CFStringRef(itemIdentifier)));
+ QToolBar *tb = mainWindowLayout->cocoaItemIDToToolbarHash.value(qt_mac_NSStringToQString(itemIdentifier));
NSToolbarItem *item = nil;
if (tb) {
item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier];
@@ -111,7 +112,7 @@ QT_FORWARD_DECLARE_CLASS(QCFString);
- (void)toolbarWillAddItem:(NSNotification *)notification
{
NSToolbarItem *item = [[notification userInfo] valueForKey:@"item"];
- QToolBar *tb = mainWindowLayout->cocoaItemIDToToolbarHash.value(QCFString::toQString(CFStringRef([item itemIdentifier])));
+ QToolBar *tb = mainWindowLayout->cocoaItemIDToToolbarHash.value(qt_mac_NSStringToQString([item itemIdentifier]));
if (!tb)
return; // I can't really do anything about this.
[item retain];