Messagelib

jobbase.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
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 
14 using namespace MessageComposer;
15 
16 JobBase::JobBase(QObject *parent)
17  : KCompositeJob(parent)
18  , d_ptr(new JobBasePrivate(this))
19 {
20 }
21 
22 JobBase::JobBase(JobBasePrivate &dd, QObject *parent)
23  : KCompositeJob(parent)
24  , d_ptr(&dd)
25 {
26 }
27 
28 JobBase::~JobBase()
29 {
30  delete d_ptr;
31 }
32 
33 GlobalPart *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"
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The GlobalPart class.
Definition: globalpart.h:19
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 8 2023 03:55:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.