1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-15 16:39:40 +00:00
* Requires boost::filesystem::canonical() from v1.48
* reduces startup time
* Fixes asset files being listed multiple times in tables
This commit is contained in:
cc9cii 2015-07-30 16:30:59 +10:00
parent 7247da5a77
commit 5bef43ac14
2 changed files with 23 additions and 5 deletions

View file

@ -159,15 +159,23 @@ std::pair<Files::PathContainer, std::vector<std::string> > CS::Editor::readConfi
}
dataDirs.insert (dataDirs.end(), dataLocal.begin(), dataLocal.end());
Files::PathContainer canonicalPaths;
//iterate the data directories and add them to the file dialog for loading
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)
{
boost::filesystem::path p = boost::filesystem::canonical(*iter);
Files::PathContainer::iterator it = std::find(canonicalPaths.begin(), canonicalPaths.end(), p);
if (it == canonicalPaths.end())
canonicalPaths.push_back(p);
else
continue;
QString path = QString::fromUtf8 (iter->string().c_str());
mFileDialog.addFiles(path);
}
return std::make_pair (dataDirs, variables["fallback-archive"].as<std::vector<std::string> >());
return std::make_pair (canonicalPaths, variables["fallback-archive"].as<std::vector<std::string> >());
}
void CS::Editor::createGame()

View file

@ -57,14 +57,24 @@ void ConfigurationManager::readConfiguration(boost::program_options::variables_m
bool silent = mSilent;
mSilent = quiet;
boost::filesystem::path pUser = boost::filesystem::canonical(mFixedPath.getUserConfigPath());
boost::filesystem::path pLocal = boost::filesystem::canonical(mFixedPath.getLocalPath());
boost::filesystem::path pGlobal = boost::filesystem::canonical(mFixedPath.getGlobalConfigPath());
loadConfig(mFixedPath.getUserConfigPath(), variables, description);
boost::program_options::notify(variables);
loadConfig(mFixedPath.getLocalPath(), variables, description);
boost::program_options::notify(variables);
loadConfig(mFixedPath.getGlobalConfigPath(), variables, description);
boost::program_options::notify(variables);
if (pLocal != pUser)
{
loadConfig(mFixedPath.getLocalPath(), variables, description);
boost::program_options::notify(variables);
}
if (pGlobal != pUser && pGlobal != pLocal)
{
loadConfig(mFixedPath.getGlobalConfigPath(), variables, description);
boost::program_options::notify(variables);
}
mSilent = silent;
}