mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #236, aircraft indexer to read FSX/9 models on disk in background
This commit is contained in:
45
src/blacksim/fscommon/aircraftindexer.h
Normal file
45
src/blacksim/fscommon/aircraftindexer.h
Normal 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
|
||||
Reference in New Issue
Block a user