Commit 9d4bfe5b authored by Laurent Montel's avatar Laurent Montel 😁

Use the same name as filename and name. It's more logical as discussed with David

parent 9bc96e42
......@@ -76,10 +76,12 @@ void AttachmentUpdateJobTest::shouldHaveSameNameDescriptionAfterUpdate()
QByteArray data("This is short enough that compressing it is not efficient.");
const QString name = QString::fromLatin1("name.txt");
const QString description = QString::fromLatin1("description");
const QString filename = QString::fromLatin1("filename");
// Create the original part.
MessageCore::AttachmentPart::Ptr origPart = MessageCore::AttachmentPart::Ptr(new MessageCore::AttachmentPart);
origPart->setName(name);
origPart->setFileName(filename);
origPart->setDescription(description);
origPart->setMimeType("text/plain");
origPart->setEncoding(KMime::Headers::CE7Bit);
......@@ -91,6 +93,7 @@ void AttachmentUpdateJobTest::shouldHaveSameNameDescriptionAfterUpdate()
VERIFYEXEC(job);
QCOMPARE(origPart->name(), job->updatedPart()->name());
QCOMPARE(origPart->description(), job->updatedPart()->description());
QCOMPARE(origPart->fileName(), job->updatedPart()->fileName());
}
......
......@@ -301,8 +301,9 @@ void AttachmentPropertiesDialog::Private::saveToPart()
return;
}
mPart->setMimeType(ui->mimeType->currentText().toLatin1());
mPart->setName(removeNewlines(ui->name->text()));
// TODO what about fileName? Extra field??
const QString name = removeNewlines(ui->name->text());
mPart->setName(name);
mPart->setFileName(name);
mPart->setDescription(removeNewlines(ui->description->text()));
mPart->setInline(ui->autoDisplay->isChecked());
mPart->setSigned(ui->sign->isChecked());
......
......@@ -75,6 +75,7 @@ void AttachmentUpdateJob::Private::loadJobResult(KJob *job)
AttachmentLoadJob *ajob = static_cast<AttachmentLoadJob *>(job);
mUpdatedPart = ajob->attachmentPart();
mUpdatedPart->setName(q->originalPart()->name());
mUpdatedPart->setFileName(q->originalPart()->fileName());
mUpdatedPart->setDescription(q->originalPart()->description());
mUpdatedPart->setSigned(q->originalPart()->isSigned());
mUpdatedPart->setEncrypted(q->originalPart()->isEncrypted());
......
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