[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim-addons] /: GIT_SILENT: coding style (silent)
From: Montel Laurent <null () kde ! org>
Date: 2017-10-16 5:02:19
Message-ID: E1e3xXf-0006Sy-Hx () code ! kde ! org
[Download RAW message or body]
Git commit 34899ba9559c05b7acf71c3fe55812aa3552a770 by Montel Laurent.
Committed on 16/10/2017 at 05:02.
Pushed by mlaurent into branch 'master'.
GIT_SILENT: coding style
M +0 -2 akonadi-import-wizard/geary/gearyaddressbook.cpp
M +0 -2 examples/apps/coisceim/tripmodel.cpp
M +2 -1 kaddressbook/contacteditor/addresslocationeditorplugin.cpp
M +18 -6 kaddressbook/importexportplugins/csv/import/csvimportdialog.cpp
M +0 -1 kaddressbook/importexportplugins/csv/import/csvimportdialog.h
M +2 -2 kmailtransport/sendmail/sendmailjob.cpp
M +0 -1 plugins/messageviewer/bodypartformatter/autotests/rendertest.h
M +0 -1 plugins/messageviewer/bodypartformatter/calendar/memorycalendarmemento.h
M +4 -3 plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
M +3 -2 plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
M +1 -3 plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h
M +3 -2 plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
M +2 -4 plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h
M +1 -1 plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
M +1 -1 plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
M +3 -3 plugins/messageviewer/bodypartformatter/highlighter/highlighter.cpp
M +19 -15 plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp
M +39 -39 plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp
M +4 -3 plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
M +0 -1 plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.cpp
M +0 -1 plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.h
M +0 -1 plugins/messageviewer/bodypartformatter/vcard/vcardmemento.h
M +1 -0 plugins/messageviewerheaderplugins/enterpriseheaderstyleplugin/enterpriseheaderstyle.h
M +0 -1 plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscripttest.cpp
M +1 -1 plugins/plasma/pimeventsplugin/autotests/testdataparser.cpp
https://commits.kde.org/kdepim-addons/34899ba9559c05b7acf71c3fe55812aa3552a770
diff --git a/akonadi-import-wizard/geary/gearyaddressbook.cpp \
b/akonadi-import-wizard/geary/gearyaddressbook.cpp index 5036fe09..971b4c14 100644
--- a/akonadi-import-wizard/geary/gearyaddressbook.cpp
+++ b/akonadi-import-wizard/geary/gearyaddressbook.cpp
@@ -19,8 +19,6 @@
#include "gearyaddressbook.h"
-
-
GearyAddressBook::GearyAddressBook(const QString &filename)
{
}
diff --git a/examples/apps/coisceim/tripmodel.cpp \
b/examples/apps/coisceim/tripmodel.cpp index 827798c2..48376887 100644
--- a/examples/apps/coisceim/tripmodel.cpp
+++ b/examples/apps/coisceim/tripmodel.cpp
@@ -51,7 +51,6 @@ TripModel::TripModel(Akonadi::Monitor *monitor, QObject *parent)
QTimer::singleShot(0, this, SLOT(repopulate()));
connect(this, SIGNAL(modelReset()), SLOT(thisModelReset()));
-
}
QModelIndex TripModel::index(int row, int column, const QModelIndex &parent) const
@@ -250,7 +249,6 @@ void TripModel::thisRowsRemoved(const QModelIndex &index, int \
start, int end) m_tripWidgets.clear();
}
-
QHash<int, QByteArray> TripModel::roleNames() const
{
QHash<int, QByteArray> roleNames_ = MixedTreeModel::roleNames();
diff --git a/kaddressbook/contacteditor/addresslocationeditorplugin.cpp \
b/kaddressbook/contacteditor/addresslocationeditorplugin.cpp index d3bec642..388f5c77 \
100644
--- a/kaddressbook/contacteditor/addresslocationeditorplugin.cpp
+++ b/kaddressbook/contacteditor/addresslocationeditorplugin.cpp
@@ -23,7 +23,8 @@
#include <QHBoxLayout>
-K_PLUGIN_FACTORY_WITH_JSON(AddressLocationEditorFactory, \
"addresslocationeditorplugin.json", registerPlugin<AddressLocationEditor>();) \
+K_PLUGIN_FACTORY_WITH_JSON(AddressLocationEditorFactory, \
"addresslocationeditorplugin.json", registerPlugin<AddressLocationEditor>(); + \
)
AddressLocationEditor::AddressLocationEditor(QWidget *parent, const QList<QVariant> \
&) : ContactEditor::AbstractAddressLocationWidget(parent)
diff --git a/kaddressbook/importexportplugins/csv/import/csvimportdialog.cpp \
b/kaddressbook/importexportplugins/csv/import/csvimportdialog.cpp index \
d944df4f..95db9cc0 100644
--- a/kaddressbook/importexportplugins/csv/import/csvimportdialog.cpp
+++ b/kaddressbook/importexportplugins/csv/import/csvimportdialog.cpp
@@ -191,12 +191,24 @@ CSVImportDialog::CSVImportDialog(QWidget *parent)
connect(mUrlRequester, QOverload<const QString \
&>::of(&KUrlRequester::returnPressed), this, \
&CSVImportDialog::setFile);
connect(mUrlRequester, &KUrlRequester::urlSelected, this, \
&CSVImportDialog::setUrl);
connect(mUrlRequester->lineEdit(), &QLineEdit::textChanged, this, \
&CSVImportDialog::urlChanged);
- connect(mDelimiterGroup, QOverload<int>::of(&QButtonGroup::buttonClicked), this, \
[this](int val) { delimiterClicked(val); });
- connect(mDelimiterEdit, QOverload<>::of(&QLineEdit::returnPressed), this, \
[this]() { customDelimiterChanged(); });
- connect(mDelimiterEdit, QOverload<const QString &>::of(&QLineEdit::textChanged), \
[this](const QString &str) { customDelimiterChanged(str); });
- connect(mComboQuote, QOverload<const QString &>::of(&KComboBox::activated), \
this, [this](const QString &str) { textQuoteChanged(str); });
- connect(mCodecCombo, QOverload<const QString &>::of(&KComboBox::activated), \
this, [this]() { codecChanged(); });
- connect(mSkipFirstRow, &QCheckBox::toggled, this, [this](bool b) { \
skipFirstRowChanged(b); }); + connect(mDelimiterGroup, \
QOverload<int>::of(&QButtonGroup::buttonClicked), this, [this](int val) { + \
delimiterClicked(val); + });
+ connect(mDelimiterEdit, QOverload<>::of(&QLineEdit::returnPressed), this, \
[this]() { + customDelimiterChanged();
+ });
+ connect(mDelimiterEdit, QOverload<const QString &>::of(&QLineEdit::textChanged), \
[this](const QString &str) { + customDelimiterChanged(str);
+ });
+ connect(mComboQuote, QOverload<const QString &>::of(&KComboBox::activated), \
this, [this](const QString &str) { + textQuoteChanged(str);
+ });
+ connect(mCodecCombo, QOverload<const QString &>::of(&KComboBox::activated), \
this, [this]() { + codecChanged();
+ });
+ connect(mSkipFirstRow, &QCheckBox::toggled, this, [this](bool b) {
+ skipFirstRowChanged(b);
+ });
connect(mModel, &QCsvModel::finishedLoading, this, \
&CSVImportDialog::modelFinishedLoading);
diff --git a/kaddressbook/importexportplugins/csv/import/csvimportdialog.h \
b/kaddressbook/importexportplugins/csv/import/csvimportdialog.h index \
b33f745b..c1336a17 100644
--- a/kaddressbook/importexportplugins/csv/import/csvimportdialog.h
+++ b/kaddressbook/importexportplugins/csv/import/csvimportdialog.h
@@ -22,7 +22,6 @@
#include <kaddressbookimportexport/kaddressbookimportexportcontactfields.h>
-
#include <QDialog>
#include <QList>
diff --git a/kmailtransport/sendmail/sendmailjob.cpp \
b/kmailtransport/sendmail/sendmailjob.cpp index a1296b67..29e78606 100644
--- a/kmailtransport/sendmail/sendmailjob.cpp
+++ b/kmailtransport/sendmail/sendmailjob.cpp
@@ -35,10 +35,10 @@ SendmailJob::SendmailJob(Transport *transport, QObject *parent)
: TransportJob(transport, parent)
{
mProcess = new QProcess(this);
- connect(mProcess, QOverload<int,QProcess::ExitStatus>::of(&QProcess::finished), \
this, &SendmailJob::sendmailExited); + connect(mProcess, QOverload<int, \
QProcess::ExitStatus>::of(&QProcess::finished), this, \
&SendmailJob::sendmailExited);
connect(mProcess, QOverload<QProcess::ProcessError>::of(&QProcess::error),
this, &SendmailJob::receivedError);
- connect(mProcess, &QProcess::readyReadStandardError, this, \
&SendmailJob::receivedStdErr); + connect(mProcess, \
&QProcess::readyReadStandardError, this, &SendmailJob::receivedStdErr); }
SendmailJob::~SendmailJob()
diff --git a/plugins/messageviewer/bodypartformatter/autotests/rendertest.h \
b/plugins/messageviewer/bodypartformatter/autotests/rendertest.h index \
9f80155c..1f91c500 100644
--- a/plugins/messageviewer/bodypartformatter/autotests/rendertest.h
+++ b/plugins/messageviewer/bodypartformatter/autotests/rendertest.h
@@ -32,7 +32,6 @@ private Q_SLOTS:
private:
void compareFile(const QString &outFile, const QString &referenceFile);
-
};
#endif
diff --git a/plugins/messageviewer/bodypartformatter/calendar/memorycalendarmemento.h \
b/plugins/messageviewer/bodypartformatter/calendar/memorycalendarmemento.h index \
52f576b2..96378af6 100644
--- a/plugins/messageviewer/bodypartformatter/calendar/memorycalendarmemento.h
+++ b/plugins/messageviewer/bodypartformatter/calendar/memorycalendarmemento.h
@@ -42,7 +42,6 @@ Q_SIGNALS:
// TODO: Factor our update and detach into base class
void update(MimeTreeParser::UpdateMode);
-
private:
void slotCalendarLoaded(bool success, const QString &errorMessage);
void finalize();
diff --git a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp \
b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp index \
aa137921..a31bc15d 100644
--- a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
+++ b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
@@ -184,12 +184,13 @@ private:
class Formatter : public MessageViewer::MessagePartRendererBase
{
public:
- bool render(const MimeTreeParser::MessagePartPtr &msgPart, \
MimeTreeParser::HtmlWriter* writer, MessageViewer::RenderContext*) const override + \
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter \
*writer, MessageViewer::RenderContext *) const override {
QMimeDatabase db;
auto mt = db.mimeTypeForName(QString::fromLatin1(msgPart->content()->contentType()->mimeType().toLower()));
- if (!mt.isValid() || mt.name() != QLatin1String("text/calendar"))
+ if (!mt.isValid() || mt.name() != QLatin1String("text/calendar")) {
return false;
+ }
auto nodeHelper = msgPart->nodeHelper();
if (!nodeHelper) {
@@ -1483,7 +1484,7 @@ class Plugin : public QObject, public \
MessageViewer::MessagePartRenderPlugin \
Q_INTERFACES(MessageViewer::MessagePartRenderPlugin)
Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE \
"text_calendar.json") public:
- MessageViewer::MessagePartRendererBase* renderer(int idx) override
+ MessageViewer::MessagePartRendererBase *renderer(int idx) override
{
if (idx < 2) {
return new Formatter();
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp \
b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp index \
52c25a88..e1628937 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
@@ -85,12 +85,13 @@ MessagePart::Ptr ApplicationGnuPGWKSFormatter::process(BodyPart \
&part) const return {};
}
-bool ApplicationGnuPGWKSFormatter::render(const MimeTreeParser::MessagePartPtr& \
msgPart, MimeTreeParser::HtmlWriter* htmlWriter, MessageViewer::RenderContext* \
context) const +bool ApplicationGnuPGWKSFormatter::render(const \
MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, \
MessageViewer::RenderContext *context) const {
Q_UNUSED(context);
auto mp = msgPart.dynamicCast<GnuPGWKSMessagePart>();
- if (!mp)
+ if (!mp) {
return false;
+ }
const QByteArray propertyName = "_GnuPGWKS" + mp->fingerprint().toLatin1();
const bool hasError = (mp->nodeHelper()->property(propertyName).toString() == \
QLatin1String("error"));
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h \
b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h index \
69806700..74c4b389 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h
@@ -26,9 +26,7 @@
class GnuPGWKSMessagePart;
class GnuPGWKSMemento;
-class ApplicationGnuPGWKSFormatter
- : public MimeTreeParser::Interface::BodyPartFormatter
- , public MessageViewer::MessagePartRendererBase
+class ApplicationGnuPGWKSFormatter : public \
MimeTreeParser::Interface::BodyPartFormatter, public \
MessageViewer::MessagePartRendererBase {
public:
ApplicationGnuPGWKSFormatter() = default;
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp \
b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp index \
29d6ac1a..177486d1 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
@@ -35,7 +35,7 @@
using namespace MimeTreeParser::Interface;
-MimeTreeParser::MessagePartPtr \
ApplicationPGPKeyFormatter::process(MimeTreeParser::Interface::BodyPart& part) const \
+MimeTreeParser::MessagePartPtr \
ApplicationPGPKeyFormatter::process(MimeTreeParser::Interface::BodyPart &part) const \
{ auto mp = new PgpKeyMessagePart(&part);
PgpKeyMemento *m = dynamic_cast<PgpKeyMemento *>(mp->memento());
@@ -69,8 +69,9 @@ bool ApplicationPGPKeyFormatter::render(const \
MimeTreeParser::MessagePartPtr &ms {
Q_UNUSED(context);
auto mp = msgPart.dynamicCast<PgpKeyMessagePart>();
- if (!mp)
+ if (!mp) {
return false;
+ }
GrantleeTheme::Engine engine;
engine.localizer()->setApplicationDomain(QByteArrayLiteral("messageviewer_application_gnupgwks_plugin"));
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h \
b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h index \
17cd405a..4ee35051 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h
@@ -25,14 +25,12 @@
class PgpKeyMessagePart;
-class ApplicationPGPKeyFormatter
- : public MimeTreeParser::Interface::BodyPartFormatter
- , public MessageViewer::MessagePartRendererBase
+class ApplicationPGPKeyFormatter : public \
MimeTreeParser::Interface::BodyPartFormatter, public \
MessageViewer::MessagePartRendererBase {
public:
ApplicationPGPKeyFormatter() = default;
- MimeTreeParser::MessagePartPtr process(MimeTreeParser::Interface::BodyPart & \
part) const override; + MimeTreeParser::MessagePartPtr \
process(MimeTreeParser::Interface::BodyPart &part) const override;
bool render(const MimeTreeParser::MessagePartPtr &msgPart, \
MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const \
override;
private:
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp \
b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp index \
452cef0c..e65dd425 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
@@ -45,7 +45,7 @@ const MimeTreeParser::Interface::BodyPartFormatter \
*ApplicationGnuPGWKSPlugin::b }
}
-MessageViewer::MessagePartRendererBase* ApplicationGnuPGWKSPlugin::renderer(int idx)
+MessageViewer::MessagePartRendererBase *ApplicationGnuPGWKSPlugin::renderer(int idx)
{
switch (idx) {
case multipart_mixed:
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h \
b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h index 126b4000..6ee239ee \
100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
@@ -33,7 +33,7 @@ public:
ApplicationGnuPGWKSPlugin() = default;
const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) \
const override;
- MessageViewer::MessagePartRendererBase* renderer(int index) override;
+ MessageViewer::MessagePartRendererBase *renderer(int index) override;
const MessageViewer::Interface::BodyPartURLHandler *urlHandler(int idx) const \
override; };
diff --git a/plugins/messageviewer/bodypartformatter/highlighter/highlighter.cpp \
b/plugins/messageviewer/bodypartformatter/highlighter/highlighter.cpp index \
17e37a50..d4d27227 100644
--- a/plugins/messageviewer/bodypartformatter/highlighter/highlighter.cpp
+++ b/plugins/messageviewer/bodypartformatter/highlighter/highlighter.cpp
@@ -47,9 +47,9 @@ void Highlighter::highlight(const QString &str)
*mStream << QLatin1Char('\n');
}
if (lineStart < str.size()) { // remaining content if str isn't ending with a \
newline
- mCurrentLine = str.mid(lineStart);
- state = highlightLine(mCurrentLine, state);
- *mStream << QLatin1Char('\n');
+ mCurrentLine = str.mid(lineStart);
+ state = highlightLine(mCurrentLine, state);
+ *mStream << QLatin1Char('\n');
}
*mStream << QLatin1String("</pre>\n");
}
diff --git a/plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp \
b/plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp index \
399ab987..eb08245b 100644
--- a/plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp
+++ b/plugins/messageviewer/bodypartformatter/highlighter/texthighlighterplugin.cpp
@@ -50,7 +50,6 @@
#include <QPalette>
namespace {
-
class Formatter : public MessageViewer::MessagePartRendererBase
{
public:
@@ -58,30 +57,34 @@ public:
{
Q_UNUSED(context);
auto mp = msgPart.dynamicCast<MimeTreeParser::AttachmentMessagePart>();
- if (!mp || mp->isHidden() || mp->text().isEmpty() || mp->asIcon() != \
MimeTreeParser::NoIcon) + if (!mp || mp->isHidden() || mp->text().isEmpty() || \
mp->asIcon() != MimeTreeParser::NoIcon) { return false;
+ }
QMimeDatabase db;
auto mt = db.mimeTypeForName(QString::fromLatin1(msgPart->content()->contentType()->mimeType().toLower()));
- if (!mt.isValid())
+ if (!mt.isValid()) {
return false;
- if (mt.name() != QLatin1String("text/plain") && \
!mt.allAncestors().contains(QLatin1String("text/plain"))) + }
+ if (mt.name() != QLatin1String("text/plain") && \
!mt.allAncestors().contains(QLatin1String("text/plain"))) { return false;
+ }
const auto def = mRepo.definitionForFileName(mp->label());
- if (!def.isValid())
+ if (!def.isValid()) {
return false;
+ }
auto c = MessageViewer::MessagePartRendererManager::self()->createContext();
c.insert(QStringLiteral("block"), msgPart.data());
- c.insert(QStringLiteral("content"), \
QVariant::fromValue<MessageViewer::GrantleeCallback>([=](Grantlee::OutputStream*) \
{
- Highlighter highLighter(htmlWriter->stream());
- highLighter.setDefinition(def);
- highLighter.setTheme(QGuiApplication::palette().color(QPalette::Base).lightness() \
< 128
- ? mRepo.defaultTheme(KSyntaxHighlighting::Repository::DarkTheme)
- : mRepo.defaultTheme(KSyntaxHighlighting::Repository::LightTheme));
- highLighter.highlight(msgPart->text());
- }));
+ c.insert(QStringLiteral("content"), \
QVariant::fromValue<MessageViewer::GrantleeCallback>([=](Grantlee::OutputStream *) { \
+ Highlighter highLighter(htmlWriter->stream()); + \
highLighter.setDefinition(def); + \
highLighter.setTheme(QGuiApplication::palette().color(QPalette::Base).lightness() < \
128 + ? \
mRepo.defaultTheme(KSyntaxHighlighting::Repository::DarkTheme) + \
: mRepo.defaultTheme(KSyntaxHighlighting::Repository::LightTheme)); + \
highLighter.highlight(msgPart->text()); + }));
auto t = MessageViewer::MessagePartRendererManager::self()->loadByName(QStringLiteral(":/textmessagepart.html"));
Grantlee::OutputStream s(htmlWriter->stream());
@@ -99,10 +102,11 @@ class Plugin : public QObject, public \
MessageViewer::MessagePartRenderPlugin \
Q_INTERFACES(MessageViewer::MessagePartRenderPlugin)
Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE \
"texthighlighterplugin.json") public:
- MessageViewer::MessagePartRendererBase* renderer(int index) override
+ MessageViewer::MessagePartRendererBase *renderer(int index) override
{
- if (index == 0)
+ if (index == 0) {
return new Formatter();
+ }
return nullptr;
}
};
diff --git a/plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp \
b/plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp index \
a16fb4d7..a4d478f4 100644
--- a/plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp
+++ b/plugins/messageviewer/bodypartformatter/ms-tnef/application_ms-tnef.cpp
@@ -73,8 +73,8 @@ public:
return false;
}
- if (mp->content()->contentType()->mimeType() != \
QByteArrayLiteral("application/vnd.ms-tnef") &&
- mp->content()->contentType()->mimeType() != \
QByteArrayLiteral("application/ms-tnef")) { + if \
(mp->content()->contentType()->mimeType() != \
QByteArrayLiteral("application/vnd.ms-tnef") + && \
mp->content()->contentType()->mimeType() != QByteArrayLiteral("application/ms-tnef")) \
{ return false;
}
@@ -113,46 +113,46 @@ public:
auto c = MessageViewer::MessagePartRendererManager::self()->createContext();
c.insert(QStringLiteral("block"), msgPart.data());
c.insert(QStringLiteral("content"), \
QVariant::fromValue<MessageViewer::GrantleeCallback>([&](Grantlee::OutputStream \
*stream) {
- const auto tnefatts = parser.message()->attachmentList();
- if (tnefatts.isEmpty() && inviteStr.isEmpty()) {
- qCDebug(MS_TNEF_LOG) << "No attachments or invitation found in" << \
fileName;
- (*stream) << QStringLiteral(" <") << i18nc("TNEF attachment \
has no content", "empty") << QStringLiteral(">");
- return;
- }
-
- if (!inviteStr.isEmpty()) {
- (*stream) << inviteStr;
- }
-
- const int numberOfTnef(tnefatts.count());
- for (int i = 0; i < numberOfTnef; ++i) {
- KTnef::KTNEFAttach *att = tnefatts.at(i);
- QString label = att->displayName();
- if (label.isEmpty()) {
- label = att->name();
+ const auto tnefatts = parser.message()->attachmentList();
+ if (tnefatts.isEmpty() && inviteStr.isEmpty()) {
+ qCDebug(MS_TNEF_LOG) << "No attachments or invitation found in" \
<< fileName; + (*stream) << QStringLiteral(" <") << \
i18nc("TNEF attachment has no content", "empty") << QStringLiteral(">"); + \
return; }
- label = MessageCore::StringUtil::quoteHtmlChars(label, true);
- const QString dir = \
mp->nodeHelper()->createTempDir(QStringLiteral("ktnef-") + \
QString::number(i));
- parser.extractFileTo(att->name(), dir);
-
- // falling back to internal TNEF attachement name if no filename is \
given for the attached file
- // this follows the logic of KTNEFParser::extractFileTo(...)
- QString attFileName = att->fileName();
- if (attFileName.isEmpty()) {
- attFileName = att->name();
+ if (!inviteStr.isEmpty()) {
+ (*stream) << inviteStr;
}
- mp->nodeHelper()->addTempFile(dir + QDir::separator() + \
attFileName);
- const QString href = QStringLiteral("file:") + dir + \
QDir::separator() + attFileName;
-
- const QString iconName = \
QUrl::fromLocalFile(MessageViewer::Util::iconPathForMimetype(att->mimeTag(),
- \
KIconLoader::Desktop, attFileName)).url();
- (*stream) << QStringLiteral("<div><a href=\"") << href << \
QStringLiteral("\"><img src=\"")
- << iconName << QStringLiteral("\" border=\"0\" \
style=\"max-width: 100%\"/>") << label
- << QStringLiteral("</a></div><br/>");
- }
- }));
+ const int numberOfTnef(tnefatts.count());
+ for (int i = 0; i < numberOfTnef; ++i) {
+ KTnef::KTNEFAttach *att = tnefatts.at(i);
+ QString label = att->displayName();
+ if (label.isEmpty()) {
+ label = att->name();
+ }
+ label = MessageCore::StringUtil::quoteHtmlChars(label, true);
+
+ const QString dir = \
mp->nodeHelper()->createTempDir(QStringLiteral("ktnef-") + QString::number(i)); + \
parser.extractFileTo(att->name(), dir); +
+ // falling back to internal TNEF attachement name if no filename \
is given for the attached file + // this follows the logic of \
KTNEFParser::extractFileTo(...) + QString attFileName = \
att->fileName(); + if (attFileName.isEmpty()) {
+ attFileName = att->name();
+ }
+ mp->nodeHelper()->addTempFile(dir + QDir::separator() + \
attFileName); + const QString href = QStringLiteral("file:") + dir \
+ QDir::separator() + attFileName; +
+ const QString iconName = \
QUrl::fromLocalFile(MessageViewer::Util::iconPathForMimetype(att->mimeTag(), + \
KIconLoader::Desktop, attFileName)).url(); +
+ (*stream) << QStringLiteral("<div><a href=\"") << href << \
QStringLiteral("\"><img src=\"") + << iconName << \
QStringLiteral("\" border=\"0\" style=\"max-width: 100%\"/>") << label + \
<< QStringLiteral("</a></div><br/>"); + }
+ }));
auto t = MessageViewer::MessagePartRendererManager::self()->loadByName(QStringLiteral(":/textmessagepart.html"));
Grantlee::OutputStream s(htmlWriter->stream());
@@ -167,7 +167,7 @@ class Plugin : public QObject, public \
MessageViewer::MessagePartRenderPlugin \
Q_INTERFACES(MessageViewer::MessagePartRenderPlugin)
Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE \
"application_ms-tnef.json") public:
- MessageViewer::MessagePartRendererBase* renderer(int index) override
+ MessageViewer::MessagePartRendererBase *renderer(int index) override
{
return index == 0 ? new Formatter() : nullptr;
}
diff --git a/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp \
b/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp index \
5082c805..b8f64227 100644
--- a/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
+++ b/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
@@ -71,12 +71,13 @@ class Formatter : public MessageViewer::MessagePartRendererBase
public:
Formatter() = default;
- bool render(const MimeTreeParser::MessagePartPtr &msgPart, \
MimeTreeParser::HtmlWriter *writer, MessageViewer::RenderContext*) const override + \
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter \
*writer, MessageViewer::RenderContext *) const override {
QMimeDatabase db;
auto mt = db.mimeTypeForName(QString::fromLatin1(msgPart->content()->contentType()->mimeType().toLower()));
- if (!mt.isValid() || mt.name() != QLatin1String("text/vcard"))
+ if (!mt.isValid() || mt.name() != QLatin1String("text/vcard")) {
return false;
+ }
const QString vCard = msgPart->text();
if (vCard.isEmpty()) {
@@ -309,7 +310,7 @@ class Plugin : public QObject, public \
MessageViewer::MessagePartRenderPlugin \
Q_INTERFACES(MessageViewer::MessagePartRenderPlugin)
Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE \
"text_vcard.json") public:
- MessageViewer::MessagePartRendererBase* renderer(int index) override
+ MessageViewer::MessagePartRendererBase *renderer(int index) override
{
return validIndex(index) ? new Formatter() : nullptr;
}
diff --git a/plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.cpp \
b/plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.cpp index \
6e8b7474..40026d95 100644
--- a/plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.cpp
+++ b/plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.cpp
@@ -85,7 +85,6 @@ void UpdateContactJob::slotUpdateContactDone(KJob *job)
emitResult();
}
-
void UpdateContactJob::start()
{
if (mEmail.isEmpty()) {
diff --git a/plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.h \
b/plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.h index \
901286ec..6fbcf656 100644
--- a/plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.h
+++ b/plugins/messageviewer/bodypartformatter/vcard/updatecontactjob.h
@@ -40,7 +40,6 @@ private:
QString mEmail;
KContacts::Addressee mContact;
QWidget *mParentWidget = nullptr;
-
};
#endif // UPDATECONTACTJOB_H
diff --git a/plugins/messageviewer/bodypartformatter/vcard/vcardmemento.h \
b/plugins/messageviewer/bodypartformatter/vcard/vcardmemento.h index \
4b72a9da..51f9a71a 100644
--- a/plugins/messageviewer/bodypartformatter/vcard/vcardmemento.h
+++ b/plugins/messageviewer/bodypartformatter/vcard/vcardmemento.h
@@ -61,7 +61,6 @@ public:
KContacts::Addressee address(int index) const;
-
Q_SIGNALS:
// TODO: Factor our update and detach into base class
void update(MimeTreeParser::UpdateMode);
diff --git a/plugins/messageviewerheaderplugins/enterpriseheaderstyleplugin/enterpriseheaderstyle.h \
b/plugins/messageviewerheaderplugins/enterpriseheaderstyleplugin/enterpriseheaderstyle.h
index c8c71911..eb6d11f2 100644
--- a/plugins/messageviewerheaderplugins/enterpriseheaderstyleplugin/enterpriseheaderstyle.h
+++ b/plugins/messageviewerheaderplugins/enterpriseheaderstyleplugin/enterpriseheaderstyle.h
@@ -33,6 +33,7 @@ public:
~EnterpriseHeaderStyle()
{
}
+
const char *name() const override;
QString format(KMime::Message *message) const override;
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscripttest.cpp \
b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscripttest.cpp
index c521eadf..65e1ff48 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscripttest.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscripttest.cpp
@@ -19,7 +19,6 @@
#include "viewerpluginexternalscripttest.h"
-
ViewerPluginExternalscriptTest::ViewerPluginExternalscriptTest(QObject *parent)
: QObject(parent)
{
diff --git a/plugins/plasma/pimeventsplugin/autotests/testdataparser.cpp \
b/plugins/plasma/pimeventsplugin/autotests/testdataparser.cpp index \
fb03192e..37af295c 100644
--- a/plugins/plasma/pimeventsplugin/autotests/testdataparser.cpp
+++ b/plugins/plasma/pimeventsplugin/autotests/testdataparser.cpp
@@ -82,7 +82,7 @@ KCalCore::Incidence::Ptr TestDataParser::incidence() const
QDateTime TestDataParser::parseDateTime(const QJsonObject &dateTime)
{
const auto date = QDate::fromString(dateTime[QStringLiteral("date")].toString(), \
Qt::ISODate);
- const auto time = QTime::fromString(dateTime[QStringLiteral("time")].toString(), \
Qt::ISODate); + const auto time = \
QTime::fromString(dateTime[QStringLiteral("time")].toString(), Qt::ISODate); if \
(dateTime.contains(QLatin1String("tz"))) {
return QDateTime(date, time, \
QTimeZone(dateTime[QStringLiteral("tz")].toString().toLatin1())).toLocalTime(); } \
else {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic