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


C++ Addressee::custom方法代码示例

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


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

示例1: getAccountId

static QString getAccountId(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-AccountId"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例2: customFieldsTest

void AddresseeTest::customFieldsTest()
{
    KContacts::Addressee a;

    // test for empty
    QVERIFY(a.customs().isEmpty());

    // test insert
    a.insertCustom(QStringLiteral("MyApp"), QStringLiteral("MyKey"), QStringLiteral("MyValue"));
    QCOMPARE(a.customs().count(), 1);
    QCOMPARE(a.custom(QStringLiteral("MyApp"), QStringLiteral("MyKey")), QStringLiteral("MyValue"));

    a.insertCustom(QStringLiteral("MyApp"), QStringLiteral("MyKey"), QStringLiteral("YourValue"));
    QCOMPARE(a.customs().count(), 1);   // still one, we overwrite...
    QCOMPARE(a.custom(QStringLiteral("MyApp"), QStringLiteral("MyKey")), QStringLiteral("YourValue"));

    // test query non-existing app/key
    QCOMPARE(a.custom(QStringLiteral("MyApp"), QStringLiteral("UnknownKey")), QString());
    QCOMPARE(a.custom(QStringLiteral("UnknownApp"), QStringLiteral("MyKey")), QString());

    // test insert with different key
    a.insertCustom(QStringLiteral("MyApp"), QStringLiteral("AnotherKey"), QStringLiteral("OtherValue"));
    QCOMPARE(a.customs().count(), 2);
    QCOMPARE(a.custom(QStringLiteral("MyApp"), QStringLiteral("AnotherKey")), QStringLiteral("OtherValue"));
    QCOMPARE(a.custom(QStringLiteral("MyApp"), QStringLiteral("MyKey")), QStringLiteral("YourValue"));

    // test insert with different app
    a.insertCustom(QStringLiteral("OtherApp"), QStringLiteral("OtherKey"), QStringLiteral("OurValue"));
    QCOMPARE(a.customs().count(), 3);
    QCOMPARE(a.custom(QStringLiteral("OtherApp"), QStringLiteral("OtherKey")), QStringLiteral("OurValue"));
    QCOMPARE(a.custom(QStringLiteral("MyApp"), QStringLiteral("AnotherKey")), QStringLiteral("OtherValue"));
    QCOMPARE(a.custom(QStringLiteral("MyApp"), QStringLiteral("MyKey")), QStringLiteral("YourValue"));

#if 0 //Order is not defined now as we use a QHash
    // test customs
    QCOMPARE(a.customs().at(0), QStringLiteral("MyApp-MyKey:YourValue"));
    QCOMPARE(a.customs().at(1), QStringLiteral("MyApp-AnotherKey:OtherValue"));
    QCOMPARE(a.customs().at(2), QStringLiteral("OtherApp-OtherKey:OurValue"));
#endif
    // test equal operator
    KContacts::Addressee b;
    b.setUid(a.uid());
    b.insertCustom(QStringLiteral("OtherApp"), QStringLiteral("OtherKey"), QStringLiteral("OurValue"));
    b.insertCustom(QStringLiteral("MyApp"), QStringLiteral("MyKey"), QStringLiteral("YourValue"));
    b.insertCustom(QStringLiteral("MyApp"), QStringLiteral("AnotherKey"), QStringLiteral("OtherValue"));

    QCOMPARE(a, b);

    b.insertCustom(QStringLiteral("MyApp"), QStringLiteral("AnotherKey"), QStringLiteral("WrongValue"));
    QVERIFY(a != b);

    // test setCustoms
    KContacts::Addressee c;
    c.insertCustom(QStringLiteral("ThisApp"), QStringLiteral("ShouldNotBe"), QStringLiteral("There"));
    QCOMPARE(c.customs().count(), 1);

    const QStringList testData = QStringList() << QStringLiteral("FirstApp-FirstKey:FirstValue")
                                 << QStringLiteral("SecondApp-SecondKey:SecondValue")
                                 << QStringLiteral("ThirdApp-ThirdKey:ThirdValue");

    c.setCustoms(testData);
    QCOMPARE(c.customs().count(), 3);

    QCOMPARE(c.custom(QStringLiteral("FirstApp"), QStringLiteral("FirstKey")), QStringLiteral("FirstValue"));
    QCOMPARE(c.custom(QStringLiteral("SecondApp"), QStringLiteral("SecondKey")), QStringLiteral("SecondValue"));
    QCOMPARE(c.custom(QStringLiteral("ThirdApp"), QStringLiteral("ThirdKey")), QStringLiteral("ThirdValue"));

    // test remove
    QCOMPARE(c.customs().count(), 3);
    c.removeCustom(QStringLiteral("UnknownApp"), QStringLiteral("FirstKey"));
    QCOMPARE(c.customs().count(), 3);
    c.removeCustom(QStringLiteral("FirstApp"), QStringLiteral("UnknownKey"));
    QCOMPARE(c.customs().count(), 3);
    c.removeCustom(QStringLiteral("FirstApp"), QStringLiteral("FirstKey"));
    QCOMPARE(c.customs().count(), 2);
}
开发者ID:KDE,项目名称:kcontacts,代码行数:76,代码来源:addresseetest.cpp

示例3: getDeleted

static QString getDeleted(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-Deleted"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例4: getDoNotCall

static QString getDoNotCall(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-DoNotCall"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例5: getOpportunityRoleFields

static QString getOpportunityRoleFields(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-OpportunityRoleFields"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例6: getMAcceptStatusFields

static QString getMAcceptStatusFields(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-MacceptStatusFields"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例7: getCreatedById

static QString getCreatedById(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-CreatedById"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例8: getSalutation

static QString getSalutation(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-Salutation"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例9: getReportsToUserId

static QString getReportsToUserId(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-ReportsToUserId"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例10: getModifiedUserId

static QString getModifiedUserId(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-ModifiedUserId"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例11: getAssignedUserName

static QString getAssignedUserName(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-AssignedUserName"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例12: getCampaignName

static QString getCampaignName(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-CampaignName"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例13: getLeadSourceName

static QString getLeadSourceName(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-LeadSourceName"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例14: getAssistantPhone

static QString getAssistantPhone(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("FATCRM"), QStringLiteral("X-AssistantsPhone"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp

示例15: getAssistantName

static QString getAssistantName(const KContacts::Addressee &addressee)
{
    return addressee.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("X-AssistantsName"));
}
开发者ID:KDAB,项目名称:FatCRM,代码行数:4,代码来源:contactshandler.cpp


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