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

Astyle kdelibs

parent 74a086ba
......@@ -106,19 +106,18 @@ public:
return false;
}
const BodyPartFormatterBaseFactory *bodyPartFormatterFactory() Q_DECL_OVERRIDE
{
return &mBodyPartFormatterBaseFactory;
const BodyPartFormatterBaseFactory *bodyPartFormatterFactory() Q_DECL_OVERRIDE {
return &mBodyPartFormatterBaseFactory;
}
bool decryptMessage() const Q_DECL_OVERRIDE
{
return mDecryptMessage;
return mDecryptMessage;
}
void setAllowDecryption(bool allowDecryption)
{
mDecryptMessage = allowDecryption;
mDecryptMessage = allowDecryption;
}
bool showSignatureDetails() const Q_DECL_OVERRIDE
......@@ -126,8 +125,7 @@ public:
return false;
}
void setHtmlMode(MimeTreeParser::Util::HtmlMode mode) Q_DECL_OVERRIDE
{
void setHtmlMode(MimeTreeParser::Util::HtmlMode mode) Q_DECL_OVERRIDE {
Q_UNUSED(mode);
}
......@@ -136,20 +134,17 @@ public:
return 1;
}
const QTextCodec *overrideCodec() Q_DECL_OVERRIDE
{
return Q_NULLPTR;
const QTextCodec *overrideCodec() Q_DECL_OVERRIDE {
return Q_NULLPTR;
}
QString createMessageHeader(KMime::Message *message) Q_DECL_OVERRIDE
{
QString createMessageHeader(KMime::Message *message) Q_DECL_OVERRIDE {
Q_UNUSED(message);
return QString(); //do nothing
}
QObject *sourceObject() Q_DECL_OVERRIDE
{
return Q_NULLPTR;
QObject *sourceObject() Q_DECL_OVERRIDE {
return Q_NULLPTR;
}
private:
......
......@@ -36,14 +36,16 @@ using namespace MimeTreeParser;
const ApplicationPGPEncryptedBodyPartFormatter *ApplicationPGPEncryptedBodyPartFormatter::self;
const Interface::BodyPartFormatter *ApplicationPGPEncryptedBodyPartFormatter::create() {
if ( !self ) {
const Interface::BodyPartFormatter *ApplicationPGPEncryptedBodyPartFormatter::create()
{
if (!self) {
self = new ApplicationPGPEncryptedBodyPartFormatter();
}
return self;
}
Interface::BodyPartFormatter::Result ApplicationPGPEncryptedBodyPartFormatter::format(Interface::BodyPart *part, HtmlWriter *writer) const {
Interface::BodyPartFormatter::Result ApplicationPGPEncryptedBodyPartFormatter::format(Interface::BodyPart *part, HtmlWriter *writer) const
{
Q_UNUSED(writer)
const auto p = process(*part);
const auto mp = static_cast<MessagePart *>(p.data());
......@@ -54,13 +56,14 @@ Interface::BodyPartFormatter::Result ApplicationPGPEncryptedBodyPartFormatter::f
return Failed;
}
Interface::MessagePart::Ptr ApplicationPGPEncryptedBodyPartFormatter::process(Interface::BodyPart &part) const {
KMime::Content *node (part.content());
Interface::MessagePart::Ptr ApplicationPGPEncryptedBodyPartFormatter::process(Interface::BodyPart &part) const
{
KMime::Content *node(part.content());
if (node->decodedContent().trimmed() != "Version: 1") {
qCWarning(MIMETREEPARSER_LOG) << "Unknown PGP Version String:" << node->decodedContent().trimmed();
qCWarning(MIMETREEPARSER_LOG) << "Unknown PGP Version String:" << node->decodedContent().trimmed();
}
KMime::Content *data = findType(part.content(), "application/octet-stream", false, true);
if (!data) {
......
......@@ -32,13 +32,15 @@ using namespace MimeTreeParser;
const MailmanBodyPartFormatter *MailmanBodyPartFormatter::self;
const Interface::BodyPartFormatter *MailmanBodyPartFormatter::create() {
if ( !self ) {
const Interface::BodyPartFormatter *MailmanBodyPartFormatter::create()
{
if (!self) {
self = new MailmanBodyPartFormatter();
}
return self;
}
Interface::BodyPartFormatter::Result MailmanBodyPartFormatter::format(Interface::BodyPart *part, HtmlWriter *writer) const {
Interface::BodyPartFormatter::Result MailmanBodyPartFormatter::format(Interface::BodyPart *part, HtmlWriter *writer) const
{
Q_UNUSED(writer)
const auto p = process(*part);
const auto mp = static_cast<MessagePart *>(p.data());
......@@ -49,7 +51,7 @@ Interface::BodyPartFormatter::Result MailmanBodyPartFormatter::format(Interface:
return Failed;
}
bool MailmanBodyPartFormatter::isMailmanMessage(KMime::Content* curNode) const
bool MailmanBodyPartFormatter::isMailmanMessage(KMime::Content *curNode) const
{
if (!curNode || curNode->head().isEmpty()) {
return false;
......
......@@ -267,7 +267,7 @@ const AttachmentStrategy *AttachmentStrategy::create(Type type)
case HeaderOnly: return headerOnly();
}
qCCritical(MIMETREEPARSER_LOG) << "Unknown attachment startegy ( type =="
<< (int)type << ") requested!";
<< (int)type << ") requested!";
return 0; // make compiler happy
}
......
......@@ -74,7 +74,7 @@ void BodyPartFormatterBaseFactoryPrivate::insert(const char *type, const char *s
TypeRegistry::iterator type_it = all->find(type);
if (type_it == all->end()) {
qCDebug(MIMETREEPARSER_LOG) << "BodyPartFormatterBaseFactory: instantiating new Subtype Registry for \""
<< type << "\"";
<< type << "\"";
type_it = all->insert(std::make_pair(type, SubtypeRegistry())).first;
assert(type_it != all->end());
}
......@@ -167,7 +167,7 @@ SubtypeRegistry::const_iterator BodyPartFormatterBaseFactory::createForIterator(
if (!(*subtype_it).second) {
qCWarning(MIMETREEPARSER_LOG) << "BodyPartFormatterBaseFactory: a null bodypart formatter sneaked in for \""
<< type << "/" << subtype << "\"!";
<< type << "/" << subtype << "\"!";
}
return subtype_it;
......
......@@ -489,8 +489,8 @@ QString NodeHelper::replacePrefixes(const QString &str,
QRegExp rx(bigRegExp, Qt::CaseInsensitive);
if (!rx.isValid()) {
qCWarning(MIMETREEPARSER_LOG) << "bigRegExp = \""
<< bigRegExp << "\"\n"
<< "prefix regexp is invalid!";
<< bigRegExp << "\"\n"
<< "prefix regexp is invalid!";
// try good ole Re/Fwd:
recognized = str.startsWith(newPrefix);
} else { // valid rx
......@@ -804,7 +804,7 @@ void NodeHelper::mergeExtraNodes(KMime::Content *node)
Q_FOREACH (KMime::Content *extra, extraNodes) {
if (node->bodyIsMessage()) {
qCWarning(MIMETREEPARSER_LOG) << "Asked to attach extra content to a kmime::message, this does not make sense. Attaching to:" << node <<
node->encodedContent() << "\n====== with =======\n" << extra << extra->encodedContent();
node->encodedContent() << "\n====== with =======\n" << extra << extra->encodedContent();
continue;
}
KMime::Content *c = new KMime::Content(node);
......@@ -937,7 +937,7 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
if (decryptedNode) {
qCDebug(MIMETREEPARSER_LOG) << "Current node has an associated decrypted node, adding a modified header "
"and then processing the children.";
"and then processing the children.";
Q_ASSERT(addHeaders);
KMime::Content headers;
......
......@@ -281,7 +281,7 @@ MessagePart::Ptr ObjectTreeParser::parseObjectTreeInternal(KMime::Content *node)
const auto sub = mSource->bodyPartFormatterFactory()->subtypeRegistry(mediaType);
while (true) {
auto range = sub.equal_range(subType);
for (auto it=range.first; it != range.second; ++it) {
for (auto it = range.first; it != range.second; ++it) {
const auto formatter = (*it).second;
if (!formatter) {
continue;
......@@ -736,7 +736,6 @@ MessagePart::Ptr ObjectTreeParser::processTextHtmlSubtype(KMime::Content *curNod
return mp;
}
void ObjectTreeParser::extractNodeInfos(KMime::Content *curNode, bool isFirstTextPart)
{
if (isFirstTextPart) {
......@@ -846,7 +845,7 @@ MessagePart::Ptr ObjectTreeParser::processMultiPartSignedSubtype(KMime::Content
assert(signedData);
if (node->contents().size() != 2) {
qCDebug(MIMETREEPARSER_LOG) << "mulitpart/signed must have exactly two child parts!" << endl
<< "processing as multipart/mixed";
<< "processing as multipart/mixed";
return MessagePart::Ptr(new MimeMessagePart(this, signedData, false));
}
......@@ -858,7 +857,7 @@ MessagePart::Ptr ObjectTreeParser::processMultiPartSignedSubtype(KMime::Content
const QString signatureContentType = QLatin1String(signature->contentType()->mimeType().toLower());
if (protocolContentType.isEmpty()) {
qCWarning(MIMETREEPARSER_LOG) << "Message doesn't set the protocol for the multipart/signed content-type, "
"using content-type of the signature:" << signatureContentType;
"using content-type of the signature:" << signatureContentType;
protocolContentType = signatureContentType;
}
......
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