本文整理汇总了C++中kabc::addressee::List::at方法的典型用法代码示例。如果您正苦于以下问题:C++ List::at方法的具体用法?C++ List::at怎么用?C++ List::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kabc::addressee::List
的用法示例。
在下文中一共展示了List::at方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotImport
void XXPortManager::slotImport( const QString &identifier )
{
const XXPort *xxport = mFactory.createXXPort( identifier, mParentWidget );
if( !xxport ) {
return;
}
const KABC::Addressee::List contacts = xxport->importContacts();
delete xxport;
if ( contacts.isEmpty() ) { // nothing to import
return;
}
const QStringList mimeTypes( KABC::Addressee::mimeType() );
QPointer<Akonadi::CollectionDialog> dlg = new Akonadi::CollectionDialog( mParentWidget );
dlg->setMimeTypeFilter( mimeTypes );
dlg->setAccessRightsFilter( Akonadi::Collection::CanCreateItem );
dlg->setCaption( i18n( "Select Address Book" ) );
dlg->setDescription(
i18n( "Select the address book the imported contact(s) shall be saved in:" ) );
dlg->setDefaultCollection( mDefaultAddressBook );
if ( !dlg->exec() || !dlg ) {
delete dlg;
return;
}
const Akonadi::Collection collection = dlg->selectedCollection();
delete dlg;
if ( !mImportProgressDialog ) {
mImportProgressDialog = new KProgressDialog( mParentWidget, i18n( "Import Contacts" ) );
mImportProgressDialog->setLabelText(
i18np( "Importing one contact to %2", "Importing %1 contacts to %2",
contacts.count(), collection.name() ) );
mImportProgressDialog->setAllowCancel( false );
mImportProgressDialog->setAutoClose( true );
mImportProgressDialog->progressBar()->setRange( 1, contacts.count() );
}
mImportProgressDialog->show();
for ( int i = 0; i < contacts.count(); ++i ) {
Akonadi::Item item;
item.setPayload<KABC::Addressee>( contacts.at( i ) );
item.setMimeType( KABC::Addressee::mimeType() );
Akonadi::ItemCreateJob *job = new Akonadi::ItemCreateJob( item, collection );
connect( job, SIGNAL(result(KJob*)), SLOT(slotImportJobDone(KJob*)) );
}
}