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

Fix error found by cppcheck

parent 52f8060e
......@@ -643,13 +643,10 @@ void MessageFactoryTest::testCreateRedirectToAndCCAndBCC()
QString redirectBcc = QStringLiteral("redirbcc@redirbcc.com, redirbcc2@redirbcc.com");
KMime::Message::Ptr rdir = factory.createRedirect(redirectTo, redirectCc, redirectBcc);
QDateTime date = rdir->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime = rdir->date()->asUnicodeString();
QString datetime = rdir->date()->asUnicodeString();
// qDebug() << rdir->encodedContent();
QString msgId = MessageCore::StringUtil::generateMessageId(msg->sender()->asUnicodeString(), QString());
QRegExp rx(QString::fromLatin1("Resent-Message-ID: ([^\n]*)"));
rx.indexIn(QString::fromLatin1(rdir->head()));
......@@ -699,9 +696,7 @@ void MessageFactoryTest::testCreateRedirectToAndCC()
QString redirectCc = QStringLiteral("redircc@redircc.com, redircc2@redircc.com");
KMime::Message::Ptr rdir = factory.createRedirect(redirectTo, redirectCc);
QDateTime date = rdir->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime = rdir->date()->asUnicodeString();
QString datetime = rdir->date()->asUnicodeString();
// qDebug() << rdir->encodedContent();
......@@ -753,14 +748,10 @@ void MessageFactoryTest::testCreateRedirect()
QString redirectTo = QStringLiteral("redir@redir.com");
KMime::Message::Ptr rdir = factory.createRedirect(redirectTo);
QDateTime date = rdir->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime = rdir->date()->asUnicodeString();
QString datetime = rdir->date()->asUnicodeString();
// qDebug() << rdir->encodedContent();
QString msgId = MessageCore::StringUtil::generateMessageId(msg->sender()->asUnicodeString(), QString());
QRegExp rx(QString::fromLatin1("Resent-Message-ID: ([^\n]*)"));
rx.indexIn(QString::fromLatin1(rdir->head()));
......@@ -805,9 +796,7 @@ void MessageFactoryTest::testCreateResend()
KMime::Message::Ptr rdir = factory.createResend();
QDateTime date = rdir->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime = rdir->date()->asUnicodeString();
QString datetime = rdir->date()->asUnicodeString();
// qDebug() << msg->encodedContent();
......
......@@ -138,8 +138,6 @@ QByteArray ImageScaling::mimetype() const
const QString type = MessageComposer::MessageComposerSettings::self()->writeFormat();
if (type == QLatin1String("JPG")) {
return "image/jpeg";
} else if (type == QLatin1String("PNG")) {
return "image/png";
} else {
return "image/png";
}
......
......@@ -27,7 +27,7 @@ using namespace MessageComposer;
class MessageComposer::AttachmentVcardFromAddressBookJobPrivate
{
public:
AttachmentVcardFromAddressBookJobPrivate(const Akonadi::Item &item)
explicit AttachmentVcardFromAddressBookJobPrivate(const Akonadi::Item &item)
: mItem(item)
{
}
......
......@@ -25,7 +25,6 @@ using namespace MessageComposer;
RecipientsEditorManager::RecipientsEditorManager(QObject *parent)
: QObject(parent)
, mModel(nullptr)
{
}
......
......@@ -47,7 +47,7 @@ public:
class MessageViewer::ViewerPluginManagerPrivate
{
public:
ViewerPluginManagerPrivate(ViewerPluginManager *qq)
explicit ViewerPluginManagerPrivate(ViewerPluginManager *qq)
: q(qq)
{
}
......
......@@ -162,7 +162,6 @@ MessagePart::Ptr ApplicationPkcs7MimeBodyPartFormatter::process(Interface::BodyP
if (_mp->isSigned()) {
if (!isSigned) {
qCDebug(MIMETREEPARSER_LOG) << "pkcs7 mime - signature found - opaque signed data !";
isSigned = true;
}
if (signTestNode != node) {
......
......@@ -413,7 +413,6 @@ TemplatesInsertCommand::TemplatesInsertCommand(QWidget *parent, const QString &n
setObjectName(name);
setText(i18n("&Insert Command"));
KActionMenu *menu = nullptr;
QMap< QString, Command > commandMap;
QSignalMapper *mapper = new QSignalMapper(this);
......@@ -431,7 +430,7 @@ TemplatesInsertCommand::TemplatesInsertCommand(QWidget *parent, const QString &n
"so you want to move your cursor to the desired insertion point first."));
// ******************************************************
menu = new KActionMenu(i18n("Original Message"), mMenu);
KActionMenu *menu = new KActionMenu(i18n("Original Message"), mMenu);
mMenu->addAction(menu);
// Map sorts commands
......
......@@ -110,7 +110,7 @@ void CheckPhishingUrlCachePrivate::save()
listMalware.append(i.key());
listMalwareCachedTime.append(info.verifyCacheAfterThisTime);
}
i++;
++i;
}
grp.writeEntry("Url", listMalware);
grp.writeEntry("CachedTime", listMalwareCachedTime);
......
......@@ -39,7 +39,7 @@ public:
*
* value
*/
LocalDataBaseFile(const QString &filename);
explicit LocalDataBaseFile(const QString &filename);
~LocalDataBaseFile();
void close();
......
......@@ -58,10 +58,9 @@ QList<quint32> RiceEncodingDecoder::decodeRiceIndiceDelta(const RiceDeltaEncodin
RiceDecoder decoder(riceDeltaEncoding.riceParameter, riceDeltaEncoding.numberEntries, riceDeltaEncoding.encodingData);
int lastValue(firstValue);
bool result = false;
while (decoder.hasOtherEntries()) {
quint32 offset;
result = decoder.nextValue(&offset);
bool result = decoder.nextValue(&offset);
if (!result) {
return QList<quint32>();
}
......
......@@ -34,7 +34,6 @@ class MailNetworkUrlInterceptorPluginInfo
{
public:
MailNetworkUrlInterceptorPluginInfo()
: plugin(nullptr)
{
}
......@@ -42,7 +41,7 @@ public:
QString metaDataFileName;
PimCommon::PluginUtilData pluginData;
WebEngineViewer::NetworkPluginUrlInterceptor *plugin = nullptr;
bool isEnabled;
bool isEnabled = false;
};
namespace {
......
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