コード例 #1
0
void NotifierNotificationSink::removeNotification(uint notificationId)
{
    applicationEventIds.remove(notificationId);
    if(applicationEventIds.isEmpty()) {
        setNotifierEnabled(false);
    }
}
コード例 #2
0
void NotifierNotificationSink::addNotification(const Notification &notification)
{
    if (!additionsDisabled && notification.type() == Notification::ApplicationEvent && isUnseen(notification)) {
        applicationEventIds.insert(notification.notificationId());
        if(applicationEventIds.count() == 1) {
            setNotifierEnabled(true);
        }
    }
}
コード例 #3
0
void LEDNotificationSink::removeNotification(uint notificationId)
{
    int index = notificationsId.indexOf(notificationId);
    if (index > -1) {
        notificationsId.removeAt(index);
    }

    if (notificationsId.empty())
        setNotifierEnabled(false);
}
コード例 #4
0
void LEDNotificationSink::addNotification(const Notification &notification)
{
    if (canAddNotification(notification) && !notificationsId.contains(notification.notificationId())) {
        if (checkIfAcceptable(notification.parameters())) {
            notificationsId.append(notification.notificationId());

            if (notificationsId.size() == 1)
                setNotifierEnabled(true);
        }
    }    
}
コード例 #5
0
LEDNotificationSink::~LEDNotificationSink()
{
    setNotifierEnabled(false);
}
コード例 #6
0
void NotifierNotificationSink::clearSink()
{
    applicationEventIds.clear();
    setNotifierEnabled(false);
}