Skip to content

Commit

Permalink
Fixed compilation issues with 32-bit version
Browse files Browse the repository at this point in the history
  • Loading branch information
albar965 committed Dec 25, 2024
1 parent 215929d commit 333a068
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion src/fs/sc/airport/simconnectloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace fs {
namespace sc {
namespace airport {

#if !defined(SIMCONNECT_BUILD_WIN32)
const static SIMCONNECT_DATA_DEFINITION_ID FACILITY_DATA_AIRPORT_DEFINITION_ID = 1000;
const static SIMCONNECT_DATA_REQUEST_ID FACILITY_LIST_REQUEST_AIRPORT_ID = 100;
// const static SIMCONNECT_DATA_REQUEST_ID FACILITY_LIST_REQUEST_WAYPOINT_ID = 200;
Expand Down Expand Up @@ -126,7 +127,6 @@ class SimConnectLoaderPrivate
// Key is pFacilityData->UserRequestId
QMap<unsigned long, atools::fs::sc::airport::Airport> airportMap;

// Parent type when reading data in dispatch - pFacilityData->Type
SIMCONNECT_FACILITY_DATA_TYPE legsParentType = SIMCONNECT_FACILITY_DATA_AIRPORT;
SIMCONNECT_FACILITY_DATA_TYPE legsParentType2 = SIMCONNECT_FACILITY_DATA_AIRPORT;

Expand Down Expand Up @@ -933,55 +933,97 @@ bool SimConnectLoaderPrivate::writeAirportBatchToDatabase()
return aborted;
}

#endif

// ==================================================================================================================
// ==================================================================================================================
SimConnectLoader::SimConnectLoader(const win::ActivationContext *activationContext, const QString& libraryName,
atools::sql::SqlDatabase& sqlDb, bool verbose)
{
#if !defined(SIMCONNECT_BUILD_WIN32)
p = new SimConnectLoaderPrivate(activationContext, sqlDb, libraryName, verbose);
#else
Q_UNUSED(activationContext)
Q_UNUSED(libraryName)
Q_UNUSED(sqlDb)
Q_UNUSED(verbose)
#endif
}

SimConnectLoader::~SimConnectLoader()
{
#if !defined(SIMCONNECT_BUILD_WIN32)
delete p;
#endif
}

bool SimConnectLoader::loadAirports(const QStringList& idents, int fileId)
{
#if !defined(SIMCONNECT_BUILD_WIN32)
p->fileId = fileId;
p->airportIdentDetail = idents;
return p->loadAirports();
#else
Q_UNUSED(idents)
Q_UNUSED(fileId)
return false;
#endif
}

QStringList SimConnectLoader::loadAirportIdents() const
{
#if !defined(SIMCONNECT_BUILD_WIN32)
p->loadAirportIdents();
return p->airportIdents;
#else
return QStringList();
#endif
}

bool SimConnectLoader::isAborted() const
{
#if !defined(SIMCONNECT_BUILD_WIN32)
return p->aborted;
#else
return false;
#endif
}

void SimConnectLoader::setBatchSize(int value)
{
#if !defined(SIMCONNECT_BUILD_WIN32)
p->batchSize = value;
#else
Q_UNUSED(value)
#endif
}

const QStringList& SimConnectLoader::getErrors() const
{
const static QStringList EMPTY;
#if !defined(SIMCONNECT_BUILD_WIN32)
return p->errors;
#else
return EMPTY;
#endif
}

void SimConnectLoader::setAirportIdents(const QList<QRegExp>& airportIcaoFiltersInc)
{
#if !defined(SIMCONNECT_BUILD_WIN32)
p->airportIcaoFiltersInc = airportIcaoFiltersInc;
#else
Q_UNUSED(airportIcaoFiltersInc)
#endif
}

void SimConnectLoader::setProgressCallback(const SimConnectLoaderProgressCallback& callback)
{
#if !defined(SIMCONNECT_BUILD_WIN32)
p->progressCallback = callback;
#else
Q_UNUSED(callback)
#endif
}

} // namespace airport
Expand Down

0 comments on commit 333a068

Please sign in to comment.