Cocoa: Make sure no invisible proxy icon button is created

If the icon is null, don't force creation.

Task-number: QTBUG-30064
Change-Id: If639714f667fedfcc67a3393a7d75111a7dbff3f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Gabriel de Dietrich 2013-04-15 14:26:21 +02:00 committed by The Qt Project
parent f5ea183cc6
commit 21f6ab2860

View File

@ -471,6 +471,8 @@ void QCocoaWindow::setWindowIcon(const QIcon &icon)
NSButton *iconButton = [m_nsWindow standardWindowButton:NSWindowDocumentIconButton];
if (iconButton == nil) {
if (icon.isNull())
return;
NSString *title = QCFString::toNSString(window()->title());
[m_nsWindow setRepresentedURL:[NSURL fileURLWithPath:title]];
iconButton = [m_nsWindow standardWindowButton:NSWindowDocumentIconButton];