本文整理汇总了C++中DistributionList::setUid方法的典型用法代码示例。如果您正苦于以下问题:C++ DistributionList::setUid方法的具体用法?C++ DistributionList::setUid怎么用?C++ DistributionList::setUid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DistributionList
的用法示例。
在下文中一共展示了DistributionList::setUid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testConverter
void TestDistrList::testConverter()
{
kDebug() ;
KABC::AddressBook *ab = KABC::StdAddressBook::self();
QList<KABC::Resource*> resources = ab->resources();
assert( resources.count() == 1 );
DistributionListConverter converter( resources[ 0 ] );
DistributionList pimList;
KABC::DistributionList *kabcList = converter.convertToKABC( pimList );
assert( kabcList != 0 );
assert( kabcList->entries().isEmpty() && kabcList->emails().isEmpty() );
assert( kabcList->identifier().isEmpty() && kabcList->name().isEmpty() );
DistributionList pimList2 = converter.convertFromKABC( kabcList );
assert( pimList2 == pimList );
delete kabcList;
pimList.setName( "pimlist-name" );
pimList.setUid( "pimlist-id" );
kabcList = converter.convertToKABC( pimList );
assert( kabcList != 0 );
assert( kabcList->entries().isEmpty() && kabcList->emails().isEmpty() );
assert( kabcList->identifier() == "pimlist-id" &&
kabcList->name() == "pimlist-name" );
pimList2 = converter.convertFromKABC( kabcList );
assert( pimList2 == pimList );
delete kabcList;
KABC::Addressee addr1 = ab->findByName( "addr1" ).first();
assert( !addr1.isEmpty() );
pimList.insertEntry( addr1 );
kabcList = converter.convertToKABC( pimList );
assert( kabcList != 0 );
assert( kabcList->identifier() == "pimlist-id" &&
kabcList->name() == "pimlist-name" );
assert( kabcList->entries().count() == 1 && kabcList->emails().count() == 1 );
assert( kabcList->entries()[ 0 ].addressee() == addr1 );
pimList2 = converter.convertFromKABC( kabcList );
assert( pimList2 == pimList );
delete kabcList;
KABC::Addressee addr2 = ab->findByName( "addr2" ).first();
assert( !addr2.isEmpty() );
pimList.insertEntry( addr2 );
kabcList = converter.convertToKABC( pimList );
assert( kabcList != 0 );
assert( kabcList->identifier() == "pimlist-id" &&
kabcList->name() == "pimlist-name" );
assert( kabcList->entries().count() == 2 && kabcList->emails().count() == 2 );
assert( kabcList->entries()[ 0 ].addressee() == addr1 );
assert( kabcList->entries()[ 2 ].addressee() == addr2 );
pimList2 = converter.convertFromKABC( kabcList );
assert( pimList2 == pimList );
delete kabcList;
}