refs #236, aircraft indexer to read FSX/9 models on disk in background

This commit is contained in:
Klaus Basan
2014-05-13 01:11:04 +02:00
parent 36b5915511
commit 4d57a50fd2
4 changed files with 80 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#ifndef BLACKSIM_FSCOMMON_AIRCRAFTINDEXER_H
#define BLACKSIM_FSCOMMON_AIRCRAFTINDEXER_H
#include "aircraftcfgentrieslist.h"
#include <QObject>
#include <QtConcurrent/QtConcurrent>
namespace BlackSim
{
namespace FsCommon
{
/*!
* \brief Indexer for all modelsThe CAircraftIndexer class
*/
class CAircraftIndexer : QObject
{
Q_OBJECT
private:
//! Constructor
CAircraftIndexer(QObject *parent = nullptr);
CAircraftCfgEntriesList m_entries; //!< all entries
signals:
void entriesRead(int number);
public:
//! Single entity indexer
static CAircraftIndexer &indexer()
{
static CAircraftIndexer indexer;
return indexer;
}
//! Read for directory or re-read
static int read(const QString directory = "");
//! Read in background
static QFuture<int> readInBackground(const QString directory = "");
};
}
}
#endif // guard