Commit f5ebe5f0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent 630c8111
Pipeline #60360 passed with stage
in 39 minutes and 1 second
......@@ -22,7 +22,7 @@ AttachmentVcardFromAddressBookJobTest::~AttachmentVcardFromAddressBookJobTest()
void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithInvalidItem()
{
Akonadi::Item item;
MessageComposer::AttachmentVcardFromAddressBookJob *job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
auto job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
QVERIFY(!job->exec());
delete job;
job = nullptr;
......@@ -36,7 +36,7 @@ void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithValidItem()
const QString name = QStringLiteral("foo1");
address.setName(name);
item.setPayload<KContacts::Addressee>(address);
MessageComposer::AttachmentVcardFromAddressBookJob *job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
auto job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
QVERIFY(job->exec());
MessageCore::AttachmentPart::Ptr part = job->attachmentPart();
......@@ -55,7 +55,7 @@ void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithValidItem()
void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithInvalidVCard()
{
Akonadi::Item item(42);
MessageComposer::AttachmentVcardFromAddressBookJob *job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
auto job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
QVERIFY(!job->exec());
delete job;
job = nullptr;
......@@ -67,7 +67,7 @@ void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithEmptyVCard()
item.setMimeType(KContacts::Addressee::mimeType());
KContacts::Addressee address;
item.setPayload<KContacts::Addressee>(address);
MessageComposer::AttachmentVcardFromAddressBookJob *job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
auto job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
QVERIFY(!job->exec());
delete job;
job = nullptr;
......
......@@ -28,14 +28,14 @@ FollowupReminderSelectDateDialogTest::~FollowupReminderSelectDateDialogTest()
QStandardItemModel *FollowupReminderSelectDateDialogTest::defaultItemModel()
{
QStandardItemModel *model = new QStandardItemModel;
auto model = new QStandardItemModel;
for (int id = 42; id < 51; ++id) {
Akonadi::Collection collection(id);
collection.setRights(Akonadi::Collection::AllRights);
collection.setName(QString::number(id));
collection.setContentMimeTypes(QStringList() << KCalendarCore::Todo::todoMimeType());
QStandardItem *item = new QStandardItem(collection.name());
auto item = new QStandardItem(collection.name());
item->setData(QVariant::fromValue(collection), Akonadi::EntityTreeModel::CollectionRole);
item->setData(QVariant::fromValue(collection.id()), Akonadi::EntityTreeModel::CollectionIdRole);
......@@ -48,15 +48,15 @@ void FollowupReminderSelectDateDialogTest::shouldHaveDefaultValue()
{
auto model = defaultItemModel();
MessageComposer::FollowUpReminderSelectDateDialog dlg(nullptr, model);
KDateComboBox *datecombobox = dlg.findChild<KDateComboBox *>(QStringLiteral("datecombobox"));
auto datecombobox = dlg.findChild<KDateComboBox *>(QStringLiteral("datecombobox"));
QVERIFY(datecombobox);
Akonadi::CollectionComboBox *combobox = dlg.findChild<Akonadi::CollectionComboBox *>(QStringLiteral("collectioncombobox"));
auto combobox = dlg.findChild<Akonadi::CollectionComboBox *>(QStringLiteral("collectioncombobox"));
QVERIFY(combobox);
QDate currentDate = QDate::currentDate();
QCOMPARE(datecombobox->date(), currentDate.addDays(1));
QPushButton *okButton = dlg.findChild<QPushButton *>(QStringLiteral("ok_button"));
auto okButton = dlg.findChild<QPushButton *>(QStringLiteral("ok_button"));
QVERIFY(okButton);
QVERIFY(okButton->isEnabled());
delete model;
......@@ -66,9 +66,9 @@ void FollowupReminderSelectDateDialogTest::shouldDisableOkButtonIfDateIsEmpty()
{
auto model = defaultItemModel();
MessageComposer::FollowUpReminderSelectDateDialog dlg(nullptr, model);
KDateComboBox *datecombobox = dlg.findChild<KDateComboBox *>(QStringLiteral("datecombobox"));
auto datecombobox = dlg.findChild<KDateComboBox *>(QStringLiteral("datecombobox"));
QVERIFY(datecombobox);
QPushButton *okButton = dlg.findChild<QPushButton *>(QStringLiteral("ok_button"));
auto okButton = dlg.findChild<QPushButton *>(QStringLiteral("ok_button"));
QVERIFY(okButton->isEnabled());
datecombobox->lineEdit()->clear();
QVERIFY(!okButton->isEnabled());
......@@ -79,10 +79,10 @@ void FollowupReminderSelectDateDialogTest::shouldDisableOkButtonIfDateIsNotValid
{
auto model = defaultItemModel();
MessageComposer::FollowUpReminderSelectDateDialog dlg(nullptr, model);
KDateComboBox *datecombobox = dlg.findChild<KDateComboBox *>(QStringLiteral("datecombobox"));
auto datecombobox = dlg.findChild<KDateComboBox *>(QStringLiteral("datecombobox"));
QVERIFY(datecombobox);
datecombobox->lineEdit()->setText(QStringLiteral(" "));
QPushButton *okButton = dlg.findChild<QPushButton *>(QStringLiteral("ok_button"));
auto okButton = dlg.findChild<QPushButton *>(QStringLiteral("ok_button"));
QVERIFY(!okButton->isEnabled());
const QDate date = QDate::currentDate();
datecombobox->setDate(date);
......@@ -94,9 +94,9 @@ void FollowupReminderSelectDateDialogTest::shouldDisableOkButtonIfModelIsEmpty()
{
std::unique_ptr<QStandardItemModel> model(new QStandardItemModel(nullptr));
MessageComposer::FollowUpReminderSelectDateDialog dlg(nullptr, model.get());
KDateComboBox *datecombobox = dlg.findChild<KDateComboBox *>(QStringLiteral("datecombobox"));
auto datecombobox = dlg.findChild<KDateComboBox *>(QStringLiteral("datecombobox"));
QVERIFY(datecombobox);
QPushButton *okButton = dlg.findChild<QPushButton *>(QStringLiteral("ok_button"));
auto okButton = dlg.findChild<QPushButton *>(QStringLiteral("ok_button"));
QVERIFY(!okButton->isEnabled());
datecombobox->lineEdit()->setText(QStringLiteral(" "));
......
......@@ -189,7 +189,7 @@ void MessageFactoryTest::testCreateReplyToAllWithUseSenderAndIdentityInCCAsync()
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
......@@ -241,7 +241,7 @@ void MessageFactoryTest::testCreateReplyToAllWithUseSenderAsync()
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
QDateTime date = msg->date()->dateTime();
......@@ -290,7 +290,7 @@ void MessageFactoryTest::testCreateReplyToAllWithUseSenderByNoSameIdentitiesAsyn
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
QDateTime date = msg->date()->dateTime();
......@@ -332,7 +332,7 @@ void MessageFactoryTest::testCreateReplyToListAsync()
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
QDateTime date = msg->date()->dateTime();
......@@ -371,7 +371,7 @@ void MessageFactoryTest::testCreateReplyToAuthorAsync()
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
QDateTime date = msg->date()->dateTime();
......@@ -422,7 +422,7 @@ void MessageFactoryTest::testCreateReplyAllWithMultiEmailsAsync()
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
QDateTime date = msg->date()->dateTime();
......@@ -460,7 +460,7 @@ void MessageFactoryTest::testCreateReplyAllAsync()
factory.createReplyAsync();
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
QDateTime date = msg->date()->dateTime();
......@@ -491,7 +491,7 @@ void MessageFactoryTest::testCreateReplyHtmlAsync()
factory.createReplyAsync();
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
QDateTime date = msg->date()->dateTime().toLocalTime();
......@@ -537,7 +537,7 @@ void MessageFactoryTest::testCreateReplyUTF16Base64Async()
factory.createReplyAsync();
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
QDateTime date = msg->date()->dateTime().toLocalTime();
......@@ -561,7 +561,7 @@ void MessageFactoryTest::testCreateForwardMultiEmailsAsync()
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
KMime::Message::Ptr fw = spy.at(0).at(0).value<KMime::Message::Ptr>();
auto fw = spy.at(0).at(0).value<KMime::Message::Ptr>();
QDateTime date = msg->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime += QLatin1String(", ") + QLocale::system().toString(date.time(), QLocale::LongFormat);
......@@ -605,7 +605,7 @@ void MessageFactoryTest::testCreateForwardAsync()
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
KMime::Message::Ptr fw = spy.at(0).at(0).value<KMime::Message::Ptr>();
auto fw = spy.at(0).at(0).value<KMime::Message::Ptr>();
QDateTime date = msg->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
......@@ -967,7 +967,7 @@ void MessageFactoryTest::test_multipartAlternative()
factory.createReplyAsync();
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
MessageFactoryNG::MessageReply reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
auto reply = spy.at(0).at(0).value<MessageComposer::MessageFactoryNG::MessageReply>();
reply.replyAll = true;
QCOMPARE(reply.msg->contentType()->mimeType(), QByteArrayLiteral("multipart/alternative"));
QCOMPARE(reply.msg->subject()->asUnicodeString(), QLatin1String("Re: Plain Message Test"));
......
......@@ -669,7 +669,7 @@ void AttachmentControllerBase::slotOpenWithDialog()
void AttachmentControllerBase::slotOpenWithAction(QAction *act)
{
KService::Ptr app = act->data().value<KService::Ptr>();
auto app = act->data().value<KService::Ptr>();
Q_ASSERT(d->selectedParts.count() == 1);
openWith(app);
......
......@@ -331,7 +331,7 @@ void ComposerPrivate::contentJobFinished(KJob *job)
// taking into account secondary recipients for encryption
if (encData.size() > 1) { // crypto job with secondary recipients..
Q_ASSERT(dynamic_cast<MessageComposer::AbstractEncryptJob *>(job)); // we need to get the recipients for this job
auto *eJob = dynamic_cast<MessageComposer::AbstractEncryptJob *>(job);
auto eJob = dynamic_cast<MessageComposer::AbstractEncryptJob *>(job);
keys = eJob->encryptionKeys();
recipients = eJob->recipients();
......
......@@ -1408,7 +1408,7 @@ void ComposerViewBase::saveMessage(const KMime::Message::Ptr &message, MessageCo
void ComposerViewBase::slotSaveMessage(KJob *job)
{
Akonadi::Collection target;
Akonadi::Item item = job->property("Akonadi::Item").value<Akonadi::Item>();
auto item = job->property("Akonadi::Item").value<Akonadi::Item>();
if (job->error()) {
target = defaultSpecialTarget();
} else {
......
......@@ -276,7 +276,7 @@ static std::vector<GpgME::Key> trustedOrConfirmed(const std::vector<GpgME::Key>
std::vector<GpgME::Key> ickies;
std::vector<GpgME::Key> rewookies;
auto it = keys.begin();
const std::vector<GpgME::Key>::const_iterator end = keys.end();
const auto end = keys.end();
for (; it != end; ++it) {
const GpgME::Key &key = *it;
assert(ValidEncryptionKey(key));
......@@ -606,7 +606,7 @@ struct Q_DECL_HIDDEN Kleo::KeyResolver::Private {
std::map<CryptoMessageFormat, FormatInfo> mFormatInfoMap;
// key=email address, value=crypto preferences for this contact (from kabc)
typedef std::map<QString, ContactPreferences> ContactPreferencesMap;
using ContactPreferencesMap = std::map<QString, ContactPreferences>;
ContactPreferencesMap mContactPreferencesMap;
std::map<QByteArray, QString> mAutocryptMap;
};
......@@ -895,14 +895,14 @@ Kleo::Result Kleo::KeyResolver::setEncryptToSelfKeys(const QStringList &fingerpr
// check for near-expiry:
std::vector<GpgME::Key>::const_iterator end(d->mOpenPGPEncryptToSelfKeys.end());
for (std::vector<GpgME::Key>::const_iterator it = d->mOpenPGPEncryptToSelfKeys.begin(); it != end; ++it) {
for (auto it = d->mOpenPGPEncryptToSelfKeys.begin(); it != end; ++it) {
const Kleo::Result r = checkKeyNearExpiry(*it, "own encryption key expires soon warning", true, false);
if (r != Kleo::Ok) {
return r;
}
}
std::vector<GpgME::Key>::const_iterator end2(d->mSMIMEEncryptToSelfKeys.end());
for (std::vector<GpgME::Key>::const_iterator it = d->mSMIMEEncryptToSelfKeys.begin(); it != end2; ++it) {
for (auto it = d->mSMIMEEncryptToSelfKeys.begin(); it != end2; ++it) {
const Kleo::Result r = checkKeyNearExpiry(*it, "own encryption key expires soon warning", true, false);
if (r != Kleo::Ok) {
return r;
......@@ -942,14 +942,14 @@ Kleo::Result Kleo::KeyResolver::setSigningKeys(const QStringList &fingerprints)
// check for near expiry:
for (std::vector<GpgME::Key>::const_iterator it = d->mOpenPGPSigningKeys.begin(), total = d->mOpenPGPSigningKeys.end(); it != total; ++it) {
for (auto it = d->mOpenPGPSigningKeys.begin(), total = d->mOpenPGPSigningKeys.end(); it != total; ++it) {
const Kleo::Result r = checkKeyNearExpiry(*it, "signing key expires soon warning", true, true);
if (r != Kleo::Ok) {
return r;
}
}
for (std::vector<GpgME::Key>::const_iterator it = d->mSMIMESigningKeys.begin(), total = d->mSMIMESigningKeys.end(); it != total; ++it) {
for (auto it = d->mSMIMESigningKeys.begin(), total = d->mSMIMESigningKeys.end(); it != total; ++it) {
const Kleo::Result r = checkKeyNearExpiry(*it, "signing key expires soon warning", true, true);
if (r != Kleo::Ok) {
return r;
......@@ -1444,7 +1444,7 @@ void Kleo::KeyResolver::collapseAllSplitInfos()
continue;
}
SplitInfo &si = v.front();
for (std::vector<SplitInfo>::const_iterator it = v.begin() + 1; it != v.end(); ++it) {
for (auto it = v.begin() + 1; it != v.end(); ++it) {
si.keys.insert(si.keys.end(), it->keys.begin(), it->keys.end());
std::copy(it->recipients.begin(), it->recipients.end(), std::back_inserter(si.recipients));
}
......@@ -1481,7 +1481,7 @@ void Kleo::KeyResolver::dump() const
if (d->mFormatInfoMap.empty()) {
qCDebug(MESSAGECOMPOSER_LOG) << "Keyresolver: Format info empty";
}
for (std::map<CryptoMessageFormat, FormatInfo>::const_iterator it = d->mFormatInfoMap.begin(); it != d->mFormatInfoMap.end(); ++it) {
for (auto it = d->mFormatInfoMap.begin(); it != d->mFormatInfoMap.end(); ++it) {
qCDebug(MESSAGECOMPOSER_LOG) << "Format info for " << Kleo::cryptoMessageFormatToString(it->first) << ": Signing keys: ";
for (auto sit = it->second.signKeys.begin(); sit != it->second.signKeys.end(); ++sit) {
qCDebug(MESSAGECOMPOSER_LOG) << " " << sit->shortKeyID() << " ";
......@@ -1631,7 +1631,7 @@ Kleo::Result Kleo::KeyResolver::showKeyApprovalDialog(bool &finalySendUnencrypte
std::vector<Kleo::KeyResolver::SplitInfo> Kleo::KeyResolver::encryptionItems(Kleo::CryptoMessageFormat f) const
{
dump();
std::map<CryptoMessageFormat, FormatInfo>::const_iterator it = d->mFormatInfoMap.find(f);
auto it = d->mFormatInfoMap.find(f);
return it != d->mFormatInfoMap.end() ? it->second.splitInfos : std::vector<SplitInfo>();
}
......@@ -1648,7 +1648,7 @@ std::map<QByteArray, QString> Kleo::KeyResolver::useAutocrypt() const
std::vector<GpgME::Key> Kleo::KeyResolver::signingKeys(CryptoMessageFormat f) const
{
dump();
std::map<CryptoMessageFormat, FormatInfo>::const_iterator it = d->mFormatInfoMap.find(f);
auto it = d->mFormatInfoMap.find(f);
return it != d->mFormatInfoMap.end() ? it->second.signKeys : std::vector<GpgME::Key>();
}
......@@ -1875,12 +1875,12 @@ void Kleo::KeyResolver::addKeys(const std::vector<Item> &items)
Kleo::KeyResolver::ContactPreferences Kleo::KeyResolver::lookupContactPreferences(const QString &address) const
{
const Private::ContactPreferencesMap::iterator it = d->mContactPreferencesMap.find(address);
const auto it = d->mContactPreferencesMap.find(address);
if (it != d->mContactPreferencesMap.end()) {
return it->second;
}
Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
auto job = new Akonadi::ContactSearchJob();
job->setLimit(1);
job->setQuery(Akonadi::ContactSearchJob::Email, address);
job->exec();
......
......@@ -53,7 +53,7 @@ void AttachmentVcardFromAddressBookJob::doStart()
{
if (d->mItem.isValid()) {
if (d->mItem.hasPayload<KContacts::Addressee>()) {
const KContacts::Addressee contact = d->mItem.payload<KContacts::Addressee>();
const auto contact = d->mItem.payload<KContacts::Addressee>();
if (contact.isEmpty()) {
invalidContact();
} else {
......@@ -66,7 +66,7 @@ void AttachmentVcardFromAddressBookJob::doStart()
addAttachment(data, attachmentName);
}
} else if (d->mItem.hasPayload<KContacts::ContactGroup>()) {
const KContacts::ContactGroup group = d->mItem.payload<KContacts::ContactGroup>();
const auto group = d->mItem.payload<KContacts::ContactGroup>();
const QString groupName(group.name());
const QString attachmentName = (groupName.isEmpty() ? QStringLiteral("vcard") : groupName) + QLatin1String(".vcf");
auto expandJob = new Akonadi::ContactGroupExpandJob(group, this);
......
......@@ -26,7 +26,7 @@ class MESSAGECOMPOSER_EXPORT JobBase : public KCompositeJob
Q_OBJECT
public:
typedef QList<JobBase *> List;
using List = QList<JobBase *>;
enum Error { BugError = UserDefinedError + 1, IncompleteError, UserCancelledError, UserError = UserDefinedError + 42 };
......
......@@ -86,7 +86,7 @@ void SaveContactPreferenceJob::slotSearchContact(KJob *job)
} else {
Akonadi::Item item = items.first();
KContacts::Addressee contact = item.payload<KContacts::Addressee>();
auto contact = item.payload<KContacts::Addressee>();
writeCustomContactProperties(contact, mPref);
item.setPayload<KContacts::Addressee>(contact);
......
......@@ -196,7 +196,7 @@ void DistributionListDialog::slotDelayedSetRecipients(KJob *job)
bool isFirst = true;
for (const Akonadi::Item &akItem : qAsConst(akItems)) {
if (akItem.hasPayload<KContacts::Addressee>()) {
const KContacts::Addressee contact = akItem.payload<KContacts::Addressee>();
const auto contact = akItem.payload<KContacts::Addressee>();
auto item = new DistributionListItem(mRecipientsList);
item->setAddressee(contact, email);
......
......@@ -27,8 +27,8 @@ class RecipientPrivate;
class MESSAGECOMPOSER_EXPORT Recipient : public KPIM::MultiplyingLineData
{
public:
typedef QSharedPointer<Recipient> Ptr;
typedef QVector<Recipient::Ptr> List;
using Ptr = QSharedPointer<Recipient>;
using List = QVector<Recipient::Ptr>;
enum Type { To, Cc, Bcc, ReplyTo, Undefined };
......
......@@ -60,7 +60,7 @@ RecipientsPicker *RecipientsEditorSideWidget::picker() const
{
if (!mRecipientPicker) {
// hacks to allow picker() to be const in the presence of lazy loading
auto *non_const_this = const_cast<RecipientsEditorSideWidget *>(this);
auto non_const_this = const_cast<RecipientsEditorSideWidget *>(this);
mRecipientPicker = new RecipientsPicker(non_const_this);
connect(mRecipientPicker, &RecipientsPicker::pickedRecipient, non_const_this, &RecipientsEditorSideWidget::pickedRecipient);
mPickerPositioner = new KWindowPositioner(mSelectButton, mRecipientPicker);
......
......@@ -49,7 +49,7 @@ void AttachmentFromMimeContentJob::doStart()
Q_ASSERT(attachmentPart() == nullptr);
AttachmentPart::Ptr part = AttachmentPart::Ptr(new AttachmentPart);
auto *content = const_cast<Content *>(d->mMimeContent);
auto content = const_cast<Content *>(d->mMimeContent);
part->setData(content->decodedContent());
// Get the details from the MIME headers.
......
......@@ -28,12 +28,12 @@ public:
/**
* Defines a pointer to an attachment object.
*/
typedef QSharedPointer<AttachmentPart> Ptr;
using Ptr = QSharedPointer<AttachmentPart>;
/**
* Defines a list of pointers to attachment objects.
*/
typedef QList<Ptr> List;
using List = QList<Ptr>;
/**
* Creates a new attachment part.
......
......@@ -23,7 +23,7 @@ class HeaderMixupNodeHelper;
class MESSAGECORE_EXPORT AutocryptRecipient
{
public:
typedef QSharedPointer<AutocryptRecipient> Ptr;
using Ptr = QSharedPointer<AutocryptRecipient>;
AutocryptRecipient();
void updateFromMessage(const HeaderMixupNodeHelper &mixup, const KMime::Headers::Base *header);
void updateFromGossip(const HeaderMixupNodeHelper &mixup, const KMime::Headers::Base *header);
......
......@@ -22,7 +22,7 @@ class AutocryptStoragePrivate;
class MESSAGECORE_EXPORT AutocryptStorage
{
public:
typedef QSharedPointer<AutocryptStorage> Ptr;
using Ptr = QSharedPointer<AutocryptStorage>;
static AutocryptStorage::Ptr self();
AutocryptRecipient::Ptr getRecipient(const QByteArray &addr);
......
......@@ -15,7 +15,7 @@
using namespace MessageCore;
typedef QString (*MagicDetectorFunc)(const KMime::Message::Ptr &, QByteArray &, QString &);
using MagicDetectorFunc = QString (*)(const KMime::Message::Ptr &, QByteArray &, QString &);
/* Sender: (owner-([^@]+)|([^@+]-owner)@ */
static QString check_sender(const KMime::Message::Ptr &message, QByteArray &headerName, QString &headerValue)
......
......@@ -17,7 +17,7 @@ namespace KMime
namespace Types
{
struct Address;
typedef QVector<Address> AddressList;
using AddressList = QVector<Address>;
class Mailbox;
}
namespace Headers
......
......@@ -47,7 +47,7 @@ void MessageItemSetManager::removeSet(MessageItemSetReference ref)
QList<MessageItem *> MessageItemSetManager::messageItems(MessageItemSetReference ref)
{
auto *set = mSets->value(static_cast<ulong>(ref), nullptr);
auto set = mSets->value(static_cast<ulong>(ref), nullptr);
if (!set) {
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