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


C++ VCardConverter::createVCards方法代码示例

本文整理汇总了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());
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:9,代码来源:groupwise.cpp

示例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;
  }
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:10,代码来源:kvcarddrag.cpp

示例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();
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:47,代码来源:viewmanager.cpp

示例4: addresseesToClipboard

QString AddresseeUtil::addresseesToClipboard(const KABC::Addressee::List &list)
{
    KABC::VCardConverter converter;

    return converter.createVCards(list);
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:6,代码来源:addresseeutil.cpp


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