Commit 1e1e7572 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Astyle kdelibs

parent 0c8c5f6b
......@@ -379,10 +379,10 @@ void RichTextComposerNgTest::shouldLoadSignatureFromFile_data()
QTest::addColumn<KIdentityManagement::Signature::AddedTextFlag>("signatureaddtext");
QTest::newRow("signature1") << QStringLiteral("signature1.txt") << QStringLiteral("\n")
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("signature2") << QStringLiteral("signature2.txt") << QStringLiteral("\n")
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
}
void RichTextComposerNgTest::shouldLoadSignatureFromFile()
......@@ -453,19 +453,19 @@ void RichTextComposerNgTest::shouldLoadSignatureFromCommand_data()
QTest::addColumn<KIdentityManagement::Signature::AddedTextFlag>("signatureaddtext");
QTest::newRow("command1") << QStringLiteral("echo \"foo\"") << QStringLiteral("\n")
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("command2") << QStringLiteral("echo \"foo\"") << QStringLiteral("foo ddd \n")
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("command3") << QStringLiteral("echo \"foo\"") << QString()
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("command4") << QStringLiteral("echo \"foo\nsss\"") << QString()
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("command5") << QStringLiteral("echo \"foo\nsss\n\"") << QStringLiteral("foo ddd \n")
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
//Start
QTest::newRow("command6") << QStringLiteral("echo \"foo\nsss\n\"") << QStringLiteral("foo ddd \n")
<< KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
<< KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
//Failed
//QTest::newRow("command7") << QStringLiteral("echo \"foo\nsss\n\"") << QStringLiteral("foo ddd \n")
......
......@@ -370,8 +370,9 @@ QString RichTextComposerNg::toCleanHtml() const
void RichTextComposerNg::forceAutoCorrection(bool selectedText)
{
if (document()->isEmpty())
if (document()->isEmpty()) {
return;
}
if (d->autoCorrection && d->autoCorrection->isEnabledAutoCorrection()) {
const bool richText = (textMode() == RichTextComposer::Rich);
const int initialPosition = textCursor().position();
......
......@@ -232,4 +232,3 @@ PluginEditor *PluginEditorManager::pluginFromIdentifier(const QString &id)
return d->pluginFromIdentifier(id);
}
......@@ -52,7 +52,6 @@ public:
void setIsEnabled(bool enabled);
bool isEnabled() const;
Q_SIGNALS:
void configChanged();
......
......@@ -180,7 +180,6 @@ PluginEditorCheckBeforeSend *PluginEditorCheckBeforeSendManagerPrivate::pluginFr
return {};
}
PluginEditorCheckBeforeSendManager::PluginEditorCheckBeforeSendManager(QObject *parent)
: QObject(parent),
d(new MessageComposer::PluginEditorCheckBeforeSendManagerPrivate(this))
......
......@@ -47,7 +47,6 @@ public:
virtual QString alignment() const;
virtual int elidedTextSize() const;
void setIsEnabled(bool enabled);
bool isEnabled() const;
......
......@@ -107,7 +107,6 @@ QString HeaderStylePluginManagerPrivate::configPrefixSettingKey() const
return QStringLiteral("PluginHeaderStyle");
}
void HeaderStylePluginManagerPrivate::initializePluginList()
{
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("messageviewer"), [](const KPluginMetaData & md) {
......@@ -199,7 +198,6 @@ MessageViewer::HeaderStylePlugin *HeaderStylePluginManagerPrivate::pluginFromIde
return {};
}
HeaderStylePluginManager *HeaderStylePluginManager::self()
{
return sInstance->headerStylePluginManager;
......
......@@ -56,7 +56,6 @@ void WebEnginePartHtmlWriterTest::removeScriptInHtml_data()
QTest::newRow("scriptwithspace-insensitive") << QStringLiteral("<a>boo<SCRIPT type=\"foo\" >alert(1)</SCRIPT ></a>") << QStringLiteral("<a>boo</a>");
QTest::newRow("scriptwithremoveaccess-insensitive") << QStringLiteral("<a>boo<SCRIPT src=\"http://foo\"/></a>") << QStringLiteral("<a>boo</a>");
//MultiLine insensitive
QTest::newRow("multiline-insensitive") << QStringLiteral("<a>boo<sCript>\nalert(1)</Script></a>") << QStringLiteral("<a>boo</a>");
QTest::newRow("multiline-scriptwithspace-insensitive") << QStringLiteral("<a>boo<SCRipT type=\"foo\" >\nalert(1)\n</script ></a>") << QStringLiteral("<a>boo</a>");
......@@ -66,8 +65,8 @@ void WebEnginePartHtmlWriterTest::removeScriptInHtml_data()
void WebEnginePartHtmlWriterTest::removeScriptInHtml()
{
QFETCH (QString, input);
QFETCH (QString, output);
QFETCH(QString, input);
QFETCH(QString, output);
QCOMPARE(MessageViewer::WebEnginePartHtmlWriter::removeJscripts(input), output);
}
......
......@@ -163,7 +163,8 @@ template<typename Arg, typename R, typename C>
struct InvokeWrapper {
R *receiver;
void (C::*memberFun)(Arg);
void operator()(Arg result) {
void operator()(Arg result)
{
(receiver->*memberFun)(result);
}
};
......@@ -2267,8 +2268,9 @@ void ViewerPrivate::slotPrintMessage()
return;
}
#ifdef WEBENGINEVIEWER_PRINT_SUPPORT
if (mCurrentPrinter)
if (mCurrentPrinter) {
return;
}
mCurrentPrinter = new QPrinter();
QPointer<QPrintDialog> dialog = new QPrintDialog(mCurrentPrinter, mMainWindow);
dialog->setWindowTitle(i18n("Print Document"));
......@@ -2291,7 +2293,6 @@ void ViewerPrivate::slotHandlePagePrinted(bool result)
mCurrentPrinter = Q_NULLPTR;
}
void ViewerPrivate::slotSetEncoding()
{
if (mSelectEncodingAction) {
......
......@@ -423,7 +423,6 @@ public:
QList<QAction *> viewerPluginActionList(MessageViewer::ViewerPluginInterface::SpecificFeatureTypes features);
QList<QAction *> interceptorUrlActions(const WebEngineViewer::WebHitTestResult &result) const;
void setPrintElementBackground(bool printElementBackground);
private Q_SLOTS:
......
......@@ -240,8 +240,8 @@ void MailWebEngineView::hideAccessKeys()
bool MailWebEngineView::isScrolledToBottom() const
{
#if QT_VERSION >= 0x050700
qDebug()<<" page position " << page()->scrollPosition().y();
qDebug()<<" content size " << page()->contentsSize().height();
qDebug() << " page position " << page()->scrollPosition().y();
qDebug() << " content size " << page()->contentsSize().height();
#endif
qDebug() << "bool MailWebEngineView::isScrolledToBottom() const not implemented";
//Convert as async
......
......@@ -21,7 +21,6 @@
#include "viewerplugin.h"
#include "messageviewer_debug.h"
#include <KSharedConfig>
#include <kpluginmetadata.h>
#include <KPluginLoader>
......@@ -203,7 +202,6 @@ ViewerPlugin *ViewerPluginManagerPrivate::pluginFromIdentifier(const QString &id
return {};
}
ViewerPluginManager::ViewerPluginManager(QObject *parent)
: QObject(parent),
d(new MessageViewer::ViewerPluginManagerPrivate(this))
......
......@@ -190,7 +190,6 @@ NetworkUrlInterceptorPluginManager *NetworkUrlInterceptorPluginManager::self()
return sInstance->mailNetworkUrlInterceptorPluginManager;
}
NetworkUrlInterceptorPluginManager::NetworkUrlInterceptorPluginManager(QObject *parent)
: QObject(parent),
d(new NetworkUrlInterceptorPluginManagerPrivate(this))
......
Supports Markdown
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