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

Astyle kdelibs

parent 89c3af4b
......@@ -169,7 +169,6 @@ bool AdBlockSettingWidget::event(QEvent *event)
return QWidget::event(event);
}
void AdBlockSettingWidget::insertRule()
{
const QString rule = mUi->addFilterLineEdit->text();
......
......@@ -40,7 +40,7 @@ namespace MimeTreeParser
{
namespace Interface
{
class BodyPart;
class BodyPart;
}
}
......
......@@ -85,7 +85,6 @@ void ScamDetectionWebEngineTest::scamtest_data()
QTest::newRow("Redirect scam") << QStringLiteral("<html><body><a href=\"http://www.google.fr/url?q=http://www.yahoo.com\">test</a></body></html>") << true;
QTest::newRow("Redirect no scam") << QStringLiteral("<html><body><a href=\"kmail:showAuditLog?log=http://www.foo.com%3http://www.bla.com\">test</a></body></html>") << false;
//Numeric value
QTest::newRow("numeric no scam") << QStringLiteral("<html><body><a href=\"http://baseball2.2ndhalfplays.com/nested/attribs/\">http://baseball2.2ndhalfplays.com/nested/attribs</html>") << false;
QTest::newRow("numeric scam1") << QStringLiteral("<html><body><a href=\"http://25.15.55.88/\">test</a></body></html>") << true;
......@@ -109,5 +108,4 @@ void ScamDetectionWebEngineTest::scamtest()
QCOMPARE(scamResult, result);
}
QTEST_MAIN(ScamDetectionWebEngineTest)
......@@ -44,7 +44,6 @@ private:
MessageViewer::ScamDetectionWebEngine *mScamDetectionWebEngine;
};
class ScamDetectionWebEngineTest : public QObject
{
Q_OBJECT
......
......@@ -561,7 +561,6 @@ void Viewer::selectAll()
d->selectAll();
}
void Viewer::copySelectionToClipboard()
{
Q_D(Viewer);
......
......@@ -2009,7 +2009,7 @@ void ViewerPrivate::slotUrlOpen(const QUrl &url)
// known URLs, otherwise fallback to emitting a signal.
// That signal is caught by KMail, and in case of mailto URLs, a composer is shown.
qDebug()<<" void ViewerPrivate::slotUrlOpen(const QUrl &url)"<<url;
qDebug() << " void ViewerPrivate::slotUrlOpen(const QUrl &url)" << url;
if (URLHandlerManager::instance()->handleClick(mClickedUrl, this)) {
return;
}
......
......@@ -15,7 +15,6 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mailwebengineaccesskeyanchorfromhtmltest.h"
#include "../mailwebengineaccesskeyutils.h"
#include <QTest>
......@@ -65,7 +64,7 @@ void TestWebEngineAccessKey::handleSearchAccessKey(const QVariant &var)
const QVariantList lst = var.toList();
QVector<MessageViewer::MailWebEngineAccessKeyAnchor> anchorList;
anchorList.reserve(lst.count());
Q_FOREACH(const QVariant &anchor, lst) {
Q_FOREACH (const QVariant &anchor, lst) {
anchorList << MessageViewer::MailWebEngineAccessKeyAnchor(anchor);
}
Q_EMIT accessKeySearchFinished(anchorList);
......
......@@ -19,7 +19,6 @@
#include "../mailwebengineaccesskeyanchor.h"
#include <QTest>
MailWebEngineAccessKeyAnchorTest::MailWebEngineAccessKeyAnchorTest(QObject *parent)
: QObject(parent)
{
......
......@@ -19,7 +19,6 @@
#include "mailwebengineaccesskeyanchor.h"
#include "mailwebengineaccesskeyutils.h"
#include <KActionCollection>
#include <QKeyEvent>
#include <QLabel>
......@@ -93,7 +92,6 @@ static bool isEditableElement(QWebPage *page)
return false;
}
#endif
static QString linkElementKey(const MessageViewer::MailWebEngineAccessKeyAnchor &element, const QUrl &baseUrl)
{
......@@ -157,7 +155,7 @@ MailWebEngineAccessKey::MailWebEngineAccessKey(QWebEngineView *webEngine, QObjec
: QObject(parent),
d(new MessageViewer::MailWebEngineAccessKeyPrivate(webEngine))
{
qDebug()<<" MailWebEngineAccessKey::MailWebEngineAccessKey(QWebEngineView *webEngine, QObject *parent)";
qDebug() << " MailWebEngineAccessKey::MailWebEngineAccessKey(QWebEngineView *webEngine, QObject *parent)";
}
MailWebEngineAccessKey::~MailWebEngineAccessKey()
......@@ -196,10 +194,10 @@ void MailWebEngineAccessKey::keyPressEvent(QKeyEvent *e)
}
hideAccessKeys();
} else if (e->key() == Qt::Key_Control && e->modifiers() == Qt::ControlModifier
#if 0 //FIXME
#if 0 //FIXME
&& !isEditableElement(d->mWebView->page())
#endif
) {
#endif
) {
d->mAccessKeyActivated = MailWebEngineAccessKeyPrivate::PreActivated; // Only preactive here, it will be actually activated in key release.
}
}
......@@ -207,7 +205,7 @@ void MailWebEngineAccessKey::keyPressEvent(QKeyEvent *e)
void MailWebEngineAccessKey::keyReleaseEvent(QKeyEvent *e)
{
qDebug()<<" void MailWebEngineAccessKey::keyReleaseEvent(QKeyEvent *e)";
qDebug() << " void MailWebEngineAccessKey::keyReleaseEvent(QKeyEvent *e)";
if (d->mAccessKeyActivated == MailWebEngineAccessKeyPrivate::PreActivated) {
// Activate only when the CTRL key is pressed and released by itself.
if (e->key() == Qt::Key_Control && e->modifiers() == Qt::NoModifier) {
......@@ -249,14 +247,14 @@ void MailWebEngineAccessKey::makeAccessKeyLabel(QChar accessKey, const MessageVi
label->setAutoFillBackground(true);
label->setFrameStyle(QFrame::Box | QFrame::Plain);
QPoint point = element.boundingRect().center();
qDebug()<<" point label"<<point;
qDebug() << " point label" << point;
#if 0
point -= d->mWebView->page()->mainFrame()->scrollPosition();
#endif
label->move(point);
label->show();
point.setX(point.x() - label->width() / 2);
qDebug() << "new point "<<point;
qDebug() << "new point " << point;
label->move(point);
d->mAccessKeyLabels.append(label);
d->mAccessKeyNodes.insertMulti(accessKey, element);
......@@ -293,12 +291,11 @@ void MailWebEngineAccessKey::handleSearchAccessKey(const QVariant &res)
const QVariantList lst = res.toList();
QVector<MessageViewer::MailWebEngineAccessKeyAnchor> anchorList;
anchorList.reserve(lst.count());
Q_FOREACH(const QVariant &var, lst) {
Q_FOREACH (const QVariant &var, lst) {
//qDebug()<<" var"<<var;
anchorList << MessageViewer::MailWebEngineAccessKeyAnchor(var);
}
QList<QChar> unusedKeys;
unusedKeys.reserve(10 + ('Z' - 'A' + 1));
for (char c = 'A'; c <= 'Z'; ++c) {
......
......@@ -123,7 +123,7 @@ void MailWebEngineView::selectAll()
void MailWebEngineView::slotZoomChanged(qreal zoom)
{
qDebug()<<" void MailWebEngineView::slotZoomChanged(qreal zoom)*******"<<zoom;
qDebug() << " void MailWebEngineView::slotZoomChanged(qreal zoom)*******" << zoom;
setZoomFactor(zoom);
}
......@@ -235,7 +235,6 @@ void MailWebEngineView::handleScrollToAnchor(const QVariant &result)
}
}
void MailWebEngineView::scrollPageDown(int percent)
{
#if 0
......
......@@ -35,7 +35,6 @@ public:
void scrollUp(int pixels);
void scrollDown(int pixels);
void selectAll();
void scamCheck();
......@@ -49,8 +48,8 @@ public:
void scrollToAnchor(const QString &anchor);
void scrollPageDown(int percent);
void scrollPageUp(int percent);
void injectAttachments(const boost::function<QString ()> &delayedHtml);
bool replaceInnerHtml(const QString &id, const boost::function<QString ()> &delayedHtml);
void injectAttachments(const boost::function<QString()> &delayedHtml);
bool replaceInnerHtml(const QString &id, const boost::function<QString()> &delayedHtml);
bool hasVerticalScrollBar() const;
bool isAttachmentInjectionPoint(const QPoint &globalPos) const;
......
......@@ -25,7 +25,6 @@
#include <viewer/webengine/mailwebengineview.h>
TestMailWebEngine::TestMailWebEngine(QWidget *parent)
: QWidget(parent)
{
......@@ -61,7 +60,6 @@ void TestMailWebEngine::slotScrollUp()
mTestWebEngine->page()->runJavaScript(MessageViewer::WebEngineScript::scrollUp(10));
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
......
......@@ -75,7 +75,6 @@ void TestWebKitAccesskey::slotShowAccessKey()
mTestWebEngine->showAccessKeys();
}
TestWebEngineAccesskey::TestWebEngineAccesskey(QWidget *parent)
: QWidget(parent)
{
......
......@@ -34,7 +34,6 @@ public:
~TestWidget();
};
class TestWebKitAccesskey : public QWidget
{
Q_OBJECT
......@@ -49,7 +48,6 @@ private:
MessageViewer::MailWebView *mTestWebEngine;
};
class TestWebEngineAccesskey : public QWidget
{
Q_OBJECT
......
......@@ -95,20 +95,19 @@ QString WebEngineScript::findAllAnchorsAndForms()
return source;
}
QString WebEngineScript::setElementByIdVisible(const QString &elementStr, bool visibility)
{
if (visibility) {
const QString source = QString::fromLatin1("var element = document.getElementById('%1'); "
"if (element) { "
" element.style.removeProperty( 'display' );"
"}").arg(elementStr);
"if (element) { "
" element.style.removeProperty( 'display' );"
"}").arg(elementStr);
return source;
} else {
const QString source = QString::fromLatin1("var element = document.getElementById('%1'); "
"if (element) { "
" element.style.display = \"none\";"
"}").arg(elementStr);
"if (element) { "
" element.style.display = \"none\";"
"}").arg(elementStr);
return source;
}
}
......@@ -116,10 +115,10 @@ QString WebEngineScript::setElementByIdVisible(const QString &elementStr, bool v
QString WebEngineScript::searchElementPosition(const QString &elementStr)
{
const QString source = QString::fromLatin1("var element = document.getElementById('%1'); "
"if (element) { "
" var geometry = element.getBoundingClientRect(); "
" [(geometry.left + window.scrollX), (geometry.top + window.scrollY)]; "
"}").arg(elementStr);
"if (element) { "
" var geometry = element.getBoundingClientRect(); "
" [(geometry.left + window.scrollX), (geometry.top + window.scrollY)]; "
"}").arg(elementStr);
//qDebug()<<" source "<<source;
return source;
}
......@@ -142,7 +141,6 @@ QString WebEngineScript::scrollDown(int pixel)
return source;
}
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());
......@@ -153,9 +151,9 @@ QString WebEngineScript::scrollToPosition(const QPoint &pos)
QString WebEngineScript::setStyleToElement(const QString &elementStr, const QString &style)
{
const QString source = QString::fromLatin1("var element = document.getElementById('%1'); "
"if (element) { "
" element.style = '%2';"
"}").arg(elementStr).arg(style);
"if (element) { "
" element.style = '%2';"
"}").arg(elementStr).arg(style);
return source;
}
......
......@@ -86,7 +86,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 = qobject_cast<QWidget *>(static_cast<QChildEvent *>(event)->child());
if (child && child->inherits("QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget")) {
d->mCurrentWidget = child;
d->mCurrentWidget->installEventFilter(this);
......@@ -96,14 +96,14 @@ bool WebEngineView::eventFilter(QObject *obj, QEvent *event)
// Forward events to WebEngineView
if (obj == d->mCurrentWidget) {
#define HANDLE_EVENT(f, t) \
{ \
{ \
bool wasAccepted = event->isAccepted(); \
event->setAccepted(false); \
f(static_cast<t*>(event)); \
bool ret = event->isAccepted(); \
event->setAccepted(wasAccepted); \
return ret; \
}
}
switch (event->type()) {
case QEvent::KeyPress:
......
......@@ -1734,9 +1734,9 @@ bool CryptoMessagePart::okDecryptMIME(KMime::Content &data)
= new DecryptVerifyBodyPartMemento(job, ciphertext);
if (mOtp->allowAsync()) {
QObject::connect(newM, &CryptoBodyPartMemento::update,
nodeHelper, &NodeHelper::update);
nodeHelper, &NodeHelper::update);
QObject::connect(newM, SIGNAL(update(MimeTreeParser::UpdateMode)), source->sourceObject(),
SLOT(update(MimeTreeParser::UpdateMode)));
SLOT(update(MimeTreeParser::UpdateMode)));
if (newM->start()) {
mMetaData.inProgress = true;
mOtp->mHasPendingAsyncJobs = true;
......@@ -1807,8 +1807,8 @@ bool CryptoMessagePart::okDecryptMIME(KMime::Content &data)
cryptPlugLibName);
} else if (!passphraseError()) {
mMetaData.errorText = i18n("Crypto plug-in \"%1\" could not decrypt the data.", cryptPlugLibName)
+ QLatin1String("<br />")
+ i18n("Error: %1", mMetaData.errorText);
+ QLatin1String("<br />")
+ i18n("Error: %1", mMetaData.errorText);
}
}
return bDecryptionOk;
......@@ -1959,11 +1959,11 @@ void CryptoMessagePart::html(bool decorate)
}
secKeyList += QStringLiteral("<a href=\"kmail:showCertificate#%1 ### %2 ### %3\">%4</a>")
.arg(mCryptoProto->displayName(),
mCryptoProto->name(),
QString::fromLatin1(recipient.keyID()),
QString::fromLatin1(QByteArray("0x") + recipient.keyID())
);
.arg(mCryptoProto->displayName(),
mCryptoProto->name(),
QString::fromLatin1(recipient.keyID()),
QString::fromLatin1(QByteArray("0x") + recipient.keyID())
);
}
}
......
......@@ -138,7 +138,7 @@ private:
HtmlWriter *mWriter;
PartMetaData *mMetaData;
const NodeHelper* mNodeHelper;
const NodeHelper *mNodeHelper;
const Kleo::CryptoBackend::Protocol *mCryptoProto;
ObjectTreeSourceIf *mSource;
QString mFromAddress;
......
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