Commit 78aecb44 authored by Laurent Montel's avatar Laurent Montel 😁

GIT_SILENT: use nullptr now

parent 8d32eb95
......@@ -61,7 +61,7 @@ void AttachmentJobTest::testAttachment()
QVERIFY(ajob->exec());
Content *result = ajob->content();
delete ajob;
ajob = Q_NULLPTR;
ajob = nullptr;
result->assemble();
qDebug() << result->encodedContent();
......
......@@ -40,7 +40,7 @@ void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithInvalidItem()
MessageComposer::AttachmentVcardFromAddressBookJob *job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
QVERIFY(!job->exec());
delete job;
job = Q_NULLPTR;
job = nullptr;
}
void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithValidItem()
......@@ -56,7 +56,7 @@ void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithValidItem()
MessageCore::AttachmentPart::Ptr part = job->attachmentPart();
delete job;
job = Q_NULLPTR;
job = nullptr;
QVERIFY(!part->data().isEmpty());
QCOMPARE(part->mimeType(), QByteArray("text/x-vcard"));
......@@ -73,7 +73,7 @@ void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithInvalidVCard(
MessageComposer::AttachmentVcardFromAddressBookJob *job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
QVERIFY(!job->exec());
delete job;
job = Q_NULLPTR;
job = nullptr;
}
void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithEmptyVCard()
......@@ -85,7 +85,7 @@ void AttachmentVcardFromAddressBookJobTest::testAttachmentVCardWithEmptyVCard()
MessageComposer::AttachmentVcardFromAddressBookJob *job = new MessageComposer::AttachmentVcardFromAddressBookJob(item);
QVERIFY(!job->exec());
delete job;
job = Q_NULLPTR;
job = nullptr;
}
QTEST_MAIN(AttachmentVcardFromAddressBookJobTest)
......@@ -27,7 +27,7 @@ class AttachmentVcardFromAddressBookJobTest : public QObject
{
Q_OBJECT
public:
explicit AttachmentVcardFromAddressBookJobTest(QObject *parent = Q_NULLPTR);
explicit AttachmentVcardFromAddressBookJobTest(QObject *parent = nullptr);
~AttachmentVcardFromAddressBookJobTest();
private Q_SLOTS:
void testAttachmentVCardWithInvalidItem();
......
......@@ -52,7 +52,7 @@ void ComposerTest::testAttachments()
QCOMPARE(composer->resultMessages().size(), 1);
KMime::Message::Ptr message = composer->resultMessages().constFirst();
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
// multipart/mixed
{
......@@ -90,7 +90,7 @@ void ComposerTest::testAutoSave()
QVERIFY(composer->finished());
QCOMPARE(composer->resultMessages().size(), 1);
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
}
......@@ -133,7 +133,7 @@ void ComposerTest::testNonAsciiHeaders()
QCOMPARE(message->bcc()->displayNames().constFirst(), bccDisplayName);
QCOMPARE(message->replyTo()->displayNames().constFirst(), replyToDisplayName);
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
}
void ComposerTest::testBug271192()
......@@ -149,7 +149,7 @@ void ComposerTest::testBug271192()
QCOMPARE(message->to()->displayNames().size(), 1);
QCOMPARE(message->to()->displayNames().first().toUtf8(), displayName.toUtf8());
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
}
void ComposerTest::fillComposerData(Composer *composer)
......
......@@ -24,7 +24,7 @@ class ComposerViewBaseTest : public QObject
{
Q_OBJECT
public:
explicit ComposerViewBaseTest(QObject *parent = Q_NULLPTR);
explicit ComposerViewBaseTest(QObject *parent = nullptr);
~ComposerViewBaseTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
......
......@@ -100,7 +100,7 @@ void CryptoComposerTest::testOpenPGPMime()
KMime::Message::Ptr message = composer->resultMessages().first();
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
//qDebug()<< "message:" << message.data()->encodedContent();
ComposerTestUtil::verify(sign, encrypt, message.data(), data.toUtf8(),
......@@ -144,7 +144,7 @@ void CryptoComposerTest::testEncryptSameAttachments()
KMime::Message::Ptr message = composer->resultMessages().first();
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
//qDebug()<< "message:" << message.data()->encodedContent();
ComposerTestUtil::verifyEncryption(message.data(), data.toUtf8(),
......@@ -204,7 +204,7 @@ void CryptoComposerTest::testEditEncryptAttachments()
KMime::Message::Ptr message = composer->resultMessages().first();
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
// setup a viewer
ComposerViewBase view(this, nullptr);
......@@ -270,7 +270,7 @@ void CryptoComposerTest::testEditEncryptAndLateAttachments()
KMime::Message::Ptr message = composer->resultMessages().first();
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
// setup a viewer
ComposerViewBase view(this, nullptr);
......@@ -327,7 +327,7 @@ void CryptoComposerTest::testSignEncryptLateAttachments()
KMime::Message::Ptr message = composer->resultMessages().first();
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
// as we have an additional attachment, just ignore it when checking for sign/encrypt
KMime::Content *b = MessageCore::NodeHelper::firstChild(message.data());
......@@ -388,7 +388,7 @@ void CryptoComposerTest::testBCCEncrypt()
KMime::Message::Ptr primMessage = composer->resultMessages().first();
KMime::Message::Ptr secMessage = composer->resultMessages()[1];
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
ComposerTestUtil::verifySignatureAndEncryption(primMessage.data(), data.toUtf8(),
(Kleo::CryptoMessageFormat) format);
......@@ -438,7 +438,7 @@ void CryptoComposerTest::testOpenPGPInline()
KMime::Message::Ptr message = composer->resultMessages().first();
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
if (sign && !encrypt) {
data += QString::fromLatin1("\n");
......@@ -602,7 +602,7 @@ void CryptoComposerTest::runSMIMETest(bool sign, bool enc, bool opaque)
QCOMPARE(composer->resultMessages().size(), 1);
KMime::Message::Ptr message = composer->resultMessages().first();
delete composer;
composer = Q_NULLPTR;
composer = nullptr;
//qDebug() << "message:" << message->encodedContent();
......
......@@ -27,7 +27,7 @@ class FollowupReminderSelectDateDialogTest : public QObject
{
Q_OBJECT
public:
explicit FollowupReminderSelectDateDialogTest(QObject *parent = Q_NULLPTR);
explicit FollowupReminderSelectDateDialogTest(QObject *parent = nullptr);
~FollowupReminderSelectDateDialogTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
......
......@@ -25,7 +25,7 @@ class GlobalPartTest : public QObject
{
Q_OBJECT
public:
explicit GlobalPartTest(QObject *parent = Q_NULLPTR);
explicit GlobalPartTest(QObject *parent = nullptr);
~GlobalPartTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
......
......@@ -26,7 +26,7 @@ class InfoPartTest : public QObject
{
Q_OBJECT
public:
explicit InfoPartTest(QObject *parent = Q_NULLPTR);
explicit InfoPartTest(QObject *parent = nullptr);
~InfoPartTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
......
......@@ -129,7 +129,7 @@ QTEST_MAIN(MessageFactoryTest)
void MessageFactoryTest::cleanupTestCase()
{
delete mIdentMan;
mIdentMan = Q_NULLPTR;
mIdentMan = nullptr;
QDir dir(QDir::homePath() + QStringLiteral("/.qttest/"));
dir.removeRecursively();
}
......
......@@ -26,7 +26,7 @@ class PluginEditorCheckBeforeSendParamsTest : public QObject
{
Q_OBJECT
public:
explicit PluginEditorCheckBeforeSendParamsTest(QObject *parent = Q_NULLPTR);
explicit PluginEditorCheckBeforeSendParamsTest(QObject *parent = nullptr);
~PluginEditorCheckBeforeSendParamsTest();
private Q_SLOTS:
......
......@@ -32,7 +32,7 @@ class RecipientsLineTestFactory : public MessageComposer::RecipientLineFactory
Q_OBJECT
public:
explicit RecipientsLineTestFactory(QObject *parent = Q_NULLPTR)
explicit RecipientsLineTestFactory(QObject *parent = nullptr)
: MessageComposer::RecipientLineFactory(parent)
{
}
......
......@@ -43,8 +43,8 @@ void SinglepartJobTest::testContent()
result->assemble();
qDebug() << result->encodedContent();
QCOMPARE(result->body(), data);
QVERIFY(result->contentDisposition(false) == Q_NULLPTR); // Not created unless demanded.
QVERIFY(result->contentType(false) == Q_NULLPTR); // Not created unless demanded.
QVERIFY(result->contentDisposition(false) == nullptr); // Not created unless demanded.
QVERIFY(result->contentType(false) == nullptr); // Not created unless demanded.
QVERIFY(result->contentTransferEncoding(false)); // KMime gives it a default one (7bit).
}
......
......@@ -27,7 +27,7 @@
class TestCSSHelper : public MessageViewer::CSSHelper
{
public:
TestCSSHelper() : MessageViewer::CSSHelper(Q_NULLPTR) {}
TestCSSHelper() : MessageViewer::CSSHelper(nullptr) {}
virtual ~TestCSSHelper() {}
QString nonQuotedFontTag() const
......
......@@ -25,7 +25,7 @@ class TextPartTest : public QObject
{
Q_OBJECT
public:
explicit TextPartTest(QObject *parent = Q_NULLPTR);
explicit TextPartTest(QObject *parent = nullptr);
~TextPartTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
......
......@@ -144,29 +144,29 @@ AttachmentControllerBase::Private::Private(AttachmentControllerBase *qq)
: q(qq)
, encryptEnabled(false)
, signEnabled(false)
, model(Q_NULLPTR)
, wParent(Q_NULLPTR)
, mActionCollection(Q_NULLPTR)
, attachPublicKeyAction(Q_NULLPTR)
, attachMyPublicKeyAction(Q_NULLPTR)
, openContextAction(Q_NULLPTR)
, viewContextAction(Q_NULLPTR)
, editContextAction(Q_NULLPTR)
, editWithContextAction(Q_NULLPTR)
, removeAction(Q_NULLPTR)
, removeContextAction(Q_NULLPTR)
, saveAsAction(Q_NULLPTR)
, saveAsContextAction(Q_NULLPTR)
, propertiesAction(Q_NULLPTR)
, propertiesContextAction(Q_NULLPTR)
, addAttachmentFileAction(Q_NULLPTR)
, addAttachmentDirectoryAction(Q_NULLPTR)
, addContextAction(Q_NULLPTR)
, selectAllAction(Q_NULLPTR)
, attachmentMenu(Q_NULLPTR)
, addOwnVcardAction(Q_NULLPTR)
, reloadAttachmentAction(Q_NULLPTR)
, attachVCardsAction(Q_NULLPTR)
, model(nullptr)
, wParent(nullptr)
, mActionCollection(nullptr)
, attachPublicKeyAction(nullptr)
, attachMyPublicKeyAction(nullptr)
, openContextAction(nullptr)
, viewContextAction(nullptr)
, editContextAction(nullptr)
, editWithContextAction(nullptr)
, removeAction(nullptr)
, removeContextAction(nullptr)
, saveAsAction(nullptr)
, saveAsContextAction(nullptr)
, propertiesAction(nullptr)
, propertiesContextAction(nullptr)
, addAttachmentFileAction(nullptr)
, addAttachmentDirectoryAction(nullptr)
, addContextAction(nullptr)
, selectAllAction(nullptr)
, attachmentMenu(nullptr)
, addOwnVcardAction(nullptr)
, reloadAttachmentAction(nullptr)
, attachVCardsAction(nullptr)
{
}
......@@ -434,12 +434,12 @@ static QTemporaryFile *dumpAttachmentToTempFile(const AttachmentPart::Ptr part)
if (!file->open()) {
qCCritical(MESSAGECOMPOSER_LOG) << "Could not open tempfile" << file->fileName();
delete file;
return Q_NULLPTR;
return nullptr;
}
if (file->write(part->data()) == -1) {
qCCritical(MESSAGECOMPOSER_LOG) << "Could not dump attachment to tempfile.";
delete file;
return Q_NULLPTR;
return nullptr;
}
file->flush();
return file;
......@@ -696,7 +696,7 @@ void AttachmentControllerBase::openWith(const KService::Ptr &offer)
}
if (!result) {
delete tempFile;
tempFile = Q_NULLPTR;
tempFile = nullptr;
} else {
// The file was opened. Delete it only when the composer is closed
// (and this object is destroyed).
......@@ -729,7 +729,7 @@ void AttachmentControllerBase::openAttachment(AttachmentPart::Ptr part)
i18n("Unable to open attachment"));
}
delete tempFile;
tempFile = Q_NULLPTR;
tempFile = nullptr;
} else {
// The file was opened. Delete it only when the composer is closed
// (and this object is destroyed).
......@@ -833,7 +833,7 @@ void AttachmentControllerBase::slotPutResult(KJob *job)
if (job->error()) {
if (job->error() == KIO::ERR_FILE_ALREADY_EXIST) {
if (KMessageBox::warningContinueCancel(Q_NULLPTR,
if (KMessageBox::warningContinueCancel(nullptr,
i18n("File %1 exists.\nDo you want to replace it?", _job->url().toLocalFile()), i18n("Save to File"), KGuiItem(i18n("&Replace")))
== KMessageBox::Continue) {
byteArrayToRemoteFile(_job->data(), _job->url(), true);
......
......@@ -26,7 +26,7 @@ class RichTextComposerNgTest : public QObject
{
Q_OBJECT
public:
explicit RichTextComposerNgTest(QObject *parent = Q_NULLPTR);
explicit RichTextComposerNgTest(QObject *parent = nullptr);
~RichTextComposerNgTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
......
......@@ -36,7 +36,7 @@ class MessageComposer::RichTextComposerNgPrivate
{
public:
RichTextComposerNgPrivate(RichTextComposerNg *q)
: autoCorrection(Q_NULLPTR),
: autoCorrection(nullptr),
richtextComposer(q)
{
richTextComposerSignatures = new MessageComposer::RichTextComposerSignatures(richtextComposer, richtextComposer);
......
......@@ -54,11 +54,11 @@ public:
, encrypt(false)
, noCrypto(false)
, autoSaving(false)
, globalPart(Q_NULLPTR)
, infoPart(Q_NULLPTR)
, textPart(Q_NULLPTR)
, skeletonMessage(Q_NULLPTR)
, resultContent(Q_NULLPTR)
, globalPart(nullptr)
, infoPart(nullptr)
, textPart(nullptr)
, skeletonMessage(nullptr)
, resultContent(nullptr)
{
}
......@@ -152,7 +152,7 @@ void ComposerPrivate::composeStep2()
{
Q_Q(Composer);
ContentJobBase *mainJob = Q_NULLPTR;
ContentJobBase *mainJob = nullptr;
MainTextJob *mainTextJob = new MainTextJob(textPart, q);
if ((sign || encrypt) && format & Kleo::InlineOpenPGPFormat) { // needs custom handling --- one SignEncryptJob by itself
......@@ -278,7 +278,7 @@ QList<ContentJobBase *> ComposerPrivate::createEncryptJobs(ContentJobBase *conte
for (int i = 0; i < encDataSize; ++i) {
QPair<QStringList, std::vector<GpgME::Key> > recipients = encData[ i ];
qCDebug(MESSAGECOMPOSER_LOG) << "got first list of recipients:" << recipients.first;
ContentJobBase *subJob = Q_NULLPTR;
ContentJobBase *subJob = nullptr;
if (sign) {
SignEncryptJob *seJob = new SignEncryptJob(q);
......@@ -385,7 +385,7 @@ void ComposerPrivate::composeWithLateAttachments(KMime::Message *headers, KMime:
if (attachment->isSigned()) {
qCDebug(MESSAGECOMPOSER_LOG) << "adding signjob for late attachment";
SignJob *sJob = new SignJob(q);
sJob->setContent(Q_NULLPTR);
sJob->setContent(nullptr);
sJob->setCryptoMessageFormat(format);
sJob->setSigningKeys(signers);
......
......@@ -99,16 +99,16 @@ static QStringList encodeIdn(const QStringList &emails)
MessageComposer::ComposerViewBase::ComposerViewBase(QObject *parent, QWidget *parentGui)
: QObject(parent)
, m_msg(KMime::Message::Ptr(new KMime::Message))
, m_attachmentController(Q_NULLPTR)
, m_attachmentModel(Q_NULLPTR)
, m_signatureController(Q_NULLPTR)
, m_recipientsEditor(Q_NULLPTR)
, m_identityCombo(Q_NULLPTR)
, m_identMan(Q_NULLPTR)
, m_editor(Q_NULLPTR)
, m_transport(Q_NULLPTR)
, m_dictionary(Q_NULLPTR)
, m_fccCombo(Q_NULLPTR)
, m_attachmentController(nullptr)
, m_attachmentModel(nullptr)
, m_signatureController(nullptr)
, m_recipientsEditor(nullptr)
, m_identityCombo(nullptr)
, m_identMan(nullptr)
, m_editor(nullptr)
, m_transport(nullptr)
, m_dictionary(nullptr)
, m_fccCombo(nullptr)
, m_parentWidget(parentGui)
, m_sign(false)
, m_encrypt(false)
......@@ -117,10 +117,10 @@ MessageComposer::ComposerViewBase::ComposerViewBase(QObject *parent, QWidget *pa
, m_urgent(false)
, m_cryptoMessageFormat(Kleo::AutoFormat)
, m_pendingQueueJobs(0)
, m_autoSaveTimer(Q_NULLPTR)
, m_autoSaveTimer(nullptr)
, m_autoSaveErrorShown(false)
, m_autoSaveInterval(1 * 1000 * 60) // default of 1 min
, mSendLaterInfo(Q_NULLPTR)
, mSendLaterInfo(nullptr)
{
m_charsets << "utf-8"; // default, so we have a backup in case client code forgot to set.
......@@ -1063,7 +1063,7 @@ void MessageComposer::ComposerViewBase::updateAutoSave()
{
if (m_autoSaveInterval == 0) {
delete m_autoSaveTimer;
m_autoSaveTimer = Q_NULLPTR;
m_autoSaveTimer = nullptr;
} else {
if (!m_autoSaveTimer) {
m_autoSaveTimer = new QTimer(this);
......@@ -1082,7 +1082,7 @@ void MessageComposer::ComposerViewBase::updateAutoSave()
void MessageComposer::ComposerViewBase::cleanupAutoSave()
{
delete m_autoSaveTimer;
m_autoSaveTimer = Q_NULLPTR;
m_autoSaveTimer = nullptr;
if (!m_autoSaveUUID.isEmpty()) {
qCDebug(MESSAGECOMPOSER_LOG) << "deleting autosave files" << m_autoSaveUUID;
......@@ -1300,7 +1300,7 @@ void MessageComposer::ComposerViewBase::slotCreateItemResult(KJob *job)
mSendLaterInfo->setItemId(item.id());
SendLater::SendLaterUtil::writeSendLaterInfo(SendLater::SendLaterUtil::defaultConfig(), mSendLaterInfo);
delete mSendLaterInfo;
mSendLaterInfo = Q_NULLPTR;
mSendLaterInfo = nullptr;
}
}
......
......@@ -378,7 +378,7 @@ static std::vector<GpgME::Key> trustedOrConfirmed(const std::vector<GpgME::Key>
msg += keysAsStrings(rewookies).join(QLatin1Char(','));
}
if (KMessageBox::warningContinueCancel(Q_NULLPTR, msg, i18n("Not Fully Trusted Encryption Keys"),
if (KMessageBox::warningContinueCancel(nullptr, msg, i18n("Not Fully Trusted Encryption Keys"),
KStandardGuiItem::cont(), KStandardGuiItem::cancel(),
QStringLiteral("not fully trusted encryption key warning"))
== KMessageBox::Continue) {
......@@ -676,7 +676,7 @@ Kleo::KeyResolver::KeyResolver(bool encToSelf, bool showApproval, bool oppEncryp
Kleo::KeyResolver::~KeyResolver()
{
delete d; d = Q_NULLPTR;
delete d; d = nullptr;
}
Kleo::Result Kleo::KeyResolver::checkKeyNearExpiry(const GpgME::Key &key, const char *dontAskAgainName,
......@@ -696,7 +696,7 @@ Kleo::Result Kleo::KeyResolver::checkKeyNearExpiry(const GpgME::Key &key, const
return Kleo::Ok;
}
static const double secsPerDay = 24 * 60 * 60;
const double secsTillExpiry = ::difftime(subkey.expirationTime(), time(Q_NULLPTR));
const double secsTillExpiry = ::difftime(subkey.expirationTime(), time(nullptr));
if (secsTillExpiry <= 0) {
const int daysSinceExpiry = 1 + int(-secsTillExpiry / secsPerDay);
qCDebug(MESSAGECOMPOSER_LOG) << "Key 0x" << key.shortKeyID() << " expired less than "
......@@ -783,7 +783,7 @@ Kleo::Result Kleo::KeyResolver::checkKeyNearExpiry(const GpgME::Key &key, const
.subs(QString::fromLatin1(key.issuerSerial()))
.toString());
d->alreadyWarnedFingerprints.insert(subkey.fingerprint());
if (KMessageBox::warningContinueCancel(Q_NULLPTR, msg,
if (KMessageBox::warningContinueCancel(nullptr, msg,