More debug output

Signed-off-by: Max Risuhin <risuhin.max@gmail.com>
This commit is contained in:
Max Risuhin 2018-10-14 23:22:33 +03:00
parent 4950607cc1
commit 748cf3f512
No known key found for this signature in database
GPG Key ID: BF733F5ACA0B4448

View File

@ -86,18 +86,24 @@ BOOL installNSBundleHook()
^{
int notificationId = [notification.userInfo[@"id"] intValue];
qDebug() << "!!! Notification was delivered to NotificationCenter. ID:" << notificationId;
BOOL notificationAvailable = YES;
while(notificationAvailable) {
notificationAvailable = NO;
qDebug() << "--- List available notifications in NotificationCenter:";
for(NSUserNotification *osxNotification in [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]) {
int fetchedNotificationID = [osxNotification.userInfo[@"id"] intValue];
qDebug() << "--- Notification is available with ID:" << fetchedNotificationID;
}
bool notificationAvailable = true;
while(notificationAvailable == true) {
notificationAvailable = false;
for(NSUserNotification *osxNotification in [[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]) {
int fetchedNotificationID = [osxNotification.userInfo[@"id"] intValue];
if(fetchedNotificationID == notificationId) {
notificationAvailable = YES;
notificationAvailable = true;
[NSThread sleepForTimeInterval:0.25f];
break;
}
}
}
qDebug() << "Finishing availability checking for notificaion with ID:" <<notificationId;
dispatch_async(dispatch_get_main_queue(), ^{
if (!m_IdToNotification.contains(notificationId)) {
qCWarning(SNORE) << "Delivered notification is not recognized and will not be remove from active list. Notification id:" << notificationId;