File indexing completed on 2025-01-05 05:23:29

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "filterjob.hpp"
0010 
0011 // filter
0012 #include <abstractbytearrayfilter.hpp>
0013 // Qt
0014 #include <QCoreApplication>
0015 
0016 namespace Kasten {
0017 
0018 bool FilterJob::exec()
0019 {
0020     // TODO: what kind of signal could a filter send?
0021     connect(mByteArrayFilter, &AbstractByteArrayFilter::filteredBytes, this, &FilterJob::onFilteredBytes);
0022 
0023     const bool result = mByteArrayFilter->filter(mResult, mModel, mRange);
0024 
0025     deleteLater();
0026 
0027     return result;
0028 }
0029 
0030 void FilterJob::onFilteredBytes()
0031 {
0032     QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers);
0033 }
0034 
0035 }
0036 
0037 #include "moc_filterjob.cpp"