void KOEditorAttachments::showAttachment( Q3IconViewItem *item )
{
  AttachmentIconItem *attitem = static_cast<AttachmentIconItem*>( item );
  if ( !attitem || !attitem->attachment() ) {
    return;
  }

  KCal::Attachment *att = attitem->attachment();
  if ( att->isUri() ) {
    emit openURL( att->uri() );
  } else {
    KRun::runUrl( mAttachments->tempFileForAttachment( att ), att->mimeType(), 0, true );
  }
}
Ejemplo n.º 2
0
void Incidence::saveAttachments(QDomElement &element) const
{
    KCal::Attachment::List::ConstIterator it = mAttachments.begin();
    for(; it != mAttachments.end(); ++it)
    {
        KCal::Attachment *a = (*it);
        if(a->isUri())
        {
            writeString(element, "link-attachment", a->uri());
        }
        else if(a->isBinary())
        {
            writeString(element, "inline-attachment", a->label());
        }
    }
}