summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-06 13:42:10 +0200
committerMontel Laurent <[email protected]>2017-10-06 13:42:10 +0200
commitaa2bad56afe93d0edb00c31531790f33c1796633 (patch)
treef1f9f0a598e5f7ecd7fee9289830202d7aea13e6
parent52f8060e24cac3aaa2cd20ace6864c4fa114a728 (diff)
Fix error found by cppcheck
-rw-r--r--messagecomposer/autotests/messagefactoryngtest.cpp19
-rw-r--r--messagecomposer/src/imagescaling/imagescaling.cpp2
-rw-r--r--messagecomposer/src/job/attachmentvcardfromaddressbookjob.cpp2
-rw-r--r--messagecomposer/src/recipient/recipientseditormanager.cpp1
-rw-r--r--messageviewer/src/viewerplugins/viewerpluginmanager.cpp2
-rw-r--r--mimetreeparser/src/bodyformatter/applicationpkcs7mime.cpp1
-rw-r--r--templateparser/src/templatesinsertcommand.cpp3
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurlcache.cpp2
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasefile.h2
-rw-r--r--webengineviewer/src/checkphishingurl/riceencodingdecoder.cpp3
-rw-r--r--webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp3
11 files changed, 11 insertions, 29 deletions
diff --git a/messagecomposer/autotests/messagefactoryngtest.cpp b/messagecomposer/autotests/messagefactoryngtest.cpp
index 5e8efd3..dc08a9e 100644
--- a/messagecomposer/autotests/messagefactoryngtest.cpp
+++ b/messagecomposer/autotests/messagefactoryngtest.cpp
@@ -643,13 +643,10 @@ void MessageFactoryTest::testCreateRedirectToAndCCAndBCC()
QString redirectBcc = QStringLiteral("[email protected], [email protected]");
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("[email protected], [email protected]");
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("[email protected]");
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();
diff --git a/messagecomposer/src/imagescaling/imagescaling.cpp b/messagecomposer/src/imagescaling/imagescaling.cpp
index c8a252a..51420f8 100644
--- a/messagecomposer/src/imagescaling/imagescaling.cpp
+++ b/messagecomposer/src/imagescaling/imagescaling.cpp
@@ -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";
}
diff --git a/messagecomposer/src/job/attachmentvcardfromaddressbookjob.cpp b/messagecomposer/src/job/attachmentvcardfromaddressbookjob.cpp
index 4af0a4e..5d25ec4 100644
--- a/messagecomposer/src/job/attachmentvcardfromaddressbookjob.cpp
+++ b/messagecomposer/src/job/attachmentvcardfromaddressbookjob.cpp
@@ -27,7 +27,7 @@ using namespace MessageComposer;
class MessageComposer::AttachmentVcardFromAddressBookJobPrivate
{
public:
- AttachmentVcardFromAddressBookJobPrivate(const Akonadi::Item &item)
+ explicit AttachmentVcardFromAddressBookJobPrivate(const Akonadi::Item &item)
: mItem(item)
{
}
diff --git a/messagecomposer/src/recipient/recipientseditormanager.cpp b/messagecomposer/src/recipient/recipientseditormanager.cpp
index d2ca7a0..9f97b66 100644
--- a/messagecomposer/src/recipient/recipientseditormanager.cpp
+++ b/messagecomposer/src/recipient/recipientseditormanager.cpp
@@ -25,7 +25,6 @@ using namespace MessageComposer;
RecipientsEditorManager::RecipientsEditorManager(QObject *parent)
: QObject(parent)
- , mModel(nullptr)
{
}
diff --git a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
index f33384c..99f7c0a 100644
--- a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
+++ b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
@@ -47,7 +47,7 @@ public:
class MessageViewer::ViewerPluginManagerPrivate
{
public:
- ViewerPluginManagerPrivate(ViewerPluginManager *qq)
+ explicit ViewerPluginManagerPrivate(ViewerPluginManager *qq)
: q(qq)
{
}
diff --git a/mimetreeparser/src/bodyformatter/applicationpkcs7mime.cpp b/mimetreeparser/src/bodyformatter/applicationpkcs7mime.cpp
index cea678a..df1d060 100644
--- a/mimetreeparser/src/bodyformatter/applicationpkcs7mime.cpp
+++ b/mimetreeparser/src/bodyformatter/applicationpkcs7mime.cpp
@@ -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) {
diff --git a/templateparser/src/templatesinsertcommand.cpp b/templateparser/src/templatesinsertcommand.cpp
index 6e040e2..33af2ed 100644
--- a/templateparser/src/templatesinsertcommand.cpp
+++ b/templateparser/src/templatesinsertcommand.cpp
@@ -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
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurlcache.cpp b/webengineviewer/src/checkphishingurl/checkphishingurlcache.cpp
index ea2797c..bf42544 100644
--- a/webengineviewer/src/checkphishingurl/checkphishingurlcache.cpp
+++ b/webengineviewer/src/checkphishingurl/checkphishingurlcache.cpp
@@ -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);
diff --git a/webengineviewer/src/checkphishingurl/localdatabasefile.h b/webengineviewer/src/checkphishingurl/localdatabasefile.h
index 5b9cde3..c9a176b 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasefile.h
+++ b/webengineviewer/src/checkphishingurl/localdatabasefile.h
@@ -39,7 +39,7 @@ public:
*
* value
*/
- LocalDataBaseFile(const QString &filename);
+ explicit LocalDataBaseFile(const QString &filename);
~LocalDataBaseFile();
void close();
diff --git a/webengineviewer/src/checkphishingurl/riceencodingdecoder.cpp b/webengineviewer/src/checkphishingurl/riceencodingdecoder.cpp
index 419957a..894c014 100644
--- a/webengineviewer/src/checkphishingurl/riceencodingdecoder.cpp
+++ b/webengineviewer/src/checkphishingurl/riceencodingdecoder.cpp
@@ -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>();
}
diff --git a/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp b/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp
index d6e3660..a6c7b03 100644
--- a/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp
+++ b/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp
@@ -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 {