refs #236, default FSX path by registry

Includes a setter for index map
This commit is contained in:
Klaus Basan
2014-05-13 01:14:48 +02:00
parent 4d57a50fd2
commit a2bfe36f37
3 changed files with 24 additions and 1 deletions

View File

@@ -1,5 +1,10 @@
#include "fsxsimulatorsetup.h"
#include "../../blackmisc/project.h"
#include "../fsx/simconnectutilities.h"
#include <QSettings>
using namespace BlackMisc;
namespace BlackSim
{
@@ -9,6 +14,20 @@ namespace BlackSim
{
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));
}
}
}
}

View File

@@ -24,7 +24,7 @@ namespace BlackSim
enum
{
SetupSimConnectCfgFile = 1000
SetupSimConnectCfgFile = 1000, //!< location of simconnect.cfg file
};