File indexing completed on 2024-05-05 05:48:27

0001 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0002 // SPDX-FileCopyrightText: 2017-2021 Harald Sitter <sitter@kde.org>
0003 
0004 #ifndef FILERESOLVER_H
0005 #define FILERESOLVER_H
0006 
0007 #include <QObject>
0008 
0009 #include <PackageKit/Transaction>
0010 #include <memory>
0011 
0012 #include "File.h"
0013 
0014 class File;
0015 
0016 class FileResolver : public QObject
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit FileResolver(std::shared_ptr<File> file, QObject *parent = nullptr);
0021 
0022     void resolve();
0023     void resolve(const QString &path);
0024 
0025 signals:
0026     void finished();
0027 
0028 private slots:
0029     void packageFound(PackageKit::Transaction::Info, const QString &packageID, const QString &/* summary */);
0030     void debugResolverFinished();
0031 
0032 private:
0033     const std::shared_ptr<File> m_file;
0034     bool m_triedUsrMerge = false;
0035 };
0036 
0037 #endif // FILERESOLVER_H