summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-15 08:00:42 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-15 08:00:42 (GMT)
commit42c5e7884cd82a6eb087c441d0aab431f0a51706 (patch)
tree0fc7228125d1a158ffd432fcb86039e297ab6f43
parent43728e53dc29607b7dc6661352ce92b3064c59c2 (diff)
Fix some clazy error
-rw-r--r--messagecomposer/autotests/composertest.cpp14
-rw-r--r--messagecomposer/src/composer/composer.cpp4
-rw-r--r--messagecomposer/src/plugineditor/plugineditorinterface.cpp2
-rw-r--r--messagecomposer/src/plugineditor/plugineditorinterface.h2
-rw-r--r--messagecomposer/src/utils/util.cpp6
-rw-r--r--messagecomposer/src/utils/util.h4
-rw-r--r--messagelist/src/core/view.cpp12
-rw-r--r--messageviewer/src/viewer/urlhandlermanager.cpp6
-rw-r--r--messageviewer/src/viewer/webengine/mailwebenginescript.cpp4
-rw-r--r--messageviewer/src/widgets/mailsourceviewtextbrowserwidget.h1
-rw-r--r--mimetreeparser/src/interfaces/bodypartformatter.cpp9
-rw-r--r--mimetreeparser/src/viewer/messagepart.cpp6
-rw-r--r--mimetreeparser/src/viewer/nodehelper.cpp20
-rw-r--r--mimetreeparser/src/viewer/objecttreeparser.cpp2
-rw-r--r--mimetreeparser/src/viewer/partnodebodypart.cpp6
-rw-r--r--mimetreeparser/src/viewer/partnodebodypart.h3
-rw-r--r--templateparser/autotests/templateparsertest.cpp2
-rw-r--r--webengineviewer/src/webenginescript.cpp2
-rw-r--r--webengineviewer/src/webengineview.cpp2
19 files changed, 55 insertions, 52 deletions
diff --git a/messagecomposer/autotests/composertest.cpp b/messagecomposer/autotests/composertest.cpp
index 105ebdf..bef9e3c 100644
--- a/messagecomposer/autotests/composertest.cpp
+++ b/messagecomposer/autotests/composertest.cpp
@@ -50,7 +50,7 @@ void ComposerTest::testAttachments()
QVERIFY(composer->exec());
QCOMPARE(composer->resultMessages().size(), 1);
- KMime::Message::Ptr message = composer->resultMessages().first();
+ KMime::Message::Ptr message = composer->resultMessages().constFirst();
delete composer;
composer = Q_NULLPTR;
@@ -119,7 +119,7 @@ void ComposerTest::testNonAsciiHeaders()
QVERIFY(composer->exec());
QCOMPARE(composer->resultMessages().size(), 1);
- const KMime::Message::Ptr message = composer->resultMessages().first();
+ const KMime::Message::Ptr message = composer->resultMessages().constFirst();
message->assemble();
message->parse();
QCOMPARE(message->bcc(false)->displayNames().size(), 1);
@@ -127,11 +127,11 @@ void ComposerTest::testNonAsciiHeaders()
QCOMPARE(message->cc(false)->displayNames().size(), 1);
QCOMPARE(message->from(false)->displayNames().size(), 1);
QCOMPARE(message->replyTo(false)->displayNames().size(), 1);
- QCOMPARE(message->from()->displayNames().first(), fromDisplayName);
- QCOMPARE(message->to()->displayNames().first(), toDisplayName);
- QCOMPARE(message->cc()->displayNames().first(), ccDisplayName);
- QCOMPARE(message->bcc()->displayNames().first(), bccDisplayName);
- QCOMPARE(message->replyTo()->displayNames().first(), replyToDisplayName);
+ QCOMPARE(message->from()->displayNames().constFirst(), fromDisplayName);
+ QCOMPARE(message->to()->displayNames().constFirst(), toDisplayName);
+ QCOMPARE(message->cc()->displayNames().constFirst(), ccDisplayName);
+ QCOMPARE(message->bcc()->displayNames().constFirst(), bccDisplayName);
+ QCOMPARE(message->replyTo()->displayNames().constFirst(), replyToDisplayName);
delete composer;
composer = Q_NULLPTR;
}
diff --git a/messagecomposer/src/composer/composer.cpp b/messagecomposer/src/composer/composer.cpp
index f20bdaf..86c2141 100644
--- a/messagecomposer/src/composer/composer.cpp
+++ b/messagecomposer/src/composer/composer.cpp
@@ -69,7 +69,7 @@ public:
void composeStep2();
QList<ContentJobBase *> createEncryptJobs(ContentJobBase *contentJob, bool sign);
void contentJobFinished(KJob *job); // slot
- void composeWithLateAttachments(KMime::Message *headers, KMime::Content *content, AttachmentPart::List parts, std::vector<GpgME::Key> keys, const QStringList &recipients);
+ void composeWithLateAttachments(KMime::Message *headers, KMime::Content *content, const AttachmentPart::List &parts, const std::vector<GpgME::Key> &keys, const QStringList &recipients);
void attachmentsFinished(KJob *job); // slot
void composeFinalStep(KMime::Content *headers, KMime::Content *content);
@@ -362,7 +362,7 @@ void ComposerPrivate::contentJobFinished(KJob *job)
}
-void ComposerPrivate::composeWithLateAttachments(KMime::Message *headers, KMime::Content *content, AttachmentPart::List parts, std::vector<GpgME::Key> keys, const QStringList &recipients)
+void ComposerPrivate::composeWithLateAttachments(KMime::Message *headers, KMime::Content *content, const AttachmentPart::List &parts, const std::vector<GpgME::Key> &keys, const QStringList &recipients)
{
Q_Q(Composer);
diff --git a/messagecomposer/src/plugineditor/plugineditorinterface.cpp b/messagecomposer/src/plugineditor/plugineditorinterface.cpp
index d366eb7..b0bf16c 100644
--- a/messagecomposer/src/plugineditor/plugineditorinterface.cpp
+++ b/messagecomposer/src/plugineditor/plugineditorinterface.cpp
@@ -72,7 +72,7 @@ PluginEditorInterface::~PluginEditorInterface()
delete d;
}
-void PluginEditorInterface::setActionType(const ActionType &type)
+void PluginEditorInterface::setActionType(ActionType type)
{
d->mActionType = type;
}
diff --git a/messagecomposer/src/plugineditor/plugineditorinterface.h b/messagecomposer/src/plugineditor/plugineditorinterface.h
index b7ff7c5..61a46c2 100644
--- a/messagecomposer/src/plugineditor/plugineditorinterface.h
+++ b/messagecomposer/src/plugineditor/plugineditorinterface.h
@@ -64,7 +64,7 @@ public:
explicit PluginEditorInterface(QObject *parent = Q_NULLPTR);
~PluginEditorInterface();
- void setActionType(const ActionType &type);
+ void setActionType(ActionType type);
ActionType actionType() const;
KPIMTextEdit::RichTextEditor *richTextEditor() const;
diff --git a/messagecomposer/src/utils/util.cpp b/messagecomposer/src/utils/util.cpp
index dd899f0..74528b0 100644
--- a/messagecomposer/src/utils/util.cpp
+++ b/messagecomposer/src/utils/util.cpp
@@ -61,7 +61,7 @@ KMime::Content *setBodyAndCTE(QByteArray &encodedBody, KMime::Headers::ContentTy
return ret;
}
-KMime::Content *MessageComposer::Util::composeHeadersAndBody(KMime::Content *orig, QByteArray encodedBody, Kleo::CryptoMessageFormat format, bool sign, QByteArray hashAlgo)
+KMime::Content *MessageComposer::Util::composeHeadersAndBody(KMime::Content *orig, QByteArray encodedBody, Kleo::CryptoMessageFormat format, bool sign, const QByteArray &hashAlgo)
{
KMime::Content *result = new KMime::Content;
@@ -133,7 +133,7 @@ KMime::Content *MessageComposer::Util::composeHeadersAndBody(KMime::Content *ori
}
// set the correct top-level ContentType on the message
-void MessageComposer::Util::makeToplevelContentType(KMime::Content *content, Kleo::CryptoMessageFormat format, bool sign, QByteArray hashAlgo)
+void MessageComposer::Util::makeToplevelContentType(KMime::Content *content, Kleo::CryptoMessageFormat format, bool sign, const QByteArray &hashAlgo)
{
switch (format) {
default:
@@ -335,4 +335,4 @@ KMime::Content *MessageComposer::Util::findTypeInMessage(KMime::Content *data, c
}
}
return Q_NULLPTR;
-} \ No newline at end of file
+}
diff --git a/messagecomposer/src/utils/util.h b/messagecomposer/src/utils/util.h
index d0c2c1e..20bfe03 100644
--- a/messagecomposer/src/utils/util.h
+++ b/messagecomposer/src/utils/util.h
@@ -47,12 +47,12 @@ namespace Util
* Sets the proper structural information such as content-type, cte, and charset on the encoded body content. Depending on the crypto options,
* original content may be needed to determine some of the values
*/
-KMime::Content *composeHeadersAndBody(KMime::Content *orig, QByteArray encodedBody, Kleo::CryptoMessageFormat format, bool sign, QByteArray hashAlgo = "pgp-sha1");
+KMime::Content *composeHeadersAndBody(KMime::Content *orig, QByteArray encodedBody, Kleo::CryptoMessageFormat format, bool sign, const QByteArray &hashAlgo = "pgp-sha1");
/**
* Sets the content-type for the top level of the mime content, based on the crypto format and if a signature is used.
*/
-void makeToplevelContentType(KMime::Content *content, Kleo::CryptoMessageFormat format, bool sign, QByteArray hashAlgo = "pgp-sha1");
+void makeToplevelContentType(KMime::Content *content, Kleo::CryptoMessageFormat format, bool sign, const QByteArray &hashAlgo = "pgp-sha1");
/**
* Sets the nested content type of the content, for crypto operations.
diff --git a/messagelist/src/core/view.cpp b/messagelist/src/core/view.cpp
index 0efbacc..d021fdd 100644
--- a/messagelist/src/core/view.cpp
+++ b/messagelist/src/core/view.cpp
@@ -2378,7 +2378,7 @@ bool View::event(QEvent *e)
"</div>" \
"</td>" \
"</tr>"
- ).arg(txtColorName).arg(bckColorName).arg(mi->subject().toHtmlEscaped()).arg(textDirection);
+ ).arg(txtColorName, bckColorName, mi->subject().toHtmlEscaped(), textDirection);
tip += QLatin1String(
"<tr>" \
@@ -2399,12 +2399,12 @@ bool View::event(QEvent *e)
"</tr>");
if (textIsLeftToRight) {
- tip += htmlCodeForStandardRow.arg(i18n("From")).arg(mi->displaySender());
- tip += htmlCodeForStandardRow.arg(i18nc("Receiver of the email", "To")).arg(mi->displayReceiver());
- tip += htmlCodeForStandardRow.arg(i18n("Date")).arg(mi->formattedDate());
+ tip += htmlCodeForStandardRow.arg(i18n("From"), mi->displaySender());
+ tip += htmlCodeForStandardRow.arg(i18nc("Receiver of the email", "To"), mi->displayReceiver());
+ tip += htmlCodeForStandardRow.arg(i18n("Date"), mi->formattedDate());
} else {
- tip += htmlCodeForStandardRow.arg(mi->displaySender()).arg(i18n("From"));
- tip += htmlCodeForStandardRow.arg(mi->displayReceiver()).arg(i18nc("Receiver of the email", "To"));
+ tip += htmlCodeForStandardRow.arg(mi->displaySender(), i18n("From"));
+ tip += htmlCodeForStandardRow.arg(mi->displayReceiver(), i18nc("Receiver of the email", "To"));
tip += htmlCodeForStandardRow.arg(mi->formattedDate(), i18n("Date"));
}
diff --git a/messageviewer/src/viewer/urlhandlermanager.cpp b/messageviewer/src/viewer/urlhandlermanager.cpp
index 243db46..340d965 100644
--- a/messageviewer/src/viewer/urlhandlermanager.cpp
+++ b/messageviewer/src/viewer/urlhandlermanager.cpp
@@ -393,7 +393,7 @@ bool URLHandlerManager::BodyPartURLHandlerManager::handleClick(const QUrl &url,
return false;
}
- MimeTreeParser::PartNodeBodyPart part(0, 0, w->message().data(), node, w->nodeHelper(), w->overrideCodec());
+ MimeTreeParser::PartNodeBodyPart part(0, 0, w->message().data(), node, w->nodeHelper());
BodyPartHandlerList::const_iterator end(mHandlers.constEnd());
for (BodyPartHandlerList::const_iterator it = mHandlers.constBegin(); it != end; ++it) {
@@ -413,7 +413,7 @@ bool URLHandlerManager::BodyPartURLHandlerManager::handleContextMenuRequest(cons
return false;
}
- MimeTreeParser::PartNodeBodyPart part(0, 0, w->message().data(), node, w->nodeHelper(), w->overrideCodec());
+ MimeTreeParser::PartNodeBodyPart part(0, 0, w->message().data(), node, w->nodeHelper());
BodyPartHandlerList::const_iterator end(mHandlers.constEnd());
for (BodyPartHandlerList::const_iterator it = mHandlers.constBegin(); it != end; ++it)
if ((*it)->handleContextMenuRequest(&part, path, p)) {
@@ -430,7 +430,7 @@ QString URLHandlerManager::BodyPartURLHandlerManager::statusBarMessage(const QUr
return QString();
}
- MimeTreeParser::PartNodeBodyPart part(0, 0, w->message().data(), node, w->nodeHelper(), w->overrideCodec());
+ MimeTreeParser::PartNodeBodyPart part(0, 0, w->message().data(), node, w->nodeHelper());
BodyPartHandlerList::const_iterator end(mHandlers.constEnd());
for (BodyPartHandlerList::const_iterator it = mHandlers.constBegin(); it != end; ++it) {
const QString msg = (*it)->statusBarMessage(&part, path);
diff --git a/messageviewer/src/viewer/webengine/mailwebenginescript.cpp b/messageviewer/src/viewer/webengine/mailwebenginescript.cpp
index 7d67705..64e1ac3 100644
--- a/messageviewer/src/viewer/webengine/mailwebenginescript.cpp
+++ b/messageviewer/src/viewer/webengine/mailwebenginescript.cpp
@@ -66,14 +66,14 @@ QString MailWebEngineScript::manageShowHideAttachments(bool hide)
QString MailWebEngineScript::injectAttachments(const QString &delayedHtml, const QString &elementStr)
{
- const QString source = QString::fromLatin1("qt.jQuery('#%1').append('%2')").arg(elementStr).arg(delayedHtml);
+ const QString source = QString::fromLatin1("qt.jQuery('#%1').append('%2')").arg(elementStr, delayedHtml);
return source;
}
QString MailWebEngineScript::replaceInnerHtml(const QString &field, const QString &html)
{
const QString replaceInnerHtmlStr = QLatin1String("iconFull") + field + QLatin1String("AddressList");
- const QString source = QString::fromLatin1("qt.jQuery('#%1').append('%2')").arg(replaceInnerHtmlStr).arg(html);
+ const QString source = QString::fromLatin1("qt.jQuery('#%1').append('%2')").arg(replaceInnerHtmlStr, html);
return source;
}
diff --git a/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.h b/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.h
index 0c85d93..2f24dc3 100644
--- a/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.h
+++ b/messageviewer/src/widgets/mailsourceviewtextbrowserwidget.h
@@ -56,6 +56,7 @@ class FindBarSourceView;
class MailSourceViewTextBrowser;
class MailSourceHighlighter : public QSyntaxHighlighter
{
+ Q_OBJECT
public:
explicit MailSourceHighlighter(QTextDocument *textdocument)
: QSyntaxHighlighter(textdocument)
diff --git a/mimetreeparser/src/interfaces/bodypartformatter.cpp b/mimetreeparser/src/interfaces/bodypartformatter.cpp
index fd2dbe4..62bf182 100644
--- a/mimetreeparser/src/interfaces/bodypartformatter.cpp
+++ b/mimetreeparser/src/interfaces/bodypartformatter.cpp
@@ -46,12 +46,11 @@ namespace Interface
class MessagePartPrivate
{
public:
- MessagePartPrivate(MessagePart *mp, const BodyPart *part)
+ MessagePartPrivate(const BodyPart *part)
: mHtmlWriter(Q_NULLPTR)
, mPart(part)
, mParentPart(Q_NULLPTR)
, mCreatedWriter(false)
- , q(mp)
{
}
@@ -75,21 +74,19 @@ public:
MessagePart *mParentPart;
bool mCreatedWriter;
-private:
- MessagePart *q;
};
}
}
MessagePart::MessagePart()
: QObject()
- , d(new MessagePartPrivate(this, Q_NULLPTR))
+ , d(new MessagePartPrivate(Q_NULLPTR))
{
}
MessagePart::MessagePart(const BodyPart &part)
: QObject()
- , d(new MessagePartPrivate(this, &part))
+ , d(new MessagePartPrivate(&part))
{
}
diff --git a/mimetreeparser/src/viewer/messagepart.cpp b/mimetreeparser/src/viewer/messagepart.cpp
index 3e858ad..1c6806c 100644
--- a/mimetreeparser/src/viewer/messagepart.cpp
+++ b/mimetreeparser/src/viewer/messagepart.cpp
@@ -603,8 +603,10 @@ AlternativeMessagePart::AlternativeMessagePart(ObjectTreeParser *otp, KMime::Con
return;
}
- foreach (const auto &name, mChildNodes.keys()) {
- mChildParts[name] = MimeMessagePart::Ptr(new MimeMessagePart(mOtp, mChildNodes[name], true));
+ QMapIterator<Util::HtmlMode, KMime::Content *> i(mChildNodes);
+ while (i.hasNext()) {
+ i.next();
+ mChildParts[i.key()] = MimeMessagePart::Ptr(new MimeMessagePart(mOtp, i.value(), true));
}
}
diff --git a/mimetreeparser/src/viewer/nodehelper.cpp b/mimetreeparser/src/viewer/nodehelper.cpp
index 5942360..e37f3a6 100644
--- a/mimetreeparser/src/viewer/nodehelper.cpp
+++ b/mimetreeparser/src/viewer/nodehelper.cpp
@@ -661,12 +661,14 @@ QString NodeHelper::persistentIndex(const KMime::Content *node) const
QString indexStr = node->index().toString();
if (indexStr.isEmpty()) {
- Q_FOREACH (KMime::Content *realNode, mExtraContents.keys()) {
- const auto &extraNodes = mExtraContents.value(realNode);
+ QMapIterator<KMime::Message::Content *, QList<KMime::Content *> > it(mExtraContents);
+ while (it.hasNext()) {
+ it.next();
+ const auto &extraNodes = it.value();
for (int i = 0; i < extraNodes.size(); i++) {
if (extraNodes[i] == node) {
indexStr = QString::fromLatin1("e%1").arg(i);
- const QString parentIndex = persistentIndex(realNode);
+ const QString parentIndex = persistentIndex(it.key());
if (!parentIndex.isEmpty()) {
indexStr = QString::fromLatin1("%1:%2").arg(parentIndex, indexStr);
}
@@ -677,15 +679,17 @@ QString NodeHelper::persistentIndex(const KMime::Content *node) const
} else {
const KMime::Content *const topLevel = node->topLevel();
//if the node is an extra node, prepend the index of the extra node to the url
- Q_FOREACH (KMime::Content *realNode, mExtraContents.keys()) {
- const QList<KMime::Content *> &extraNodes = extraContents(realNode);
+ QMapIterator<KMime::Message::Content *, QList<KMime::Content *> > it(mExtraContents);
+ while (it.hasNext()) {
+ it.next();
+ const QList<KMime::Content *> &extraNodes = extraContents(it.key());
for (int i = 0; i < extraNodes.size(); ++i) {
KMime::Content *const extraNode = extraNodes[i];
if (topLevel == extraNode) {
- indexStr.prepend(QString::fromLatin1("e%1:").arg(i));
- const QString parentIndex = persistentIndex(realNode);
+ indexStr.prepend(QStringLiteral("e%1:").arg(i));
+ const QString parentIndex = persistentIndex(it.key());
if (!parentIndex.isEmpty()) {
- indexStr = QString::fromLatin1("%1:%2").arg(parentIndex, indexStr);
+ indexStr = QStringLiteral("%1:%2").arg(parentIndex, indexStr);
}
return indexStr;
}
diff --git a/mimetreeparser/src/viewer/objecttreeparser.cpp b/mimetreeparser/src/viewer/objecttreeparser.cpp
index 1093d7a..5e20074 100644
--- a/mimetreeparser/src/viewer/objecttreeparser.cpp
+++ b/mimetreeparser/src/viewer/objecttreeparser.cpp
@@ -213,7 +213,7 @@ bool ObjectTreeParser::processType(KMime::Content *node, ProcessResult &processR
if (!formatter) {
continue;
}
- PartNodeBodyPart part(this, &processResult, mTopLevelContent, node, mNodeHelper, codecFor(node));
+ PartNodeBodyPart part(this, &processResult, mTopLevelContent, node, mNodeHelper);
// Set the default display strategy for this body part relying on the
// identity of Interface::BodyPart::Display and AttachmentStrategy::Display
part.setDefaultDisplay((Interface::BodyPart::Display) attachmentStrategy()->defaultDisplay(node));
diff --git a/mimetreeparser/src/viewer/partnodebodypart.cpp b/mimetreeparser/src/viewer/partnodebodypart.cpp
index ab3c658..ec50978 100644
--- a/mimetreeparser/src/viewer/partnodebodypart.cpp
+++ b/mimetreeparser/src/viewer/partnodebodypart.cpp
@@ -45,8 +45,8 @@ using namespace MimeTreeParser;
static int serial = 0;
PartNodeBodyPart::PartNodeBodyPart(ObjectTreeParser *otp, ProcessResult *result, KMime::Content *topLevelContent, KMime::Content *content,
- NodeHelper *nodeHelper, const QTextCodec *codec)
- : Interface::BodyPart(), mTopLevelContent(topLevelContent), mContent(content), mCodec(codec),
+ NodeHelper *nodeHelper)
+ : Interface::BodyPart(), mTopLevelContent(topLevelContent), mContent(content),
mDefaultDisplay(Interface::BodyPart::None), mNodeHelper(nodeHelper)
, mObjectTreeParser(otp)
, mProcessResult(result)
@@ -122,4 +122,4 @@ void PartNodeBodyPart::setDefaultDisplay(Interface::BodyPart::Display d)
Interface::ObjectTreeSource *PartNodeBodyPart::source() const
{
return mObjectTreeParser->mSource;
-} \ No newline at end of file
+}
diff --git a/mimetreeparser/src/viewer/partnodebodypart.h b/mimetreeparser/src/viewer/partnodebodypart.h
index aea6be4..b689859 100644
--- a/mimetreeparser/src/viewer/partnodebodypart.h
+++ b/mimetreeparser/src/viewer/partnodebodypart.h
@@ -59,7 +59,7 @@ class MIMETREEPARSER_EXPORT PartNodeBodyPart : public Interface::BodyPart
{
public:
explicit PartNodeBodyPart(ObjectTreeParser *otp, ProcessResult *result, KMime::Content *topLevelContent, KMime::Content *content,
- NodeHelper *nodeHelper, const QTextCodec *codec = 0);
+ NodeHelper *nodeHelper);
QString makeLink(const QString &path) const Q_DECL_OVERRIDE;
QString asText() const Q_DECL_OVERRIDE;
@@ -100,7 +100,6 @@ public:
private:
KMime::Content *mTopLevelContent;
KMime::Content *mContent;
- const QTextCodec *mCodec;
BodyPart::Display mDefaultDisplay;
NodeHelper *mNodeHelper;
ObjectTreeParser *mObjectTreeParser;
diff --git a/templateparser/autotests/templateparsertest.cpp b/templateparser/autotests/templateparsertest.cpp
index 95130e4..4b005de 100644
--- a/templateparser/autotests/templateparsertest.cpp
+++ b/templateparser/autotests/templateparsertest.cpp
@@ -85,7 +85,7 @@ void TemplateParserTester::test_replyPlain_data()
QDir dir(QStringLiteral(MAIL_DATA_DIR));
foreach (const QString &file, dir.entryList(QStringList(QLatin1String("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks)) {
- const auto expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".plain.reply");
+ const QString expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".plain.reply");
if (!QFile::exists(expectedFile)) {
continue;
}
diff --git a/webengineviewer/src/webenginescript.cpp b/webengineviewer/src/webenginescript.cpp
index fa74045..519c041 100644
--- a/webengineviewer/src/webenginescript.cpp
+++ b/webengineviewer/src/webenginescript.cpp
@@ -148,7 +148,7 @@ QString WebEngineScript::scrollDown(int pixel)
QString WebEngineScript::scrollToPosition(const QPoint &pos)
{
- const QString source = QString::fromLatin1("window.scrollTo(%1, %2); [window.scrollX, window.scrollY];").arg(pos.x()).arg(pos.y());
+ const QString source = QString::fromLatin1("window.scrollTo(%1, %2); [window.scrollX, window.scrollY];").arg(pos.x(), pos.y());
return source;
}
diff --git a/webengineviewer/src/webengineview.cpp b/webengineviewer/src/webengineview.cpp
index 1d68d2b..e0d20da 100644
--- a/webengineviewer/src/webengineview.cpp
+++ b/webengineviewer/src/webengineview.cpp
@@ -125,7 +125,7 @@ bool WebEngineView::eventFilter(QObject *obj, QEvent *event)
{
// Hack to find widget that receives input events
if (obj == this && event->type() == QEvent::ChildAdded) {
- QWidget *child = qobject_cast<QWidget *>(static_cast<QChildEvent *>(event)->child());
+ QWidget *child = dynamic_cast<QWidget *>(static_cast<QChildEvent *>(event)->child());
if (child && child->inherits("QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget")) {
d->mCurrentWidget = child;
d->mCurrentWidget->installEventFilter(this);