macOS: Don't log missing forwarding target during notification forwarding

The missing targets are coming from NSViews that we haven't created, such
as the _NSThemeCloseWidget, and are just noise in the debug output.

Change-Id: I71ae1267460739969511bf4de946bcc7ca897e7b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Tor Arne Vestbø 2018-02-06 16:27:57 +01:00
parent 5a868fe0bb
commit 4962b0bee9
1 changed files with 6 additions and 11 deletions

View File

@ -117,17 +117,12 @@ static void qRegisterNotificationCallbacks()
return;
}
if (lcCocoaNotifications().isDebugEnabled()) {
if (cocoaWindows.isEmpty()) {
qCDebug(lcCocoaNotifications) << "Could not find forwarding target for" <<
qPrintable(notificationName) << "from" << notification.object;
} else {
QVector<QCocoaWindow *> debugWindows;
for (QCocoaWindow *cocoaWindow : cocoaWindows)
debugWindows += cocoaWindow;
qCDebug(lcCocoaNotifications) << "Forwarding" << qPrintable(notificationName) <<
"to" << debugWindows;
}
if (lcCocoaNotifications().isDebugEnabled() && !cocoaWindows.isEmpty()) {
QVector<QCocoaWindow *> debugWindows;
for (QCocoaWindow *cocoaWindow : cocoaWindows)
debugWindows += cocoaWindow;
qCDebug(lcCocoaNotifications) << "Forwarding" << qPrintable(notificationName) <<
"to" << debugWindows;
}
// FIXME: Could be a foreign window, look up by iterating top level QWindows