本文整理汇总了C++中kabc::Addressee::setDepartment方法的典型用法代码示例。如果您正苦于以下问题:C++ Addressee::setDepartment方法的具体用法?C++ Addressee::setDepartment怎么用?C++ Addressee::setDepartment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kabc::Addressee
的用法示例。
在下文中一共展示了Addressee::setDepartment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: workAddr
static KABC::Addressee convertLdapAttributesToAddressee( const KLDAP::LdapAttrMap &attrs )
{
KABC::Addressee addr;
// name
if ( !attrs.value( "cn" ).isEmpty() ) {
addr.setNameFromString( asUtf8( attrs["cn"].first() ) );
}
// email
KLDAP::LdapAttrValue lst = attrs["mail"];
KLDAP::LdapAttrValue::ConstIterator it = lst.constBegin();
bool pref = true;
while ( it != lst.constEnd() ) {
addr.insertEmail( asUtf8( *it ), pref );
pref = false;
++it;
}
if ( !attrs.value( "o" ).isEmpty() ) {
addr.setOrganization( asUtf8( attrs[ "o" ].first() ) );
}
if ( addr.organization().isEmpty() && !attrs.value( "Company" ).isEmpty() ) {
addr.setOrganization( asUtf8( attrs[ "Company" ].first() ) );
}
// Address
KABC::Address workAddr( KABC::Address::Work );
if ( !attrs.value( "department" ).isEmpty() ) {
addr.setDepartment( asUtf8( attrs[ "department" ].first() ) );
}
if ( !workAddr.isEmpty() ) {
addr.insertAddress( workAddr );
}
// phone
if ( !attrs.value( "homePhone" ).isEmpty() ) {
KABC::PhoneNumber homeNr = asUtf8( attrs[ "homePhone" ].first() );
homeNr.setType( KABC::PhoneNumber::Home );
addr.insertPhoneNumber( homeNr );
}
if ( !attrs.value( "telephoneNumber" ).isEmpty() ) {
KABC::PhoneNumber workNr = asUtf8( attrs[ "telephoneNumber" ].first() );
workNr.setType( KABC::PhoneNumber::Work );
addr.insertPhoneNumber( workNr );
}
if ( !attrs.value( "facsimileTelephoneNumber" ).isEmpty() ) {
KABC::PhoneNumber faxNr = asUtf8( attrs[ "facsimileTelephoneNumber" ].first() );
faxNr.setType( KABC::PhoneNumber::Fax );
addr.insertPhoneNumber( faxNr );
}
if ( !attrs.value( "mobile" ).isEmpty() ) {
KABC::PhoneNumber cellNr = asUtf8( attrs[ "mobile" ].first() );
cellNr.setType( KABC::PhoneNumber::Cell );
addr.insertPhoneNumber( cellNr );
}
if ( !attrs.value( "pager" ).isEmpty() ) {
KABC::PhoneNumber pagerNr = asUtf8( attrs[ "pager" ].first() );
pagerNr.setType( KABC::PhoneNumber::Pager );
addr.insertPhoneNumber( pagerNr );
}
return addr;
}
示例2: setDepartment
static void setDepartment(const QString &value, KABC::Addressee &addressee)
{
addressee.setDepartment(value);
}