本文整理汇总了C++中kabc::VCardConverter::createVCards方法的典型用法代码示例。如果您正苦于以下问题:C++ VCardConverter::createVCards方法的具体用法?C++ VCardConverter::createVCards怎么用?C++ VCardConverter::createVCards使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kabc::VCardConverter
的用法示例。
在下文中一共展示了VCardConverter::createVCards方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotReadReceiveAddressees
void Groupwise::slotReadReceiveAddressees(const KABC::Addressee::List addressees)
{
kdDebug() << "Groupwise::slotReadReceiveAddressees() - passing " << addressees.count() << " contacts back to application" << endl;
KABC::VCardConverter conv;
QString vcard = conv.createVCards(addressees);
data(vcard.utf8());
}
示例2: populateMimeData
bool KVCardDrag::populateMimeData( QMimeData *md, const KABC::Addressee::List &addressees )
{
KABC::VCardConverter converter;
QByteArray vcards = converter.createVCards( addressees );
if ( !vcards.isEmpty() ) {
return populateMimeData( md, vcards );
} else {
return false;
}
}
示例3: startDrag
void ViewManager::startDrag()
{
// Get the list of all the selected addressees
KABC::Addressee::List addrList;
const QStringList uidList = selectedUids();
if(uidList.isEmpty())
return;
kdDebug(5720) << "ViewManager::startDrag: starting to drag" << endl;
QStringList::ConstIterator it;
for(it = uidList.begin(); it != uidList.end(); ++it)
addrList.append(mCore->addressBook()->findByUid(*it));
KMultipleDrag *drag = new KMultipleDrag(this);
KABC::VCardConverter converter;
QString vcards = converter.createVCards(addrList);
// Best text representation is given by textdrag, so it must be first
drag->addDragObject(new QTextDrag(AddresseeUtil::addresseesToEmails(addrList), this));
drag->addDragObject(new KVCardDrag(vcards, this));
KTempDir tempDir;
// can't set tempDir to autoDelete, in case of dropping on the desktop, the copy is async...
if(tempDir.status() == 0)
{
QString fileName;
if(addrList.count() == 1)
fileName = addrList[ 0 ].givenName() + "_" + addrList[ 0 ].familyName() + ".vcf";
else
fileName = "contacts.vcf";
QFile tempFile(tempDir.name() + "/" + fileName);
if(tempFile.open(IO_WriteOnly))
{
tempFile.writeBlock(vcards.utf8());
tempFile.close();
KURLDrag *urlDrag = new KURLDrag(KURL(tempFile.name()), this);
drag->addDragObject(urlDrag);
}
}
drag->setPixmap(KGlobal::iconLoader()->loadIcon("vcard", KIcon::Desktop));
drag->dragCopy();
}
示例4: addresseesToClipboard
QString AddresseeUtil::addresseesToClipboard(const KABC::Addressee::List &list)
{
KABC::VCardConverter converter;
return converter.createVCards(list);
}