mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-16 08:42:23 +00:00
Bug fixes for configuration handling.
Added erasing double quotes from paths, corrected retriveing installation path from wine registry. Updated doxygen comments. Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
This commit is contained in:
parent
d5f1d7eed7
commit
3da6af6e38
@ -6,6 +6,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
#include <boost/algorithm/string/erase.hpp>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \namespace Files
|
* \namespace Files
|
||||||
@ -69,9 +70,11 @@ void ConfigurationManager::readConfiguration(boost::program_options::variables_m
|
|||||||
|
|
||||||
void ConfigurationManager::processPaths(Files::PathContainer& dataDirs)
|
void ConfigurationManager::processPaths(Files::PathContainer& dataDirs)
|
||||||
{
|
{
|
||||||
|
std::string path;
|
||||||
for (Files::PathContainer::iterator it = dataDirs.begin(); it != dataDirs.end(); ++it)
|
for (Files::PathContainer::iterator it = dataDirs.begin(); it != dataDirs.end(); ++it)
|
||||||
{
|
{
|
||||||
const std::string& path = it->string();
|
path = it->string();
|
||||||
|
boost::erase_all(path, "\"");
|
||||||
|
|
||||||
// Check if path contains a token
|
// Check if path contains a token
|
||||||
if (!path.empty() && *path.begin() == '?')
|
if (!path.empty() && *path.begin() == '?')
|
||||||
|
@ -105,11 +105,16 @@ boost::filesystem::path LinuxPath::getInstallPath() const
|
|||||||
std::string line;
|
std::string line;
|
||||||
std::string mwpath;
|
std::string mwpath;
|
||||||
|
|
||||||
while (std::getline(file, line) && !line.empty())
|
while (std::getline(file, line))
|
||||||
{
|
{
|
||||||
if (line[0] == '[') // we found an entry
|
if (line[0] == '[') // we found an entry
|
||||||
{
|
{
|
||||||
isRegEntry = (line.find("Softworks\\Morrowind]") != std::string::npos);
|
if (isRegEntry)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
isRegEntry = (line.find("Softworks\\\\Morrowind]") != std::string::npos);
|
||||||
}
|
}
|
||||||
else if (isRegEntry)
|
else if (isRegEntry)
|
||||||
{
|
{
|
||||||
|
@ -39,21 +39,21 @@ namespace Files
|
|||||||
struct MacOsPath
|
struct MacOsPath
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* \brief Return path to the local configuration directory.
|
* \brief Return path to the local directory.
|
||||||
*
|
*
|
||||||
* \return boost::filesystem::path
|
* \return boost::filesystem::path
|
||||||
*/
|
*/
|
||||||
boost::filesystem::path getUserPath() const;
|
boost::filesystem::path getUserPath() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return path to the global (system) configuration directory.
|
* \brief Return path to the global (system) directory.
|
||||||
*
|
*
|
||||||
* \return boost::filesystem::path
|
* \return boost::filesystem::path
|
||||||
*/
|
*/
|
||||||
boost::filesystem::path getGlobalPath() const;
|
boost::filesystem::path getGlobalPath() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return path to the runtime configuration directory which is the
|
* \brief Return path to the runtime directory which is the
|
||||||
* place where an application was started.
|
* place where an application was started.
|
||||||
*
|
*
|
||||||
* \return boost::filesystem::path
|
* \return boost::filesystem::path
|
||||||
|
@ -62,7 +62,7 @@ struct WindowsPath
|
|||||||
boost::filesystem::path getLocalPath() const;
|
boost::filesystem::path getLocalPath() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return same path like getGlobalConfigPath
|
* \brief Return same path like getGlobalPath
|
||||||
*
|
*
|
||||||
* \return boost::filesystem::path
|
* \return boost::filesystem::path
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user