mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-09 03:57:51 +03:00
moved new flag from setupData function to Document constructor
This commit is contained in:
parent
5f1d2f72f6
commit
8dc6ad5059
9 changed files with 31 additions and 25 deletions
|
@ -2220,9 +2220,9 @@ void CSMDoc::Document::createBase()
|
|||
}
|
||||
|
||||
CSMDoc::Document::Document (const Files::ConfigurationManager& configuration,
|
||||
const std::vector< boost::filesystem::path >& files,
|
||||
const std::vector< boost::filesystem::path >& files, bool new_,
|
||||
const boost::filesystem::path& savePath, const boost::filesystem::path& resDir)
|
||||
: mSavePath (savePath), mContentFiles (files), mTools (mData), mResDir(resDir),
|
||||
: mSavePath (savePath), mContentFiles (files), mNew (new_), mTools (mData), mResDir(resDir),
|
||||
mProjectPath ((configuration.getUserDataPath() / "projects") /
|
||||
(savePath.filename().string() + ".project")),
|
||||
mSaving (*this, mProjectPath)
|
||||
|
@ -2260,21 +2260,21 @@ CSMDoc::Document::~Document()
|
|||
{
|
||||
}
|
||||
|
||||
void CSMDoc::Document::setupData (bool new_)
|
||||
void CSMDoc::Document::setupData()
|
||||
{
|
||||
if (new_ && mContentFiles.size()==1)
|
||||
if (mNew && mContentFiles.size()==1)
|
||||
createBase();
|
||||
else
|
||||
{
|
||||
std::vector<boost::filesystem::path>::const_iterator end = mContentFiles.end();
|
||||
|
||||
if (new_)
|
||||
if (mNew)
|
||||
--end;
|
||||
|
||||
load (mContentFiles.begin(), end, !new_);
|
||||
load (mContentFiles.begin(), end, !mNew);
|
||||
}
|
||||
|
||||
if (new_)
|
||||
if (mNew)
|
||||
{
|
||||
mData.setDescription ("");
|
||||
mData.setAuthor ("");
|
||||
|
@ -2317,6 +2317,11 @@ const std::vector<boost::filesystem::path>& CSMDoc::Document::getContentFiles()
|
|||
return mContentFiles;
|
||||
}
|
||||
|
||||
bool CSMDoc::Document::isNew() const
|
||||
{
|
||||
return mNew;
|
||||
}
|
||||
|
||||
void CSMDoc::Document::save()
|
||||
{
|
||||
if (mSaving.isRunning())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue