summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-10 06:15:39 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-10 06:15:39 (GMT)
commit3c1afccd662eb907996ebc16b53530ce3006975d (patch)
tree3e116bb93cd707157c26f95af59ebc390211f11b
parent91b894103cc5104af8e624748f0da4d7011fdbe4 (diff)
Astyle kdelibs
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp6
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h6
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.cpp1
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.h9
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.cpp32
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h1
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp8
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h6
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymemento.h5
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.cpp6
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.h9
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.cpp4
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.h1
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp5
-rw-r--r--plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h1
15 files changed, 48 insertions, 52 deletions
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
index dc417a2..bdb0b0d 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
@@ -39,13 +39,13 @@
using namespace MimeTreeParser::Interface;
-BodyPartFormatter::Result ApplicationGnuPGWKSFormatter::format(BodyPart* part, MimeTreeParser::HtmlWriter *writer) const
+BodyPartFormatter::Result ApplicationGnuPGWKSFormatter::format(BodyPart *part, MimeTreeParser::HtmlWriter *writer) const
{
return format(part, writer, Q_NULLPTR);
}
-BodyPartFormatter::Result ApplicationGnuPGWKSFormatter::format(BodyPart* part, MimeTreeParser::HtmlWriter *writer,
- QObject *) const
+BodyPartFormatter::Result ApplicationGnuPGWKSFormatter::format(BodyPart *part, MimeTreeParser::HtmlWriter *writer,
+ QObject *) const
{
if (!writer) {
return Ok;
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h
index c265d61..52f9db1 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h
@@ -31,10 +31,10 @@ public:
ApplicationGnuPGWKSFormatter() = default;
MimeTreeParser::Interface::BodyPartFormatter::Result format(MimeTreeParser::Interface::BodyPart *part,
- MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE;
+ MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE;
MimeTreeParser::Interface::BodyPartFormatter::Result format(MimeTreeParser::Interface::BodyPart *part,
- MimeTreeParser::HtmlWriter *writer,
- QObject *asyncResultObserver) const Q_DECL_OVERRIDE;
+ MimeTreeParser::HtmlWriter *writer,
+ QObject *asyncResultObserver) const Q_DECL_OVERRIDE;
private:
enum WKSStatus {
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.cpp
index 2c503f9..d062518 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.cpp
@@ -22,7 +22,6 @@
#include <MimeTreeParser/BodyPart>
#include <KMime/Content>
-
GnuPGWKSMessagePart::GnuPGWKSMessagePart(MimeTreeParser::Interface::BodyPart *part)
: mPart(part)
, mType(UnknownType)
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.h b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.h
index 4376e2a..94099f0 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.h
@@ -22,14 +22,17 @@
#include <QString>
-namespace MimeTreeParser {
-namespace Interface {
+namespace MimeTreeParser
+{
+namespace Interface
+{
class BodyPart;
class ObjectTreeSource;
}
}
-namespace KMime {
+namespace KMime
+{
class Content;
}
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.cpp
index 0ce0c6f..c24e7ff 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.cpp
@@ -49,14 +49,14 @@
using namespace MimeTreeParser::Interface;
bool ApplicationGnuPGWKSUrlHandler::handleContextMenuRequest(BodyPart *,
- const QString &,
- const QPoint &) const
+ const QString &,
+ const QPoint &) const
{
return false;
}
bool ApplicationGnuPGWKSUrlHandler::handleClick(MessageViewer::Viewer *viewerInstance,
- BodyPart *part, const QString &path) const
+ BodyPart *part, const QString &path) const
{
Q_UNUSED(viewerInstance);
@@ -67,7 +67,7 @@ bool ApplicationGnuPGWKSUrlHandler::handleClick(MessageViewer::Viewer *viewerIns
const QUrlQuery q(path.mid(sizeof("gnupgwks?") - 1));
if (q.queryItemValue(QStringLiteral("action")) == QLatin1String("show")) {
QProcess::startDetached(QStringLiteral("kleopatra"),
- { QStringLiteral("--query"), q.queryItemValue(QStringLiteral("fpr")) });
+ { QStringLiteral("--query"), q.queryItemValue(QStringLiteral("fpr")) });
return true;
} else if (q.queryItemValue(QStringLiteral("action")) == QLatin1String("confirm")) {
GnuPGWKSMessagePart mp(part);
@@ -80,7 +80,7 @@ bool ApplicationGnuPGWKSUrlHandler::handleClick(MessageViewer::Viewer *viewerIns
return false;
}
-QString ApplicationGnuPGWKSUrlHandler::statusBarMessage(BodyPart* part, const QString &path) const
+QString ApplicationGnuPGWKSUrlHandler::statusBarMessage(BodyPart *part, const QString &path) const
{
Q_UNUSED(part);
@@ -97,34 +97,30 @@ QString ApplicationGnuPGWKSUrlHandler::statusBarMessage(BodyPart* part, const QS
return QString();
}
-
QByteArray ApplicationGnuPGWKSUrlHandler::createConfirmation(const KMime::Message::Ptr &msg) const
{
auto job = QGpgME::openpgp()->wksPublishJob();
QEventLoop el;
QByteArray result;
QObject::connect(job, &QGpgME::WKSPublishJob::result,
- [&el, &result](const GpgME::Error &, const QByteArray &returnedData,
- const QByteArray &returnedError)
- {
- if (returnedData.isEmpty()) {
- qCWarning(GNUPGWKS_LOG) << "GPG:" << returnedError;
- }
- result = returnedData;
- el.quit();
- });
+ [&el, &result](const GpgME::Error &, const QByteArray & returnedData,
+ const QByteArray & returnedError) {
+ if (returnedData.isEmpty()) {
+ qCWarning(GNUPGWKS_LOG) << "GPG:" << returnedError;
+ }
+ result = returnedData;
+ el.quit();
+ });
job->startReceive(msg->encodedContent());
el.exec();
return result;
}
-
bool ApplicationGnuPGWKSUrlHandler::sendConfirmation(MessageViewer::Viewer *viewerInstance,
- const GnuPGWKSMessagePart &mp) const
+ const GnuPGWKSMessagePart &mp) const
{
-
const QByteArray data = createConfirmation(viewerInstance->message());
if (data.isEmpty()) {
return false;
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h
index abbd30a..1049a15 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h
@@ -48,5 +48,4 @@ private:
QByteArray createConfirmation(const KMime::Message::Ptr &msg) const;
};
-
#endif
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
index 3b969dd..6f69844 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
@@ -37,14 +37,14 @@
using namespace MimeTreeParser::Interface;
BodyPartFormatter::Result ApplicationPGPKeyFormatter::format(BodyPart *part,
- MimeTreeParser::HtmlWriter *writer) const
+ MimeTreeParser::HtmlWriter *writer) const
{
return format(part, writer, Q_NULLPTR);
}
BodyPartFormatter::Result ApplicationPGPKeyFormatter::format(BodyPart *part,
- MimeTreeParser::HtmlWriter *writer,
- QObject *asyncResultObserver) const
+ MimeTreeParser::HtmlWriter *writer,
+ QObject *asyncResultObserver) const
{
if (!writer) {
return Ok;
@@ -104,7 +104,7 @@ QString ApplicationPGPKeyFormatter::render(const PgpKeyMessagePart &mp) const
block.setProperty("hasKey", true);
if (uid.email() && *uid.email() && uid.name() && *uid.name()) {
block.setProperty("uid", QStringLiteral("%1 <%2>").arg(QString::fromUtf8(uid.name()),
- QString::fromUtf8(uid.email())));
+ QString::fromUtf8(uid.email())));
} else if (uid.name() && *uid.name()) {
block.setProperty("uid", QString::fromUtf8(uid.name()));
} else if (uid.email() && *uid.email()) {
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h
index 4abeb8b..c08bc3a 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h
@@ -30,10 +30,10 @@ public:
ApplicationPGPKeyFormatter() = default;
MimeTreeParser::Interface::BodyPartFormatter::Result format(MimeTreeParser::Interface::BodyPart *part,
- MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE;
+ MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE;
MimeTreeParser::Interface::BodyPartFormatter::Result format(MimeTreeParser::Interface::BodyPart *part,
- MimeTreeParser::HtmlWriter *writer,
- QObject *asyncResultObserver) const Q_DECL_OVERRIDE;
+ MimeTreeParser::HtmlWriter *writer,
+ QObject *asyncResultObserver) const Q_DECL_OVERRIDE;
private:
QString render(const PgpKeyMessagePart &mp) const;
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymemento.h b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymemento.h
index fc64c05..2d89421 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymemento.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymemento.h
@@ -26,12 +26,13 @@
#include <gpgme++/key.h>
-namespace GpgME {
+namespace GpgME
+{
class KeyListResult;
}
class PgpKeyMemento : public QObject
- , public MimeTreeParser::Interface::BodyPartMemento
+ , public MimeTreeParser::Interface::BodyPartMemento
{
Q_OBJECT
public:
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.cpp
index 427c0c3..db7fb53 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.cpp
@@ -85,13 +85,13 @@ MimeTreeParser::Interface::BodyPart *PgpKeyMessagePart::part() const
return mPart;
}
-
void PgpKeyMessagePart::parseContent(KMime::Content *node)
{
QProcess p;
p.start(QStringLiteral("gpg"), { QStringLiteral("--with-colons"),
QStringLiteral("--fixed-list-mode"),
- QStringLiteral("--with-fingerprint") });
+ QStringLiteral("--with-fingerprint")
+ });
p.waitForStarted();
p.write(node->decodedContent());
p.closeWriteChannel();
@@ -121,7 +121,7 @@ void PgpKeyMessagePart::parseContent(KMime::Content *node)
if (size > 6) {
mKeyDate = QDateTime::fromTime_t(cols[5].toUInt());
}
- // gpg2: UID is on a separate line
+ // gpg2: UID is on a separate line
} else if (cols[0] == "uid" && size > 9 && mUserID.isEmpty()) {
mUserID = QString::fromUtf8(cols[9]);
} else if (cols[0] == "fpr" && size > 9 && mFingerprint.isEmpty()) {
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.h b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.h
index 1252d86..f71b166 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.h
@@ -25,13 +25,16 @@
#include <gpgme++/key.h>
-namespace MimeTreeParser {
-namespace Interface {
+namespace MimeTreeParser
+{
+namespace Interface
+{
class BodyPart;
class ObjectTreeSource;
}
}
-namespace KMime {
+namespace KMime
+{
class Content;
}
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.cpp
index bbd2f80..43a6301 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.cpp
@@ -47,8 +47,6 @@ QUrlQuery ApplicationPgpKeyUrlHandler::decodePath(const QString &path) const
return QUrlQuery(path.mid(sizeof("pgpkey?") - 1));
}
-
-
bool ApplicationPgpKeyUrlHandler::handleContextMenuRequest(BodyPart *, const QString &, const QPoint &) const
{
return false;
@@ -65,7 +63,7 @@ QString ApplicationPgpKeyUrlHandler::statusBarMessage(BodyPart *part, const QStr
}
bool ApplicationPgpKeyUrlHandler::handleClick(MessageViewer::Viewer *v,
- BodyPart *part, const QString &path) const
+ BodyPart *part, const QString &path) const
{
const QUrlQuery q = decodePath(path);
if (q.queryItemValue(QStringLiteral("action")) == QLatin1String("import")) {
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.h b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.h
index c798741..93e26b7 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.h
@@ -43,6 +43,5 @@ private:
QUrlQuery decodePath(const QString &path) const;
};
-
#endif
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
index 8735ca1..097351d 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp
@@ -24,7 +24,8 @@
#include "pgpkeyformatter.h"
#include "pgpkeyurlhandler.h"
-namespace {
+namespace
+{
enum Index {
application_vnd_gnupg_keys,
application_pgp_keys
@@ -54,7 +55,6 @@ const char *ApplicationGnuPGWKSPlugin::subtype(int idx) const
}
}
-
const MimeTreeParser::Interface::BodyPartFormatter *ApplicationGnuPGWKSPlugin::bodyPartFormatter(int idx) const
{
switch (idx) {
@@ -79,7 +79,6 @@ const MimeTreeParser::Interface::BodyPartURLHandler *ApplicationGnuPGWKSPlugin::
}
}
-
extern "C"
Q_DECL_EXPORT MimeTreeParser::Interface::BodyPartFormatterPlugin *
messageviewer_bodypartformatter_application_gnupgwks_create_bodypart_formatter_plugin()
diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
index b0bf21b..fef5660 100644
--- a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
+++ b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h
@@ -33,5 +33,4 @@ public:
const MimeTreeParser::Interface::BodyPartURLHandler *urlHandler(int idx) const Q_DECL_OVERRIDE;
};
-
#endif