Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit ec1cbdb2 authored by Laurent Montel's avatar Laurent Montel 😁

Fix generate name

parent 47b82096
......@@ -57,14 +57,17 @@ void AttachmentVcardFromAddressBookJob::doStart()
if (mItem.isValid()) {
if ( mItem.hasPayload<KABC::Addressee>() ) {
const KABC::Addressee contact = mItem.payload<KABC::Addressee>();
QString attachmentName = contact.realName() + QLatin1String( ".vcf" );
//Workaround about broken kaddressbook fields.
const QString contactRealName(contact.realName());
const QString attachmentName = (contactRealName.isEmpty() ? QLatin1String("vcard") : contactRealName ) + QLatin1String( ".vcf" );
QByteArray data = mItem.payloadData();
//Workaround about broken kaddressbook fields.
MessageComposer::Util::adaptVcard(data);
addAttachment( data, attachmentName );
} else if ( mItem.hasPayload<KABC::ContactGroup>() ) {
const KABC::ContactGroup group = mItem.payload<KABC::ContactGroup>();
QString attachmentName = group.name() + QLatin1String( ".vcf" );
const QString groupName(group.name());
const QString attachmentName = ( groupName.isEmpty() ? QLatin1String("vcard") : groupName ) + QLatin1String( ".vcf" );
Akonadi::ContactGroupExpandJob *expandJob = new Akonadi::ContactGroupExpandJob( group, this );
expandJob->setProperty("groupName", attachmentName);
connect( expandJob, SIGNAL(result(KJob*)), this, SLOT(slotExpandGroupResult(KJob*)) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment