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 e9a990b9 authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 385576: exporting organization contact to vcard 4 => name is _.vcf

FIXED-IN: 5.7.0
BUG: 385576
parent e029cd2a
......@@ -477,11 +477,27 @@ void VCardImportExportPluginInterface::exportVCard()
bool ok = true;
if (list.count() == 1) {
QFileDialog::Options options = QFileDialog::DontConfirmOverwrite;
url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(
QString(list[ 0 ].givenName()
+QLatin1Char(QLatin1Char('_'))
+list[ 0 ].familyName()
+QStringLiteral(".vcf"))),
QString filename;
const KContacts::Addressee addr = list.at(0);
if (!addr.givenName().isEmpty()) {
filename = addr.givenName();
}
if (!addr.familyName().isEmpty()) {
if (filename.isEmpty()) {
filename = addr.familyName();
} else {
filename += QLatin1Char('_') + addr.familyName();
}
}
if (filename.isEmpty()) {
if (!addr.emailList().isEmpty()) {
filename = addr.emailList().at(0).mail();
} else {
filename = QStringLiteral("contact");
}
}
filename += QStringLiteral(".vcf");
url = QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(filename),
QString(), nullptr, options);
if (url.isEmpty()) { // user canceled export
return;
......
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