File indexing completed on 2024-06-16 04:49:59

0001 /******************************************************************************
0002  *
0003  *  SPDX-FileCopyrightText: 2009 Szymon Stefanek <s.stefanek at gmail dot com>
0004  *
0005  *  SPDX-License-Identifier: LGPL-2.0-or-later
0006  *
0007  *****************************************************************************/
0008 
0009 #include "preprocessorbase.h"
0010 
0011 #include "preprocessorbase_p.h"
0012 
0013 using namespace Akonadi;
0014 
0015 PreprocessorBase::PreprocessorBase(const QString &id)
0016     : AgentBase(new PreprocessorBasePrivate(this), id)
0017 {
0018 }
0019 
0020 PreprocessorBase::~PreprocessorBase()
0021 {
0022 }
0023 
0024 void PreprocessorBase::finishProcessing(ProcessingResult result)
0025 {
0026     Q_D(PreprocessorBase);
0027 
0028     Q_ASSERT_X(result != ProcessingDelayed, "PreprocessorBase::terminateProcessing", "You should never pass ProcessingDelayed to this function");
0029     Q_ASSERT_X(d->mInDelayedProcessing, "PreprocessorBase::terminateProcessing", "terminateProcessing() called while not in delayed processing mode");
0030     Q_UNUSED(result)
0031 
0032     d->mInDelayedProcessing = false;
0033     Q_EMIT d->itemProcessed(d->mDelayedProcessingItemId);
0034 }
0035 
0036 void PreprocessorBase::setFetchScope(const ItemFetchScope &fetchScope)
0037 {
0038     Q_D(PreprocessorBase);
0039 
0040     d->mFetchScope = fetchScope;
0041 }
0042 
0043 ItemFetchScope &PreprocessorBase::fetchScope()
0044 {
0045     Q_D(PreprocessorBase);
0046 
0047     return d->mFetchScope;
0048 }
0049 
0050 #include "moc_preprocessorbase.cpp"