mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #236, default FSX path by registry
Includes a setter for index map
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace BlackSim
|
||||
|
||||
enum
|
||||
{
|
||||
SetupSimConnectCfgFile = 1000
|
||||
SetupSimConnectCfgFile = 1000, //!< location of simconnect.cfg file
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user