mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-14 10:21:09 +00:00
Merge branch 'editorfix'
This commit is contained in:
commit
78393bca30
@ -1,6 +1,7 @@
|
||||
#include "document.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <fstream>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
@ -2218,16 +2219,18 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration,
|
||||
|
||||
if (!boost::filesystem::exists (mProjectPath))
|
||||
{
|
||||
boost::filesystem::path locCustomFiltersPath (configuration.getUserDataPath());
|
||||
locCustomFiltersPath /= "defaultfilters";
|
||||
boost::filesystem::path customFiltersPath (configuration.getUserDataPath());
|
||||
customFiltersPath /= "defaultfilters";
|
||||
|
||||
if (boost::filesystem::exists (locCustomFiltersPath))
|
||||
std::ofstream destination (mProjectPath.string().c_str(), std::ios::binary);
|
||||
|
||||
if (boost::filesystem::exists (customFiltersPath))
|
||||
{
|
||||
boost::filesystem::copy_file (locCustomFiltersPath, mProjectPath);
|
||||
destination << std::ifstream(customFiltersPath.c_str(), std::ios::binary).rdbuf();
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::filesystem::copy_file (mResDir / "defaultfilters", mProjectPath);
|
||||
destination << std::ifstream(std::string(mResDir.string() + "/defaultfilters").c_str(), std::ios::binary).rdbuf();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user