add check

This commit is contained in:
Patrick von Reth 2015-04-20 16:50:15 +02:00
parent faf95d9ed3
commit fa733c1c8e
1 changed files with 5 additions and 0 deletions

View File

@ -151,6 +151,11 @@ bool Notification::isValid() const
void Notification::addActiveIn(const QObject *o) void Notification::addActiveIn(const QObject *o)
{ {
bool contains = d->m_activeIn.contains(o);
Q_ASSERT_X(contains,Q_FUNC_INFO,"already active");
if(contains) {
snoreDebug(SNORE_WARNING) << o << "already active in" << id();
}
d->m_activeIn.insert(o); d->m_activeIn.insert(o);
SnoreCorePrivate::instance()->m_activeNotifications[id()] = *this; SnoreCorePrivate::instance()->m_activeNotifications[id()] = *this;
snoreDebug(SNORE_INFO) << d->m_activeIn.size() << o << qobject_cast<SnorePlugin*>(o); snoreDebug(SNORE_INFO) << d->m_activeIn.size() << o << qobject_cast<SnorePlugin*>(o);