Commit bdb63e8c authored by Sandro Knauß's avatar Sandro Knauß

Move logging category to mimetreeparser

parent 75a72bed
......@@ -125,8 +125,6 @@ set(libmimetreeparser_SRCS
${libmimetreeparser_extra_SRCS}
)
ecm_qt_declare_logging_category(libmimetreeparser_SRCS HEADER messageviewer_debug.h IDENTIFIER MESSAGEVIEWER_LOG CATEGORY_NAME log_messageviewer)
ecm_qt_declare_logging_category(libmimetreeparser_SRCS HEADER mimetreeparser_debug.h IDENTIFIER MIMETREEPARSER_LOG CATEGORY_NAME log_mimetreeparser)
add_library(KF5MimeTreeParser
......
......@@ -31,7 +31,7 @@
#include "filehtmlwriter.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
namespace MessageViewer
{
......@@ -46,7 +46,7 @@ FileHtmlWriter::FileHtmlWriter(const QString &filename)
FileHtmlWriter::~FileHtmlWriter()
{
if (mFile.isOpen()) {
qCWarning(MESSAGEVIEWER_LOG) << "FileHtmlWriter: file still open!";
qCWarning(MIMETREEPARSER_LOG) << "FileHtmlWriter: file still open!";
mStream.setDevice(0);
mFile.close();
}
......@@ -95,12 +95,12 @@ void FileHtmlWriter::flush()
void FileHtmlWriter::openOrWarn()
{
if (mFile.isOpen()) {
qCWarning(MESSAGEVIEWER_LOG) << "FileHtmlWriter: file still open!";
qCWarning(MIMETREEPARSER_LOG) << "FileHtmlWriter: file still open!";
mStream.setDevice(0);
mFile.close();
}
if (!mFile.open(QIODevice::WriteOnly)) {
qCWarning(MESSAGEVIEWER_LOG) << "FileHtmlWriter: Cannot open file" << mFile.fileName();
qCWarning(MIMETREEPARSER_LOG) << "FileHtmlWriter: Cannot open file" << mFile.fileName();
} else {
mStream.setDevice(&mFile);
}
......
......@@ -19,7 +19,7 @@
#include "queuehtmlwriter.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
#include<QByteArray>
#include<QString>
......
......@@ -17,7 +17,7 @@
*/
#include "kleojobexecutor.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
#include <Libkleo/DecryptVerifyJob>
#include <Libkleo/ImportJob>
#include <Libkleo/VerifyDetachedJob>
......@@ -43,7 +43,7 @@ GpgME::VerificationResult KleoJobExecutor::exec(
const QByteArray &signature,
const QByteArray &signedData)
{
qCDebug(MESSAGEVIEWER_LOG) << "Starting detached verification job";
qCDebug(MIMETREEPARSER_LOG) << "Starting detached verification job";
connect(job, SIGNAL(result(GpgME::VerificationResult)), SLOT(verificationResult(GpgME::VerificationResult)));
GpgME::Error err = job->start(signature, signedData);
if (err) {
......@@ -58,7 +58,7 @@ GpgME::VerificationResult KleoJobExecutor::exec(
const QByteArray &signedData,
QByteArray &plainText)
{
qCDebug(MESSAGEVIEWER_LOG) << "Starting opaque verification job";
qCDebug(MIMETREEPARSER_LOG) << "Starting opaque verification job";
connect(job, SIGNAL(result(GpgME::VerificationResult,QByteArray)), SLOT(verificationResult(GpgME::VerificationResult,QByteArray)));
GpgME::Error err = job->start(signedData);
if (err) {
......@@ -75,7 +75,7 @@ std::pair< GpgME::DecryptionResult, GpgME::VerificationResult > KleoJobExecutor:
const QByteArray &cipherText,
QByteArray &plainText)
{
qCDebug(MESSAGEVIEWER_LOG) << "Starting decryption job";
qCDebug(MIMETREEPARSER_LOG) << "Starting decryption job";
connect(job, &DecryptVerifyJob::result, this, &KleoJobExecutor::decryptResult);
GpgME::Error err = job->start(cipherText);
if (err) {
......@@ -105,7 +105,7 @@ Error KleoJobExecutor::auditLogError() const
void KleoJobExecutor::verificationResult(const GpgME::VerificationResult &result)
{
qCDebug(MESSAGEVIEWER_LOG) << "Detached verification job finished";
qCDebug(MIMETREEPARSER_LOG) << "Detached verification job finished";
Kleo::Job *job = dynamic_cast<Kleo::Job *>(sender());
assert(job);
mVerificationResult = result;
......@@ -116,7 +116,7 @@ void KleoJobExecutor::verificationResult(const GpgME::VerificationResult &result
void KleoJobExecutor::verificationResult(const GpgME::VerificationResult &result, const QByteArray &plainText)
{
qCDebug(MESSAGEVIEWER_LOG) << "Opaque verification job finished";
qCDebug(MIMETREEPARSER_LOG) << "Opaque verification job finished";
Kleo::Job *job = dynamic_cast<Kleo::Job *>(sender());
assert(job);
mVerificationResult = result;
......@@ -131,7 +131,7 @@ void KleoJobExecutor::decryptResult(
const GpgME::VerificationResult &verificationresult,
const QByteArray &plainText)
{
qCDebug(MESSAGEVIEWER_LOG) << "Decryption job finished";
qCDebug(MIMETREEPARSER_LOG) << "Decryption job finished";
Kleo::Job *job = dynamic_cast<Kleo::Job *>(sender());
assert(job);
mVerificationResult = verificationresult;
......
......@@ -19,7 +19,7 @@
#include "utils/mimetype.h"
#include "utils/iconnamecache.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
#include <QMimeDatabase>
......@@ -65,7 +65,7 @@ QString MessageViewer::Util::fileNameForMimetype(const QString &mimeType, int ic
} else {
fileName = QStringLiteral("unknown");
if (!tMimeType.isEmpty()) {
qCWarning(MESSAGEVIEWER_LOG) << "unknown mimetype" << tMimeType;
qCWarning(MIMETREEPARSER_LOG) << "unknown mimetype" << tMimeType;
}
}
//WorkAround for #199083
......
......@@ -37,7 +37,7 @@
#include <KMime/Content>
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
namespace MessageViewer
{
......@@ -266,7 +266,7 @@ const AttachmentStrategy *AttachmentStrategy::create(Type type)
case Hidden: return hidden();
case HeaderOnly: return headerOnly();
}
qCCritical(MESSAGEVIEWER_LOG) << "Unknown attachment startegy ( type =="
qCCritical(MIMETREEPARSER_LOG) << "Unknown attachment startegy ( type =="
<< (int)type << ") requested!";
return 0; // make compiler happy
}
......
......@@ -29,7 +29,7 @@
your version.
*/
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
#include "bodypartformatterbasefactory.h"
#include "viewer/bodypartformatterbasefactory_p.h"
......@@ -53,7 +53,7 @@ class AnyTypeBodyPartFormatter
public:
Result format(Interface::BodyPart *, HtmlWriter *) const Q_DECL_OVERRIDE
{
qCDebug(MESSAGEVIEWER_LOG) << "Acting as a Interface::BodyPartFormatter!";
qCDebug(MIMETREEPARSER_LOG) << "Acting as a Interface::BodyPartFormatter!";
return AsIcon;
}
......
......@@ -33,7 +33,7 @@
#include "bodypartformatterbasefactory.h"
#include "bodypartformatterbasefactory_p.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
// Qt
#include <QString>
......@@ -73,7 +73,7 @@ void BodyPartFormatterBaseFactoryPrivate::insert(const char *type, const char *s
TypeRegistry::iterator type_it = all->find(type);
if (type_it == all->end()) {
qCDebug(MESSAGEVIEWER_LOG) << "BodyPartFormatterBaseFactory: instantiating new Subtype Registry for \""
qCDebug(MIMETREEPARSER_LOG) << "BodyPartFormatterBaseFactory: instantiating new Subtype Registry for \""
<< type << "\"";
type_it = all->insert(std::make_pair(type, SubtypeRegistry())).first;
assert(type_it != all->end());
......@@ -166,7 +166,7 @@ SubtypeRegistry::const_iterator BodyPartFormatterBaseFactory::createForIterator(
}
if (!(*subtype_it).second) {
qCWarning(MESSAGEVIEWER_LOG) << "BodyPartFormatterBaseFactory: a null bodypart formatter sneaked in for \""
qCWarning(MIMETREEPARSER_LOG) << "BodyPartFormatterBaseFactory: a null bodypart formatter sneaked in for \""
<< type << "/" << subtype << "\"!";
}
......@@ -194,5 +194,5 @@ const Interface::BodyPartFormatter *BodyPartFormatterBaseFactory::createFor(cons
void BodyPartFormatterBaseFactory::loadPlugins()
{
qCDebug(MESSAGEVIEWER_LOG) << "plugin loading is not enabled in libotp";
qCDebug(MIMETREEPARSER_LOG) << "plugin loading is not enabled in libotp";
}
......@@ -16,7 +16,7 @@
*/
#include "verifydetachedbodypartmemento.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
#include <Libkleo/VerifyDetachedJob>
#include <Libkleo/KeyListJob>
......@@ -58,14 +58,14 @@ bool VerifyDetachedBodyPartMemento::start()
{
assert(m_job);
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyDetachedBodyPartMemento started";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyDetachedBodyPartMemento started";
#endif
connect(m_job, SIGNAL(result(GpgME::VerificationResult)),
this, SLOT(slotResult(GpgME::VerificationResult)));
if (const Error err = m_job->start(m_signature, m_plainText)) {
m_vr = VerificationResult(err);
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyDetachedBodyPartMemento stopped with error";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyDetachedBodyPartMemento stopped with error";
#endif
return false;
}
......@@ -78,13 +78,13 @@ void VerifyDetachedBodyPartMemento::exec()
assert(m_job);
setRunning(true);
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyDetachedBodyPartMemento execed";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyDetachedBodyPartMemento execed";
#endif
saveResult(m_job->exec(m_signature, m_plainText));
m_job->deleteLater(); // exec'ed jobs don't delete themselves
m_job = 0;
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyDetachedBodyPartMemento after execed";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyDetachedBodyPartMemento after execed";
#endif
if (canStartKeyListJob()) {
std::vector<GpgME::Key> keys;
......@@ -119,7 +119,7 @@ void VerifyDetachedBodyPartMemento::saveResult(const VerificationResult &vr)
{
assert(m_job);
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyDetachedBodyPartMemento::saveResult called";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyDetachedBodyPartMemento::saveResult called";
#endif
m_vr = vr;
setAuditLog(m_job->auditLogError(), m_job->auditLogAsHtml());
......@@ -128,13 +128,13 @@ void VerifyDetachedBodyPartMemento::saveResult(const VerificationResult &vr)
void VerifyDetachedBodyPartMemento::slotResult(const VerificationResult &vr)
{
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyDetachedBodyPartMemento::slotResult called";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyDetachedBodyPartMemento::slotResult called";
#endif
saveResult(vr);
m_job = 0;
if (canStartKeyListJob() && startKeyListJob()) {
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyDetachedBodyPartMemento: canStartKeyListJob && startKeyListJob";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyDetachedBodyPartMemento: canStartKeyListJob && startKeyListJob";
#endif
return;
}
......@@ -161,7 +161,7 @@ bool VerifyDetachedBodyPartMemento::startKeyListJob()
void VerifyDetachedBodyPartMemento::slotNextKey(const GpgME::Key &key)
{
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyDetachedBodyPartMemento::slotNextKey called";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyDetachedBodyPartMemento::slotNextKey called";
#endif
m_key = key;
}
......@@ -169,7 +169,7 @@ void VerifyDetachedBodyPartMemento::slotNextKey(const GpgME::Key &key)
void VerifyDetachedBodyPartMemento::slotKeyListJobDone()
{
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyDetachedBodyPartMemento::slotKeyListJobDone called";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyDetachedBodyPartMemento::slotKeyListJobDone called";
#endif
m_keylistjob = 0;
setRunning(false);
......
......@@ -16,7 +16,7 @@
*/
#include "verifyopaquebodypartmemento.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
#include <Libkleo/VerifyOpaqueJob>
#include <Libkleo/KeyListJob>
......@@ -56,12 +56,12 @@ bool VerifyOpaqueBodyPartMemento::start()
{
assert(m_job);
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento started";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento started";
#endif
if (const Error err = m_job->start(m_signature)) {
m_vr = VerificationResult(err);
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento stopped with error";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento stopped with error";
#endif
return false;
}
......@@ -77,11 +77,11 @@ void VerifyOpaqueBodyPartMemento::exec()
setRunning(true);
QByteArray plainText;
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento execed";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento execed";
#endif
saveResult(m_job->exec(m_signature, plainText), plainText);
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento after execed";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento after execed";
#endif
m_job->deleteLater(); // exec'ed jobs don't delete themselves
m_job = 0;
......@@ -119,7 +119,7 @@ void VerifyOpaqueBodyPartMemento::saveResult(const VerificationResult &vr,
{
assert(m_job);
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento::saveResult called";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento::saveResult called";
#endif
m_vr = vr;
m_plainText = plainText;
......@@ -130,13 +130,13 @@ void VerifyOpaqueBodyPartMemento::slotResult(const VerificationResult &vr,
const QByteArray &plainText)
{
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento::slotResult called";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento::slotResult called";
#endif
saveResult(vr, plainText);
m_job = 0;
if (canStartKeyListJob() && startKeyListJob()) {
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento: canStartKeyListJob && startKeyListJob";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento: canStartKeyListJob && startKeyListJob";
#endif
return;
}
......@@ -163,7 +163,7 @@ bool VerifyOpaqueBodyPartMemento::startKeyListJob()
void VerifyOpaqueBodyPartMemento::slotNextKey(const GpgME::Key &key)
{
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento::slotNextKey called";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento::slotNextKey called";
#endif
m_key = key;
}
......@@ -171,7 +171,7 @@ void VerifyOpaqueBodyPartMemento::slotNextKey(const GpgME::Key &key)
void VerifyOpaqueBodyPartMemento::slotKeyListJobDone()
{
#ifdef DEBUG_SIGNATURE
qCDebug(MESSAGEVIEWER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento::slotKeyListJobDone called";
qCDebug(MIMETREEPARSER_LOG) << "tokoe: VerifyOpaqueBodyPartMemento::slotKeyListJobDone called";
#endif
m_keylistjob = 0;
setRunning(false);
......
......@@ -18,7 +18,7 @@
*/
#include "messagepart.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
#include "objecttreeparser.h"
#include "converthtmltoplaintext.h"
#include "csshelperbase.h"
......@@ -497,10 +497,10 @@ static QString makeShowAuditLogLink(const GpgME::Error &err, const QString &audi
// equally applies there:
if (const unsigned int code = err.code()) {
if (code == GPG_ERR_NOT_IMPLEMENTED) {
qCDebug(MESSAGEVIEWER_LOG) << "not showing link (not implemented)";
qCDebug(MIMETREEPARSER_LOG) << "not showing link (not implemented)";
return QString();
} else if (code == GPG_ERR_NO_DATA) {
qCDebug(MESSAGEVIEWER_LOG) << "not showing link (not available)";
qCDebug(MIMETREEPARSER_LOG) << "not showing link (not available)";
return i18n("No Audit Log available");
} else {
return i18n("Error Retrieving Audit Log: %1", QString::fromLocal8Bit(err.asString()));
......@@ -1236,7 +1236,7 @@ TextMessagePart::TextMessagePart(ObjectTreeParser *otp, KMime::Content *node, bo
, mAsIcon(asIcon)
{
if (!mNode) {
qCWarning(MESSAGEVIEWER_LOG) << "not a valid node";
qCWarning(MIMETREEPARSER_LOG) << "not a valid node";
return;
}
......@@ -1373,7 +1373,7 @@ HtmlMessagePart::HtmlMessagePart(ObjectTreeParser *otp, KMime::Content *node, Ob
, mSource(source)
{
if (!mNode) {
qCWarning(MESSAGEVIEWER_LOG) << "not a valid node";
qCWarning(MIMETREEPARSER_LOG) << "not a valid node";
return;
}
......@@ -1481,7 +1481,7 @@ MimeMessagePart::MimeMessagePart(ObjectTreeParser *otp, KMime::Content *node, bo
, mOnlyOneMimePart(onlyOneMimePart)
{
if (!mNode) {
qCWarning(MESSAGEVIEWER_LOG) << "not a valid node";
qCWarning(MIMETREEPARSER_LOG) << "not a valid node";
return;
}
......@@ -1513,7 +1513,7 @@ AlternativeMessagePart::AlternativeMessagePart(ObjectTreeParser *otp, KMime::Con
, mViewHtml(false)
{
if (!mTextNode && !mHTMLNode) {
qCWarning(MESSAGEVIEWER_LOG) << "not a valid nodes";
qCWarning(MIMETREEPARSER_LOG) << "not a valid nodes";
return;
}
......@@ -1597,7 +1597,7 @@ CertMessagePart::CertMessagePart(ObjectTreeParser *otp, KMime::Content *node, co
, mCryptoProto(cryptoProto)
{
if (!mNode) {
qCWarning(MESSAGEVIEWER_LOG) << "not a valid node";
qCWarning(MIMETREEPARSER_LOG) << "not a valid node";
return;
}
......@@ -1882,7 +1882,7 @@ EncapsulatedRfc822MessagePart::EncapsulatedRfc822MessagePart(ObjectTreeParser *o
mOtp->nodeHelper()->setPartMetaData(mNode, mMetaData);
if (!mMessage) {
qCWarning(MESSAGEVIEWER_LOG) << "Node is of type message/rfc822 but doesn't have a message!";
qCWarning(MIMETREEPARSER_LOG) << "Node is of type message/rfc822 but doesn't have a message!";
return;
}
......
......@@ -18,7 +18,7 @@
*/
#include "nodehelper.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
#include "utils/iconnamecache.h"
#include "partmetadata.h"
#include "interfaces/bodypart.h"
......@@ -97,7 +97,7 @@ void NodeHelper::setNodeProcessed(KMime::Content *node, bool recurse)
return;
}
mProcessedNodes.append(node);
qCDebug(MESSAGEVIEWER_LOG) << "Node processed: " << node->index().toString() << node->contentType()->as7BitString();
qCDebug(MIMETREEPARSER_LOG) << "Node processed: " << node->index().toString() << node->contentType()->as7BitString();
//<< " decodedContent" << node->decodedContent();
if (recurse) {
auto contents = node->contents();
......@@ -124,11 +124,11 @@ void NodeHelper::setNodeUnprocessed(KMime::Content *node, bool recurse)
}
}
qDeleteAll(it.value());
qCDebug(MESSAGEVIEWER_LOG) << "mExtraContents deleted for" << it.key();
qCDebug(MIMETREEPARSER_LOG) << "mExtraContents deleted for" << it.key();
mExtraContents.erase(it);
}
qCDebug(MESSAGEVIEWER_LOG) << "Node UNprocessed: " << node;
qCDebug(MIMETREEPARSER_LOG) << "Node UNprocessed: " << node;
if (recurse) {
auto contents = node->contents();
Q_FOREACH (KMime::Content *c, contents) {
......@@ -176,7 +176,7 @@ void NodeHelper::clear()
}
}
qDeleteAll(it.value());
qCDebug(MESSAGEVIEWER_LOG) << "mExtraContents deleted for" << it.key();
qCDebug(MIMETREEPARSER_LOG) << "mExtraContents deleted for" << it.key();
}
mExtraContents.clear();
mDisplayEmbeddedNodes.clear();
......@@ -239,7 +239,7 @@ QString NodeHelper::writeNodeToTempFile(KMime::Content *node)
}
fname += QLatin1Char('/') + fileName;
qCDebug(MESSAGEVIEWER_LOG) << "Create temp file: " << fname;
qCDebug(MIMETREEPARSER_LOG) << "Create temp file: " << fname;
QByteArray data = node->decodedContent();
if (node->contentType()->isText() && data.size() > 0) {
// convert CRLF to LF before writing text attachments to disk
......@@ -247,7 +247,7 @@ QString NodeHelper::writeNodeToTempFile(KMime::Content *node)
}
QFile f(fname);
if (!f.open(QIODevice::ReadWrite)) {
qCWarning(MESSAGEVIEWER_LOG) << "Failed to write note to file:" << f.errorString();
qCWarning(MIMETREEPARSER_LOG) << "Failed to write note to file:" << f.errorString();
return QString();
}
f.write(data);
......@@ -393,7 +393,7 @@ KMMsgEncryptionState NodeHelper::overallEncryptionState(KMime::Content *node) co
}
}
qCDebug(MESSAGEVIEWER_LOG) << "\n\n KMMsgEncryptionState:" << myState;
qCDebug(MIMETREEPARSER_LOG) << "\n\n KMMsgEncryptionState:" << myState;
return myState;
}
......@@ -443,7 +443,7 @@ KMMsgSignatureState NodeHelper::overallSignatureState(KMime::Content *node) cons
}
}
qCDebug(MESSAGEVIEWER_LOG) << "\n\n KMMsgSignatureState:" << myState;
qCDebug(MIMETREEPARSER_LOG) << "\n\n KMMsgSignatureState:" << myState;
return myState;
}
......@@ -488,7 +488,7 @@ QString NodeHelper::replacePrefixes(const QString &str,
.arg(prefixRegExps.join(QStringLiteral(")|(?:")));
QRegExp rx(bigRegExp, Qt::CaseInsensitive);
if (!rx.isValid()) {
qCWarning(MESSAGEVIEWER_LOG) << "bigRegExp = \""
qCWarning(MIMETREEPARSER_LOG) << "bigRegExp = \""
<< bigRegExp << "\"\n"
<< "prefix regexp is invalid!";
// try good ole Re/Fwd:
......@@ -615,13 +615,13 @@ void NodeHelper::setBodyPartMemento(KMime::Content *node, const QByteArray &whic
bool NodeHelper::isNodeDisplayedEmbedded(KMime::Content *node) const
{
qCDebug(MESSAGEVIEWER_LOG) << "IS NODE: " << mDisplayEmbeddedNodes.contains(node);
qCDebug(MIMETREEPARSER_LOG) << "IS NODE: " << mDisplayEmbeddedNodes.contains(node);
return mDisplayEmbeddedNodes.contains(node);
}
void NodeHelper::setNodeDisplayedEmbedded(KMime::Content *node, bool displayedEmbedded)
{
qCDebug(MESSAGEVIEWER_LOG) << "SET NODE: " << node << displayedEmbedded;
qCDebug(MIMETREEPARSER_LOG) << "SET NODE: " << node << displayedEmbedded;
if (displayedEmbedded) {
mDisplayEmbeddedNodes.insert(node);
} else {
......@@ -785,7 +785,7 @@ QString NodeHelper::fromAsString(KMime::Content *node)
void NodeHelper::attachExtraContent(KMime::Content *topLevelNode, KMime::Content *content)
{
qCDebug(MESSAGEVIEWER_LOG) << "mExtraContents added for" << topLevelNode << " extra content: " << content;
qCDebug(MIMETREEPARSER_LOG) << "mExtraContents added for" << topLevelNode << " extra content: " << content;
mExtraContents[topLevelNode].append(content);
}
......@@ -803,7 +803,7 @@ void NodeHelper::mergeExtraNodes(KMime::Content *node)
QList<KMime::Content * > extraNodes = extraContents(node);
Q_FOREACH (KMime::Content *extra, extraNodes) {
if (node->bodyIsMessage()) {
qCWarning(MESSAGEVIEWER_LOG) << "Asked to attach extra content to a kmime::message, this does not make sense. Attaching to:" << node <<
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();
continue;
}
......@@ -858,8 +858,8 @@ KMime::Message *NodeHelper::messageWithExtraContent(KMime::Content *topLevelNode
m->parse();
cleanFromExtraNodes(topLevelNode);
// qCDebug(MESSAGEVIEWER_LOG) << "MESSAGE WITH EXTRA: " << m->encodedContent();
// qCDebug(MESSAGEVIEWER_LOG) << "MESSAGE WITHOUT EXTRA: " << topLevelNode->encodedContent();
// qCDebug(MIMETREEPARSER_LOG) << "MESSAGE WITH EXTRA: " << m->encodedContent();
// qCDebug(MIMETREEPARSER_LOG) << "MESSAGE WITHOUT EXTRA: " << topLevelNode->encodedContent();
return m;
}
......@@ -895,7 +895,7 @@ KMime::Content *NodeHelper::decryptedNodeForContent(KMime::Content *content) con
if (xc.size() == 1) {
return xc.front();
} else {
qCWarning(MESSAGEVIEWER_LOG) << "WTF, encrypted node has multiple extra contents?";
qCWarning(MIMETREEPARSER_LOG) << "WTF, encrypted node has multiple extra contents?";
}
}
return 0;
......@@ -913,7 +913,7 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
const bool isMultipart = node->contentType(false) && node->contentType()->isMultipart();
bool isSignature = false;
qCDebug(MESSAGEVIEWER_LOG) << "(" << recursionLevel << ") Looking at" << type << "/" << subType;
qCDebug(MIMETREEPARSER_LOG) << "(" << recursionLevel << ") Looking at" << type << "/" << subType;
if (isMultipart) {
if (subType == "signed") {
......@@ -936,7 +936,7 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
}
if (decryptedNode) {
qCDebug(MESSAGEVIEWER_LOG) << "Current node has an associated decrypted node, adding a modified header "
qCDebug(MIMETREEPARSER_LOG) << "Current node has an associated decrypted node, adding a modified header "
"and then processing the children.";
Q_ASSERT(addHeaders);
......@@ -972,7 +972,7 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
}
else if (isSignature) {
qCDebug(MESSAGEVIEWER_LOG) << "Current node is a signature, adding it as-is.";
qCDebug(MIMETREEPARSER_LOG) << "Current node is a signature, adding it as-is.";
// We can't change the nodes under the signature, as that would invalidate it. Add the signature
// and its child as-is
if (addHeaders) {
......@@ -983,7 +983,7 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
}
else if (isMultipart) {
qCDebug(MESSAGEVIEWER_LOG) << "Current node is a multipart node, adding its header and then processing all children.";
qCDebug(MIMETREEPARSER_LOG) << "Current node is a multipart node, adding its header and then processing all children.";
// Normal multipart node, add the header and all of its children
bool somethingChanged = false;
if (addHeaders) {
......@@ -1002,7 +1002,7 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
}
else if (curNode->bodyIsMessage()) {
qCDebug(MESSAGEVIEWER_LOG) << "Current node is a message, adding the header and then processing the child.";
qCDebug(MIMETREEPARSER_LOG) << "Current node is a message, adding the header and then processing the child.";
if (addHeaders) {
resultingData += curNode->head() + '\n';
}
......@@ -1011,7 +1011,7 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
}
else {
qCDebug(MESSAGEVIEWER_LOG) << "Current node is an ordinary leaf node, adding it as-is.";
qCDebug(MIMETREEPARSER_LOG) << "Current node is an ordinary leaf node, adding it as-is.";
if (addHeaders) {
resultingData += curNode->head() + '\n';
}
......@@ -1020,7 +1020,7 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
}
}
qCDebug(MESSAGEVIEWER_LOG) << "(" << recursionLevel << ") done.";
qCDebug(MIMETREEPARSER_LOG) << "(" << recursionLevel << ") done.";
return returnValue;
}
......@@ -1030,7 +1030,7 @@ KMime::Message::Ptr NodeHelper::unencryptedMessage(const KMime::Message::Ptr &or
const bool messageChanged = unencryptedMessage_helper(originalMessage.data(), resultingData, true);
if (messageChanged) {
#if 0
qCDebug(MESSAGEVIEWER_LOG) << "Resulting data is:" << resultingData;
qCDebug(MIMETREEPARSER_LOG) << "Resulting data is:" << resultingData;