本文整理汇总了C++中QMessageIdList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ QMessageIdList::append方法的具体用法?C++ QMessageIdList::append怎么用?C++ QMessageIdList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMessageIdList
的用法示例。
在下文中一共展示了QMessageIdList::append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testIdPreFilter
void tst_QMessageFilter::testIdPreFilter()
{
QMessageFilter filter = QMessageFilter::byId(QMessageId(email_prefix+"123"), QMessageDataComparator::Equal);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), false);
filter = QMessageFilter::byId(QMessageId(sms_prefix+"123"), QMessageDataComparator::Equal);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), false);
filter = QMessageFilter::byId(QMessageId(email_prefix+"123"), QMessageDataComparator::NotEqual);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), true);
filter = QMessageFilter::byId(QMessageId(), QMessageDataComparator::Equal);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), true);
filter = QMessageFilter::byId(QMessageId(), QMessageDataComparator::NotEqual);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), true);
QMessageIdList idList;
idList.append(QMessageId(email_prefix+"123"));
idList.append(QMessageId(email_prefix+"124"));
filter = QMessageFilter::byId(idList, QMessageDataComparator::Includes);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), false);
filter = QMessageFilter::byId(idList, QMessageDataComparator::Excludes);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), true);
idList.clear();
idList.append(QMessageId(sms_prefix+"123"));
idList.append(QMessageId(sms_prefix+"124"));
filter = QMessageFilter::byId(idList, QMessageDataComparator::Includes);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), false);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), true);
filter = QMessageFilter::byId(idList, QMessageDataComparator::Excludes);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), true);
idList.clear();
idList.append(QMessageId(email_prefix+"123"));
idList.append(QMessageId(sms_prefix+"124"));
filter = QMessageFilter::byId(idList, QMessageDataComparator::Includes);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), true);
filter = QMessageFilter::byId(idList, QMessageDataComparator::Excludes);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Email), true);
QCOMPARE(MessagingHelper::preFilter(filter, QMessage::Sms), true);
}
示例2: testIdFilter
void tst_QMessageFilter::testIdFilter()
{
#if defined(Q_WS_MAEMO_5)
QMessage message;
QMessagePrivate* privateMessage = QMessagePrivate::implementation(message);
privateMessage->_id = QMessageId("123");
QMessageFilter filter = QMessageFilter::byId(QMessageId("123"), QMessageDataComparator::Equal);
QMessageFilterPrivate* pf = QMessageFilterPrivate::implementation(filter);
QCOMPARE(pf->filter(message), true);
filter = QMessageFilter::byId(QMessageId("124"), QMessageDataComparator::Equal);
pf = QMessageFilterPrivate::implementation(filter);
QCOMPARE(pf->filter(message), false);
filter = QMessageFilter::byId(QMessageId("123"), QMessageDataComparator::NotEqual);
pf = QMessageFilterPrivate::implementation(filter);
QCOMPARE(pf->filter(message), false);
filter = QMessageFilter::byId(QMessageId("124"), QMessageDataComparator::NotEqual);
pf = QMessageFilterPrivate::implementation(filter);
QCOMPARE(pf->filter(message), true);
QMessageIdList idList;
idList.append(QMessageId("123"));
idList.append(QMessageId("124"));
idList.append(QMessageId("125"));
filter = QMessageFilter::byId(idList, QMessageDataComparator::Includes);
pf = QMessageFilterPrivate::implementation(filter);
QCOMPARE(pf->filter(message), true);
filter = QMessageFilter::byId(idList, QMessageDataComparator::Excludes);
pf = QMessageFilterPrivate::implementation(filter);
QCOMPARE(pf->filter(message), false);
idList.clear();
idList.append(QMessageId("124"));
idList.append(QMessageId("125"));
idList.append(QMessageId("126"));
filter = QMessageFilter::byId(idList, QMessageDataComparator::Includes);
pf = QMessageFilterPrivate::implementation(filter);
QCOMPARE(pf->filter(message), false);
filter = QMessageFilter::byId(idList, QMessageDataComparator::Excludes);
pf = QMessageFilterPrivate::implementation(filter);
QCOMPARE(pf->filter(message), true);
#endif
}
示例3: convert
QMessageIdList convert(const QList<QMailMessageId> &ids)
{
QMessageIdList result;
foreach (const QMailMessageId &id, ids) {
result.append(convert(id));
}
示例4: queryMessages
QMessageIdList QMFStore::queryMessages(const QMessageFilter &filter, const QString &body, QMessageDataComparator::MatchFlags matchFlags,
const QMessageSortOrder &sortOrder, uint limit, uint offset, QMessageManager::Error &error) const
{
if (filter.matchFlags() != 0) {
error = QMessageManager::NotYetImplemented;
return QMessageIdList();
}
error = QMessageManager::NoError;
QMessageIdList ids(convert(d_ptr->_store->queryMessages(convert(filter), convert(sortOrder))));
Qt::CaseSensitivity searchOptions(Qt::CaseInsensitive);
if (matchFlags & QMessageDataComparator::MatchCaseSensitive) {
searchOptions = Qt::CaseSensitive;
}
QMessageIdList result;
foreach (QMessageId id, ids) {
QMessage message(id);
QMessageContentContainer bodyContainer(message.find(message.bodyId()));
if (bodyContainer.textContent().contains(body, searchOptions)) {
result.append(id);
if (limit && ((uint)result.count() >= offset + limit)) {
break;
}
}
}