Messagelib
7 #include "contentjobbase.h"
8 #include "contentjobbase_p.h"
10 #include "messagecomposer_debug.h"
12 #include <KMime/Content>
16 void ContentJobBasePrivate::init(
QObject *parent)
19 auto parentJob = qobject_cast<ContentJobBase *>(parent);
21 if (!parentJob->appendSubjob(q)) {
22 qCWarning(MESSAGECOMPOSER_LOG) <<
"Impossible to add subjob.";
27 void ContentJobBasePrivate::doNextSubjob()
30 if (q->hasSubjobs()) {
31 q->subjobs().first()->start();
33 qCDebug(MESSAGECOMPOSER_LOG) <<
"Calling process.";
38 ContentJobBase::ContentJobBase(
QObject *parent)
39 :
JobBase(*new ContentJobBasePrivate(this), parent)
45 ContentJobBase::ContentJobBase(ContentJobBasePrivate &dd,
QObject *parent)
52 ContentJobBase::~ContentJobBase() =
default;
63 Q_ASSERT(d->resultContent);
64 return d->resultContent;
77 d->extraContent = extra;
84 return d->extraContent;
87 bool ContentJobBase::addSubjob(
KJob *job)
90 qCCritical(MESSAGECOMPOSER_LOG) <<
"Use appendJob() instead.";
95 void ContentJobBase::doStart()
98 Q_ASSERT(d->resultContent ==
nullptr && d->subjobContents.isEmpty());
103 void ContentJobBase::slotResult(
KJob *job)
107 qCDebug(MESSAGECOMPOSER_LOG) <<
"A subjob finished." << subjobs().count() <<
"more to go.";
114 d->subjobContents.append(cjob->content());
118 #include "moc_contentjobbase.cpp"
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
Q_SCRIPTABLE Q_NOREPLY void start()
A dummy abstract class defining some errors pertaining to the Composer.
virtual bool addSubjob(KJob *job)
void setParent(QObject *parent)
virtual void slotResult(KJob *job)
The ContentJobBase class.
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 1 2023 03:57:05 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.