当前位置: 首页>>代码示例>>C++>>正文


C++ QMessage::bcc方法代码示例

本文整理汇总了C++中QMessage::bcc方法的典型用法代码示例。如果您正苦于以下问题:C++ QMessage::bcc方法的具体用法?C++ QMessage::bcc怎么用?C++ QMessage::bcc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QMessage的用法示例。


在下文中一共展示了QMessage::bcc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: compose

bool QMFService::compose(const QMessage &message)
{
    if (isBusy()) {
        return false;
    }
    m_active = 0;
    setError(QMessageManager::NoError);

    QStringList arguments;
    if (message.subject().size())
        arguments << "--subject" << message.subject();

    if (message.textContent().size())
        arguments << "--body" << message.textContent();

    if (message.cc().size())
        arguments << "--cc" << MessagingHelper::addressListToString(message.cc());

    if (message.bcc().size())
        arguments << "--bcc" << MessagingHelper::addressListToString(message.bcc());

    if (message.to().size())
        arguments <<  MessagingHelper::addressListToString(message.to());

    //qDebug() << __PRETTY_FUNCTION__ << " starting:" << XDG_PROG << arguments;

    if (QProcess::execute(XDG_PROG, arguments) != 0) {
        qWarning() << __PRETTY_FUNCTION__ << "Cannot start email composer: " << XDG_PROG << arguments;
        setError(QMessageManager::FrameworkFault);
        return false;
    }

    //qDebug() << __PRETTY_FUNCTION__ << "execution completed";

    return true;
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:36,代码来源:qmfservice_maemo6.cpp

示例2: filter


//.........这里部分代码省略.........
    case QMessageFilterPrivate::Sender:
        {
        if (filter._comparatorType == QMessageFilterPrivate::Equality) {
            QMessageDataComparator::EqualityComparator cmp(static_cast<QMessageDataComparator::EqualityComparator>(filter._comparatorValue));
            if (cmp == QMessageDataComparator::Equal) {
                if (filter._value.toString().length() > 0) {
                    if (message.from().addressee().compare(filter._value.toString(),caseSensitivity) == 0) {
                        return true;
                    }
                }
            } else { // NotEqual
                if (filter._value.toString().length() > 0) {
                    if (message.from().addressee().compare(filter._value.toString(),caseSensitivity) != 0) {
                        return true;
                    }
                } else {
                    return true;
                }
            }
        } else if (filter._comparatorType == QMessageFilterPrivate::Inclusion) {
            QMessageDataComparator::InclusionComparator cmp(static_cast<QMessageDataComparator::InclusionComparator>(filter._comparatorValue));
            if (cmp == QMessageDataComparator::Includes) {
                if (message.from().addressee().contains(filter._value.toString(),caseSensitivity)) {
                    return true;
                }
            } else { // Excludes
            if (!message.from().addressee().contains(filter._value.toString(),caseSensitivity)) {
                    return true;
                }
            }
        }
        break;
        }
    case QMessageFilterPrivate::Recipients: // to, cc & bcc fields
        {
        if (filter._comparatorType == QMessageFilterPrivate::Inclusion) {
            QMessageDataComparator::InclusionComparator cmp(static_cast<QMessageDataComparator::InclusionComparator>(filter._comparatorValue));
            bool includes = false;
            // Check to addresses
            QMessageAddressList addrList = message.to();
            for (int i=0; i < addrList.count(); i++) {
                if (addrList[i].addressee().contains(filter._value.toString(),caseSensitivity)) {
                    includes = true;
                    break;
                }
            }
            if (!includes) {
                // Check cc addresses
                addrList = message.cc();
                for (int i=0; i < addrList.count(); i++) {
                    if (addrList[i].addressee().contains(filter._value.toString(),caseSensitivity)) {
                        includes = true;
                        break;
                    }
                }
            }
            if (!includes) {
                // Check bcc addresses
                addrList = message.bcc();
                for (int i=0; i < addrList.count(); i++) {
                    if (addrList[i].addressee().contains(filter._value.toString(),caseSensitivity)) {
                        includes = true;
                        break;
                    }
                }
            }
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:67,代码来源:qmessagefilter_symbian.cpp


注:本文中的QMessage::bcc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。