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

Fix some warning from cppcheck

parent 6e82716a
......@@ -64,9 +64,9 @@ public:
Q_REQUIRED_RESULT QVector<DKIMHeaderParser::Header> listHeaders() const;
private:
Q_REQUIRED_RESULT int findHeaderLineEnd(const QByteArray &src, int &dataBegin, bool *folded);
Q_REQUIRED_RESULT static int findHeaderLineEnd(const QByteArray &src, int &dataBegin, bool *folded);
Q_REQUIRED_RESULT MessageViewer::DKIMHeaderParser::Header extractHeader(const QByteArray &head, const int headerStart, int &endOfFieldBody);
Q_REQUIRED_RESULT QByteArray unfoldHeader(const char *header, size_t headerSize);
Q_REQUIRED_RESULT static QByteArray unfoldHeader(const char *header, size_t headerSize);
QByteArray mHead;
QVector<DKIMHeaderParser::Header> mListHeaders;
bool mWasAlreadyParsed = false;
......
......@@ -314,7 +314,7 @@ void RenderTest::testRender()
QFETCH(bool, showSignatureDetails);
QFETCH(QString, asyncFileName);
const QString htmlFileName = outFileName + QStringLiteral(".html");
//const QString htmlFileName = outFileName + QStringLiteral(".html");
const bool bAsync = !asyncFileName.isEmpty();
// load input mail
......
......@@ -35,7 +35,7 @@ public:
void setHtmlString(const QString &htmlString);
private:
void toCleanPlainText(QString &text);
static void toCleanPlainText(QString &text);
QString mHtmlString;
};
}
......
......@@ -44,7 +44,7 @@ public:
class MessageViewer::MessageViewerConfigureSettingsPluginManagerPrivate
{
public:
MessageViewerConfigureSettingsPluginManagerPrivate(MessageViewerConfigureSettingsPluginManager *qq)
explicit MessageViewerConfigureSettingsPluginManagerPrivate(MessageViewerConfigureSettingsPluginManager *qq)
: q(qq)
{
}
......
......@@ -339,9 +339,9 @@ bool Util::saveContents(QWidget *parent, const KMime::Content::List &contents, Q
}
// save
if (result != PimCommon::RenameFileDialog::RENAMEFILE_IGNOREALL) {
const bool result = saveContent(parent, content, curUrl);
if (!result) {
globalResult = result;
const bool resultSave = saveContent(parent, content, curUrl);
if (!resultSave) {
globalResult = resultSave;
} else {
urlList.append(curUrl);
}
......@@ -591,7 +591,7 @@ bool Util::saveMessageInMboxAndGetUrl(QUrl &url, const Akonadi::Item::List &retr
i18n("Error saving message"));
return false;
}
QUrl localUrl = QUrl::fromLocalFile(localFileName);
localUrl = QUrl::fromLocalFile(localFileName);
if (localUrl.isLocalFile()) {
KRecentDirs::add(fileClass, localUrl.adjusted(
QUrl::RemoveFilename | QUrl::StripTrailingSlash).path());
......
......@@ -89,9 +89,9 @@ int AttachmentDialog::exec()
} else {
if (again) {
KConfigGroup::WriteConfigFlags flags = KConfig::Persistent;
KConfigGroup cg(KSharedConfig::openConfig().data(), "Notification Messages");
cg.writeEntry(dontAskName, static_cast<int>(ret), flags);
cg.sync();
KConfigGroup configGroup(KSharedConfig::openConfig().data(), "Notification Messages");
configGroup.writeEntry(dontAskName, static_cast<int>(ret), flags);
configGroup.sync();
}
return ret;
}
......
......@@ -282,13 +282,13 @@ void WebEngineAccessKey::handleSearchAccessKey(const QVariant &res)
if (a) {
const QKeySequence shortCut = a->shortcut();
if (!shortCut.isEmpty()) {
auto lst = unusedKeys;
auto lstUnusedKeys = unusedKeys;
for (QChar c : qAsConst(unusedKeys)) {
if (shortCut.matches(QKeySequence(c)) != QKeySequence::NoMatch) {
lst.removeOne(c);
lstUnusedKeys.removeOne(c);
}
}
unusedKeys = lst;
unusedKeys = lstUnusedKeys;
}
}
}
......
......@@ -27,7 +27,7 @@ namespace WebEngineViewer {
class WebEngineAccessKeyAnchor
{
public:
WebEngineAccessKeyAnchor(const QVariant &result);
explicit WebEngineAccessKeyAnchor(const QVariant &result);
WebEngineAccessKeyAnchor();
Q_REQUIRED_RESULT QRect boundingRect() const;
......
......@@ -33,7 +33,7 @@ using namespace WebEngineViewer;
class WebEngineViewer::WebEngineViewPrivate
{
public:
WebEngineViewPrivate(WebEngineView *q)
explicit WebEngineViewPrivate(WebEngineView *q)
: mSavedRelativePosition(-1)
, mCurrentWidget(nullptr)
, mWebEngineNavigatorInterceptor(nullptr)
......
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