Messagelib

jobbase.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "jobbase.h"
8
9#include "composer/composer.h"
10#include "job/jobbase_p.h"
11
12#include "messagecomposer_debug.h"
13
14using namespace MessageComposer;
15
16JobBase::JobBase(QObject *parent)
17 : KCompositeJob(parent)
18 , d_ptr(new JobBasePrivate(this))
19{
20}
21
22JobBase::JobBase(JobBasePrivate &dd, QObject *parent)
23 : KCompositeJob(parent)
24 , d_ptr(&dd)
25{
26}
27
28JobBase::~JobBase()
29{
30 delete d_ptr;
31}
32
33GlobalPart *JobBase::globalPart()
34{
35 for (QObject *obj = this; obj != nullptr; obj = obj->parent()) {
36 auto composer = qobject_cast<Composer *>(obj);
37 if (composer) {
38 return composer->globalPart();
39 }
40 }
41
42 qCCritical(MESSAGECOMPOSER_LOG) << "Job is not part of a Composer.";
43 return nullptr;
44}
45
46#include "moc_jobbase.cpp"
The GlobalPart class.
Definition globalpart.h:20
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
QObject * parent() const const
T qobject_cast(QObject *object)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.