From: <pst...@us...> - 2013-01-07 00:53:20
|
Revision: 944 http://sourceforge.net/p/jazzplusplus/code/944 Author: pstieber Date: 2013-01-07 00:53:17 +0000 (Mon, 07 Jan 2013) Log Message: ----------- Updated code to find jazz.cfg. Modified Paths: -------------- trunk/jazz/src/Project.cpp Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2013-01-06 22:53:47 UTC (rev 943) +++ trunk/jazz/src/Project.cpp 2013-01-07 00:53:17 UTC (rev 944) @@ -365,10 +365,24 @@ //----------------------------------------------------------------------------- void JZProject::ReadConfiguration() { - wxString ConfigDir = wxStandardPaths::Get().GetUserDataDir(); + wxConfigBase* pConfig = wxConfigBase::Get(); + wxString ConfigurationFilePathGuess = + wxStandardPaths::Get().GetUserDataDir(); + + // Attempt to obtain the path to the help file from configuration data. + wxString ConfigurationFilePath; + if (pConfig) + { + pConfig->Read( + "/Paths/Conf", + &ConfigurationFilePath, + ConfigurationFilePathGuess); + } + + // Construct a full file name. wxString JazzCfgFile = - ConfigDir + + ConfigurationFilePath + wxFileName::GetPathSeparator() + mConfFileName; @@ -377,10 +391,10 @@ if (!::wxFileExists(JazzCfgFile)) { // Return a valid path to the data. - wxString ConfFilePath; - if (FindAndRegisterConfFilePath(ConfFilePath)) + ConfigurationFilePath.clear(); + if (FindAndRegisterConfFilePath(ConfigurationFilePath)) { - JazzCfgFile = ConfFilePath + mConfFileName; + JazzCfgFile = ConfigurationFilePath + mConfFileName; // Try one more time. if (!::wxFileExists(JazzCfgFile)) @@ -400,11 +414,6 @@ if (ConfigurationFileFound) { - cout - << "JZProject::ReadConfiguration() JazzCfgFile:" << '\n' - << " \"" << JazzCfgFile << '"' - << endl; - mpConfig->LoadConfig(JazzCfgFile); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |