2015-11-15 18:46:42 +01:00
|
|
|
#ifndef REPOINDEX_PACKAGEFINDER_H
|
|
|
|
#define REPOINDEX_PACKAGEFINDER_H
|
|
|
|
|
2015-12-08 00:24:45 +01:00
|
|
|
#include "./package.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
2015-11-15 18:46:42 +01:00
|
|
|
|
|
|
|
namespace RepoIndex {
|
|
|
|
|
2015-12-08 00:24:45 +01:00
|
|
|
class Manager;
|
|
|
|
|
2015-11-15 18:46:42 +01:00
|
|
|
class PackageFinder : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2016-02-10 21:09:20 +01:00
|
|
|
explicit PackageFinder(Manager &manager, const QList<Dependency> &dependencies, bool sourcesRequired = false, QObject *parent = nullptr);
|
2015-12-08 00:24:45 +01:00
|
|
|
|
2016-02-10 21:09:20 +01:00
|
|
|
void setSourcesRequired(bool sourcesRequired);
|
2015-12-08 00:24:45 +01:00
|
|
|
const QList<Package *> results() const;
|
|
|
|
bool areAllResultsAvailable() const;
|
2015-12-25 01:58:19 +01:00
|
|
|
Package *packageProviding(const Dependency &dependency);
|
2015-11-15 18:46:42 +01:00
|
|
|
|
2020-03-09 18:45:47 +01:00
|
|
|
Q_SIGNALS:
|
2015-12-08 00:24:45 +01:00
|
|
|
void resultsAvailable();
|
|
|
|
|
2020-03-08 14:12:22 +01:00
|
|
|
private Q_SLOTS:
|
2015-12-08 00:24:45 +01:00
|
|
|
void addResults();
|
2015-11-15 18:46:42 +01:00
|
|
|
|
2015-12-08 00:24:45 +01:00
|
|
|
private:
|
2016-02-10 21:09:20 +01:00
|
|
|
//bool m_sourcesRequired;
|
2015-12-08 00:24:45 +01:00
|
|
|
int m_remainingReplies;
|
|
|
|
QList<Package *> m_results;
|
2015-11-15 18:46:42 +01:00
|
|
|
};
|
|
|
|
|
2016-02-10 21:09:20 +01:00
|
|
|
//void PackageFinder::setSourcesRequired(bool sourcesRequired)
|
|
|
|
//{
|
|
|
|
// return m_sourcesRequired;
|
|
|
|
//}
|
|
|
|
|
2015-12-08 00:24:45 +01:00
|
|
|
inline const QList<Package *> PackageFinder::results() const
|
|
|
|
{
|
|
|
|
return m_results;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool PackageFinder::areAllResultsAvailable() const
|
|
|
|
{
|
|
|
|
return !m_remainingReplies;
|
|
|
|
}
|
|
|
|
|
2015-11-15 18:46:42 +01:00
|
|
|
} // namespace RepoIndex
|
|
|
|
|
|
|
|
#endif // REPOINDEX_PACKAGEFINDER_H
|