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;
}
......
This diff is collapsed.
......@@ -34,7 +34,7 @@
#include "partnodebodypart.h"
#include "nodehelper.h"
#include "objecttreeparser.h"
#include "messageviewer_debug.h"
#include "mimetreeparser_debug.h"
#include <KMime/Content>
#include <QTextCodec>
......@@ -90,7 +90,7 @@ QString PartNodeBodyPart::contentDispositionParameter(const char *param) const
bool PartNodeBodyPart::hasCompleteBody() const
{
qCWarning(MESSAGEVIEWER_LOG) << "Sorry, not yet implemented.";
qCWarning(MIMETREEPARSER_LOG) << "Sorry, not yet implemented.";
return true;
}
......
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