QCocoaTheme: Remove unreachable code
The condition
iconType != kGenericApplicationIcon
is never false, therefore we will never execute
the else statement. Consequently, overlyaIcon
will always be null.
This was triggered by the deprecation of
ProcessSerialNumber related APIs since 10.9.
Change-Id: If9eec1d2cc6e7e5b0c5323d4550f0c823a5eb0d8
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
bb10
parent
631b143b3f
commit
9d620483c6
|
|
@ -214,34 +214,14 @@ QPixmap QCocoaTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const
|
|||
}
|
||||
if (iconType != 0) {
|
||||
QPixmap pixmap;
|
||||
IconRef icon;
|
||||
IconRef overlayIcon = 0;
|
||||
if (iconType != kGenericApplicationIcon) {
|
||||
GetIconRef(kOnSystemDisk, kSystemIconsCreator, iconType, &icon);
|
||||
} else {
|
||||
FSRef fsRef;
|
||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
GetProcessBundleLocation(&psn, &fsRef);
|
||||
GetIconRefFromFileInfo(&fsRef, 0, 0, 0, 0, kIconServicesNormalUsageFlag, &icon, 0);
|
||||
if (sp == MessageBoxCritical) {
|
||||
overlayIcon = icon;
|
||||
GetIconRef(kOnSystemDisk, kSystemIconsCreator, kAlertCautionIcon, &icon);
|
||||
}
|
||||
}
|
||||
IconRef icon = Q_NULLPTR;
|
||||
GetIconRef(kOnSystemDisk, kSystemIconsCreator, iconType, &icon);
|
||||
|
||||
if (icon) {
|
||||
pixmap = qt_mac_convert_iconref(icon, size.width(), size.height());
|
||||
ReleaseIconRef(icon);
|
||||
}
|
||||
|
||||
if (overlayIcon) {
|
||||
QSizeF littleSize = size / 2;
|
||||
QPixmap overlayPix = qt_mac_convert_iconref(overlayIcon, littleSize.width(), littleSize.height());
|
||||
QPainter painter(&pixmap);
|
||||
painter.drawPixmap(littleSize.width(), littleSize.height(), overlayPix);
|
||||
ReleaseIconRef(overlayIcon);
|
||||
}
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue