Commit 4cd85f47 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: coding style

parent b59b7450
Pipeline #32630 failed with stage
in 86 minutes and 13 seconds
......@@ -527,9 +527,9 @@ void RichTextComposerNgTest::fixHtmlFontSizeTest()
richtextComposerNg.fixHtmlFontSize(str);
const QString expected(QStringLiteral(
"<span style=\"color: green; font-size:0.83em;\">int font</span> size\n"
"<span style=\"font-size:0.9em; font-family: foo;\">double font</span> size\n"
"<span style=\"font-size: 15,2pt;\">invalid font</span> size, left as is\n"));
"<span style=\"color: green; font-size:0.83em;\">int font</span> size\n"
"<span style=\"font-size:0.9em; font-family: foo;\">double font</span> size\n"
"<span style=\"font-size: 15,2pt;\">invalid font</span> size, left as is\n"));
QCOMPARE(str, expected);
}
......@@ -538,9 +538,9 @@ void RichTextComposerNgTest::toCleanHtmlRegexTest()
{
MessageComposer::RichTextComposerNg richtextComposerNg;
richtextComposerNg.setHtml(QStringLiteral(
"<p style=\"-qt-paragraph-type:empty\"></p>\n"
"<p>some text</p>\n"
"<p style=\"-qt-paragraph-type:empty\"></p>\n"));
"<p style=\"-qt-paragraph-type:empty\"></p>\n"
"<p>some text</p>\n"
"<p style=\"-qt-paragraph-type:empty\"></p>\n"));
const QString result = richtextComposerNg.toCleanHtml();
const int idx = result.indexOf(QStringLiteral("<p style=\"-qt-paragraph-type:empty"));
......
......@@ -33,7 +33,7 @@ public:
void fixHtmlFontSize(QString &cleanHtml) const;
Q_REQUIRED_RESULT QString toCleanHtml() const;
PimCommon::AutoCorrection *autoCorrection = nullptr;
RichTextComposerNg * const richtextComposer;
RichTextComposerNg *const richtextComposer;
MessageComposer::RichTextComposerSignatures *richTextComposerSignatures = nullptr;
};
......
......@@ -37,6 +37,7 @@ public:
: JobBasePrivate(qq)
{
}
~ComposerPrivate()
{
//delete skeletonMessage;
......
......@@ -704,7 +704,7 @@ QPair< KMime::Message::Ptr, KMime::Content * > MessageFactoryNG::createForwardDi
KMime::Content *digest = new KMime::Content(msg.data());
const QString mainPartText = i18n("\nThis is a MIME digest forward. The content of the"
" message is contained in the attachment(s).\n\n\n");
" message is contained in the attachment(s).\n\n\n");
digest->contentType()->setMimeType("multipart/digest");
digest->contentType()->setBoundary(KMime::multiPartBoundary());
......
......@@ -240,7 +240,6 @@ void EncryptJob::process()
setError(result.error().code());
setErrorText(QString::fromLocal8Bit(result.error().asString()));
emitResult();
return;
Please register or sign in to reply
}
d->resultContent = MessageComposer::Util::composeHeadersAndBody(d->content, cipherText, d->format, false);
......
......@@ -26,6 +26,7 @@ public:
: ContentJobBasePrivate(qq)
{
}
~SinglepartJobPrivate()
{
delete contentTransferEncoding;
......
......@@ -51,7 +51,6 @@ enum VariableType {
Q_REQUIRED_RESULT MESSAGECOMPOSER_EXPORT QString snippetVariableFromEnum(MessageComposer::ConvertSnippetVariablesUtil::VariableType type);
Q_REQUIRED_RESULT MESSAGECOMPOSER_EXPORT QString shortDate();
Q_REQUIRED_RESULT MESSAGECOMPOSER_EXPORT QString longDate();
Q_REQUIRED_RESULT MESSAGECOMPOSER_EXPORT QString shortTime();
......
......@@ -127,7 +127,8 @@ void MessageComposer::Util::makeToplevelContentType(KMime::Content *content, Kle
switch (format) {
default:
case Kleo::InlineOpenPGPFormat:
case Kleo::OpenPGPMIMEFormat: {
case Kleo::OpenPGPMIMEFormat:
{
auto ct = content->contentType(); //Create
if (sign) {
ct->setMimeType(QByteArrayLiteral("multipart/signed"));
......@@ -139,7 +140,8 @@ void MessageComposer::Util::makeToplevelContentType(KMime::Content *content, Kle
}
}
return;
case Kleo::SMIMEFormat: {
case Kleo::SMIMEFormat:
{
if (sign) {
auto ct = content->contentType(); //Create
qCDebug(MESSAGECOMPOSER_LOG) << "setting headers for SMIME";
......@@ -171,7 +173,8 @@ void MessageComposer::Util::makeToplevelContentType(KMime::Content *content, Kle
void MessageComposer::Util::setNestedContentType(KMime::Content *content, Kleo::CryptoMessageFormat format, bool sign)
{
switch (format) {
case Kleo::OpenPGPMIMEFormat: {
case Kleo::OpenPGPMIMEFormat:
{
auto ct = content->contentType(); //Create
if (sign) {
ct->setMimeType(QByteArrayLiteral("application/pgp-signature"));
......@@ -182,7 +185,8 @@ void MessageComposer::Util::setNestedContentType(KMime::Content *content, Kleo::
}
}
return;
case Kleo::SMIMEFormat: {
case Kleo::SMIMEFormat:
{
if (sign) {
auto ct = content->contentType(); //Create
ct->setMimeType(QByteArrayLiteral("application/pkcs7-signature"));
......
......@@ -601,12 +601,12 @@ void StringUtilTest::test_replaceMessagePrefix_data()
<< QStringLiteral("New_Prefix: Hello World Subject");
QTest::newRow("Default Reply Re :, no replace") << QStringLiteral("Re : Hello World Subject")
<< false << QStringLiteral("New_Prefix:")
<< QStringLiteral("Re : Hello World Subject");
<< false << QStringLiteral("New_Prefix:")
<< QStringLiteral("Re : Hello World Subject");
QTest::newRow("Default Reply Re1:") << QStringLiteral("Re1: Hello World Subject")
<< true << QStringLiteral("New_Prefix:")
<< QStringLiteral("New_Prefix: Hello World Subject");
<< true << QStringLiteral("New_Prefix:")
<< QStringLiteral("New_Prefix: Hello World Subject");
QTest::newRow("Default Reply Re1:, no replace") << QStringLiteral("Re1: Hello World Subject")
<< false << QStringLiteral("New_Prefix:")
......
......@@ -127,7 +127,6 @@ if (property == QLatin1String("nameOnly")) {
}
GRANTLEE_END_LOOKUP
namespace Grantlee {
template<>
inline QVariant TypeAccessor<QDateTime &>::lookUp(const QDateTime &object, const QString &property)
......@@ -353,8 +352,7 @@ QString GrantleeHeaderFormatter::toHtml(const QStringList &displayExtraHeaders,
return format(absolutPath, headerTemplate, displayExtraHeaders, isPrinting, style, message);
}
QString GrantleeHeaderFormatter::format(const QString &absolutePath, const Grantlee::Template &headerTemplate, const QStringList &displayExtraHeaders,
bool isPrinting, const MessageViewer::HeaderStyle *style, KMime::Message *message, bool showEmoticons) const
QString GrantleeHeaderFormatter::format(const QString &absolutePath, const Grantlee::Template &headerTemplate, const QStringList &displayExtraHeaders, bool isPrinting, const MessageViewer::HeaderStyle *style, KMime::Message *message, bool showEmoticons) const
{
QVariantHash headerObject;
const auto nodeHelper = style->nodeHelper();
......
/*
/*
SPDX-FileCopyrightText: 2010 Volker Krause <vkrause@kde.org>
SPDX-FileCopyrightText: 2016 Sandro Knauß <sknauss@kde.org>
......
......@@ -75,9 +75,9 @@ void MessageViewer::Test::compareFile(const QString &outFile, const QString &ref
QProcess proc;
#ifdef _WIN32
args = QStringList()
<< QStringLiteral("Compare-Object")
<< QString(QStringLiteral("(Get-Content %1)")).arg(referenceFile)
<< QString(QStringLiteral("(Get-Content %1)")).arg(htmlFile);
<< QStringLiteral("Compare-Object")
<< QString(QStringLiteral("(Get-Content %1)")).arg(referenceFile)
<< QString(QStringLiteral("(Get-Content %1)")).arg(htmlFile);
proc.start(QStringLiteral("powershell"), args);
QVERIFY(proc.waitForFinished());
......@@ -92,14 +92,13 @@ void MessageViewer::Test::compareFile(const QString &outFile, const QString &ref
#else
// compare to reference file
args = QStringList()
<< QStringLiteral("-u")
<< referenceFile
<< htmlFile;
<< QStringLiteral("-u")
<< referenceFile
<< htmlFile;
proc.setProcessChannelMode(QProcess::ForwardedChannels);
proc.start(QStringLiteral("diff"), args);
QVERIFY(proc.waitForFinished());
QCOMPARE(proc.exitCode(), 0);
#endif
}
......@@ -153,7 +153,7 @@ void ScamDetectionWebEngineTest::scamtest_data()
QTest::newRow("urlwithport") << QStringLiteral(
"<a href=\"https://example.com:443/blablabla\">https://example.com:443/blablabla</a>")
<< false;
<< false;
}
void ScamDetectionWebEngineTest::scamtest()
......
......@@ -55,7 +55,7 @@ void ScamExpandUrlJob::expandedUrl(const QUrl &url)
{
if (!PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline()) {
PimCommon::BroadcastStatus::instance()->setStatusMsg(i18n(
"No network connection detected, we cannot expand url."));
"No network connection detected, we cannot expand url."));
deleteLater();
return;
}
......@@ -74,7 +74,6 @@ void ScamExpandUrlJob::expandedUrl(const QUrl &url)
qOverload<QNetworkReply::NetworkError>(&QNetworkReply::errorOccurred), this,
&ScamExpandUrlJob::slotError);
#endif
}
void ScamExpandUrlJob::slotExpandFinished(QNetworkReply *reply)
......@@ -96,16 +95,16 @@ void ScamExpandUrlJob::slotExpandFinished(QNetworkReply *reply)
} else {
qCWarning(MESSAGEVIEWER_LOG) << "JSon is not corect" << ba;
PimCommon::BroadcastStatus::instance()->setStatusMsg(i18n("Impossible to expand \'%1\'.",
shortUrl.url()));
shortUrl.url()));
deleteLater();
return;
}
PimCommon::BroadcastStatus::instance()->setStatusMsg(i18n("Short url \'%1\' redirects to \'%2\'.",
shortUrl.url(),
longUrl.toDisplayString()));
shortUrl.url(),
longUrl.toDisplayString()));
} else {
PimCommon::BroadcastStatus::instance()->setStatusMsg(i18n("Impossible to expand \'%1\'.",
shortUrl.url()));
shortUrl.url()));
}
deleteLater();
}
......
......@@ -39,7 +39,6 @@ void MessageViewerUtilsTest::shouldExcludeHeader()
QCOMPARE(MessageViewer::Util::excludeExtraHeader(header), exclude);
}
void MessageViewerUtilsTest::shouldContainsExternalReferences_data()
{
QTest::addColumn<QString>("filename");
......
......@@ -271,7 +271,6 @@ public:
Q_REQUIRED_RESULT QAction *resetMessageDisplayFormatAction() const;
Q_REQUIRED_RESULT QAction *shareTextAction() const;
Q_REQUIRED_RESULT QAction *developmentToolsAction() const;
Q_REQUIRED_RESULT KToggleAction *disableEmoticonAction() const;
Q_REQUIRED_RESULT KActionMenu *shareServiceUrlMenu() const;
......
......@@ -180,7 +180,6 @@ ViewerPrivate::ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollec
+ QByteArray::number(reinterpret_cast<quintptr>(this)), this))
, mPreviouslyViewedItemId(-1)
{
if (!mainWindow) {
mMainWindow = aParent;
}
......@@ -1335,7 +1334,6 @@ void ViewerPrivate::setMessagePart(KMime::Content *node)
parseContent(node);
htmlWriter()->write(cssHelper()->endBodyHtml());
htmlWriter()->end();
}
......@@ -2351,7 +2349,6 @@ void ViewerPrivate::exportToPdf(const QString &fileName)
job->setEngineView(mViewer);
job->setPdfPath(fileName);
job->start();
}
void ViewerPrivate::slotOpenInBrowser()
......
......@@ -12,7 +12,6 @@ QTEST_MAIN(BlockExternalResourcesUrlInterceptorTest)
BlockExternalResourcesUrlInterceptorTest::BlockExternalResourcesUrlInterceptorTest(QObject *parent)
: QObject(parent)
{
}
void BlockExternalResourcesUrlInterceptorTest::shouldIntercept()
......
......@@ -56,7 +56,6 @@ bool BlockExternalResourcesUrlInterceptor::interceptRequest(const QString &schem
return true;
}
return false;
}
bool BlockExternalResourcesUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
......
......@@ -30,7 +30,7 @@ bool CidReferencesUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &inf
if (urlRequestUrl.scheme() == QLatin1String("cid")) {
if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage) {
const QUrl newUrl = QUrl(MessageViewer::WebEngineEmbedPart::self()->contentUrl(
urlRequestUrl.path()));
urlRequestUrl.path()));
if (!newUrl.isEmpty()) {
#ifdef LOAD_FROM_FILE
QImage image(newUrl.path());
......
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