bool DataModel::isWellMergeable(const DataModel *other) const { if (!other->messageCount() || !messageCount()) return true; return calcMergeScore(this, other) + calcMergeScore(other, this) > 90; }
MessageItem *ContextItem::findMessage(const QString &sourcetext, const QString &comment) const { for (int i = 0; i < messageCount(); ++i) { MessageItem *mi = messageItem(i); if (mi->text() == sourcetext && mi->comment() == comment) return mi; } return 0; }
void MessageControl::doNewCount(bool write, bool fromSystem, bool notify) { if(write) { QSettings setting("Trolltech", "qpe"); setting.beginGroup( "Messages" ); setting.setValue( "MissedSMSMessages", smsCount); setting.setValue( "MissedMMSMessages", mmsCount); setting.setValue( "MissedSystemMessages", systemCount ); } int count = messageCount(); if (count) { // Don't update the NewMessages VS variable until the messages have been received if ( !fromSystem ) emit messageCount(messageCount(), smsFull(), false, notify); else emit messageCount(messageCount(), false, true, notify); } else { // We have to do this, since our count reset notification doesn't arrive until after // the notification that we should update the message count... emit messageCount(0, false, false, notify); messageCountChanged(); } }
uint MessageFolder::messageCount( MailType status, QMailMessage::MessageType type, const QMailAccount& account ) const { return messageCount(MessageStore::statusFilterKey(status) & MessageStore::messageFilterKey(type, account.id())); }
uint MessageFolder::messageCount( MailType status, QMailMessage::MessageType type ) const { return messageCount(MessageStore::statusFilterKey(status) & MessageStore::messageFilterKey(type)); }
bool MessageFolder::contains(const QMailMessageId& id) const { return ( messageCount(QMailMessageKey(QMailMessageKey::Id, id)) > 0 ); }
const Message& messageAt(int index) { Q_ASSERT(index >= 0 && index < messageCount()); return mMessages.at(index); }