Пример #1
0
QMailMessageKey QMailMessageKey::operator|(const QMailMessageKey& other) const
{
    if (isEmpty() || isNonMatching())
        return other;
    else if (other.isEmpty() || other.isNonMatching())
        return *this;

    QMailMessageKey k;
    k.d->combiner = Or;
    if(d->combiner != And && !d->negated && other.d->combiner != And && !other.d->negated)
    {
        k.d->subKeys = d->subKeys + other.d->subKeys;
        k.d->arguments = d->arguments + other.d->arguments;
    }
    else
    {
        k.d->subKeys.append(*this);    
        k.d->subKeys.append(other);
    }

    return k;
}
bool QMailMessageListModelPrivate::processMessagesAdded(const QMailMessageIdList &ids)
{
    if (_ignoreUpdates) {
        // Defer until resynchronised
        _needSynchronize = true;
        return true;
    }

    if (_key.isNonMatching()) {
        // No messages are relevant
        return true;
    }

    init();

    // Find if and where these messages should be added
    if (!addMessages(ids)) {
        return false;
    }

    return true;
}