mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
Aircraft parser (FSX/P3D) added "sim.cfg" files as filter plus style
This commit is contained in:
committed by
Roland Winklmeier
parent
82648038ac
commit
b5aeffc31b
@@ -33,14 +33,14 @@ namespace BlackMisc
|
|||||||
//! \remarks an entry in the aircraft.cfg is title, atc type, ...
|
//! \remarks an entry in the aircraft.cfg is title, atc type, ...
|
||||||
//! This class already bundles relevant entries, hence the class is named Entries (plural)
|
//! This class already bundles relevant entries, hence the class is named Entries (plural)
|
||||||
class BLACKMISC_EXPORT CAircraftCfgEntries:
|
class BLACKMISC_EXPORT CAircraftCfgEntries:
|
||||||
public BlackMisc::CValueObject<CAircraftCfgEntries>,
|
public CValueObject<CAircraftCfgEntries>,
|
||||||
public BlackMisc::ITimestampBased
|
public ITimestampBased
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Properties by index
|
//! Properties by index
|
||||||
enum ColumnIndex
|
enum ColumnIndex
|
||||||
{
|
{
|
||||||
IndexEntryIndex = BlackMisc::CPropertyIndex::GlobalIndexCAircraftCfgEntries,
|
IndexEntryIndex = CPropertyIndex::GlobalIndexCAircraftCfgEntries,
|
||||||
IndexFileName,
|
IndexFileName,
|
||||||
IndexTitle,
|
IndexTitle,
|
||||||
IndexAirline,
|
IndexAirline,
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
//! Utility, providing FS aircraft.cfg entries
|
//! Utility, providing FS aircraft.cfg entries
|
||||||
class BLACKMISC_EXPORT CAircraftCfgEntriesList :
|
class BLACKMISC_EXPORT CAircraftCfgEntriesList :
|
||||||
public BlackMisc::CSequence<CAircraftCfgEntries>,
|
public CSequence<CAircraftCfgEntries>,
|
||||||
public BlackMisc::Mixin::MetaType<CAircraftCfgEntriesList>
|
public Mixin::MetaType<CAircraftCfgEntriesList>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CAircraftCfgEntriesList)
|
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CAircraftCfgEntriesList)
|
||||||
|
|||||||
@@ -165,7 +165,8 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set directory with name filters, get aircraft.cfg and sub directories
|
// set directory with name filters, get aircraft.cfg and sub directories
|
||||||
const QDir dir(directory, fileFilter(), QDir::Name, QDir::Files | QDir::AllDirs | QDir::NoDotAndDotDot);
|
QDir dir(directory, "", QDir::Name, QDir::Files | QDir::AllDirs | QDir::NoDotAndDotDot);
|
||||||
|
dir.setNameFilters(fileNameFilters());
|
||||||
if (!dir.exists())
|
if (!dir.exists())
|
||||||
{
|
{
|
||||||
*ok = true;
|
*ok = true;
|
||||||
@@ -403,9 +404,9 @@ namespace BlackMisc
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &CAircraftCfgParser::fileFilter()
|
const QStringList &CAircraftCfgParser::fileNameFilters()
|
||||||
{
|
{
|
||||||
static const QString f("aircraft.cfg");
|
static const QStringList f({ "aircraft.cfg", "sim.cfg" });
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace BlackMisc
|
|||||||
static QString getFixedIniLineContent(const QString &line);
|
static QString getFixedIniLineContent(const QString &line);
|
||||||
|
|
||||||
//! Files to be used
|
//! Files to be used
|
||||||
static const QString &fileFilter();
|
static const QStringList &fileNameFilters();
|
||||||
|
|
||||||
CAircraftCfgEntriesList m_parsedCfgEntriesList; //!< parsed entries
|
CAircraftCfgEntriesList m_parsedCfgEntriesList; //!< parsed entries
|
||||||
QPointer<BlackMisc::CWorker> m_parserWorker; //!< worker will destroy itself, so weak pointer
|
QPointer<BlackMisc::CWorker> m_parserWorker; //!< worker will destroy itself, so weak pointer
|
||||||
|
|||||||
Reference in New Issue
Block a user