File indexing completed on 2024-04-21 04:39:57

0001 /*
0002     SPDX-FileCopyrightText: 2019 Stefan BrĂ¼ns <stefan.bruens@rwth-aachen.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #ifndef ONDEMANDEXTRACTOR_H
0008 #define ONDEMANDEXTRACTOR_H
0009 
0010 #include <KFileMetaData/Properties>
0011 #include <QProcess>
0012 
0013 namespace Baloo
0014 {
0015 namespace Private
0016 {
0017 class OnDemandExtractor : public QObject
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit OnDemandExtractor(QObject *parent = nullptr);
0023     ~OnDemandExtractor() override;
0024 
0025     void process(const QString &filePath);
0026 
0027     bool waitFinished();
0028     KFileMetaData::PropertyMultiMap properties() const;
0029 
0030 Q_SIGNALS:
0031     void fileFinished(QProcess::ExitStatus exitStatus);
0032 
0033 private Q_SLOTS:
0034     void slotIndexedFile(int exitCode, QProcess::ExitStatus exitStatus);
0035 
0036 private:
0037     QProcess m_process;
0038     KFileMetaData::PropertyMultiMap m_properties;
0039 };
0040 
0041 } // namespace Private
0042 } // namespace Baloo
0043 
0044 #endif // ONDEMANDEXTRACTOR_H