Files
pilotclient/src/blacksim/fsx/fsxsimulatorsetup.cpp
Klaus Basan ee2bddd92b refs #329, PropertyIndex assert
* remark 1: The setup values tagged GlobalIndexAbuseMode are subject of change
* remark 2: Fixed some comments / Doxygen with this here
2014-10-07 13:10:26 +02:00

34 lines
1.2 KiB
C++

#include "fsxsimulatorsetup.h"
#include "../../blackmisc/project.h"
#include "../fsx/simconnectutilities.h"
#include <QSettings>
using namespace BlackMisc;
namespace BlackSim
{
namespace Fsx
{
void CFsxSimulatorSetup::init()
{
CSimulatorSetup::init();
this->m_setup.addValue(SetupSimConnectCfgFile, CSimConnectUtilities::getLocalSimConnectCfgFilename());
if (CProject::isCompiledWithFsxSupport())
{
// set FSX path
QSettings fsxRegistry("HKEY_CURRENT_USER\\Software\\Microsoft\\Microsoft Games\\Flight Simulator\\10.0", QSettings::NativeFormat);
QString fsxPath = fsxRegistry.value("AppPath").toString();
if (fsxPath.isEmpty())
{
// another trial
QSettings fsxRegistry("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Microsoft Games\\Flight Simulator\\10.0", QSettings::NativeFormat);
fsxPath = fsxRegistry.value("SetupPath").toString();
}
if (!fsxPath.isEmpty()) this->m_setup.value(CSimulatorSetup::SetupSimPath, QVariant(fsxPath));
}
}
} // namespace
} // namespace