mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-09 03:57:51 +03:00
moved load code from Document to Loader class
This commit is contained in:
parent
ab94e70724
commit
e09218f164
4 changed files with 50 additions and 45 deletions
|
@ -8,23 +8,6 @@
|
|||
#include <components/files/configurationmanager.hpp>
|
||||
#endif
|
||||
|
||||
void CSMDoc::Document::load (const std::vector<boost::filesystem::path>::const_iterator& begin,
|
||||
const std::vector<boost::filesystem::path>::const_iterator& end, bool lastAsModified)
|
||||
{
|
||||
assert (begin!=end);
|
||||
|
||||
std::vector<boost::filesystem::path>::const_iterator end2 (end);
|
||||
|
||||
if (lastAsModified)
|
||||
--end2;
|
||||
|
||||
for (std::vector<boost::filesystem::path>::const_iterator iter (begin); iter!=end2; ++iter)
|
||||
getData().loadFile (*iter, true, false);
|
||||
|
||||
if (lastAsModified)
|
||||
getData().loadFile (*end2, false, false);
|
||||
}
|
||||
|
||||
void CSMDoc::Document::addGmsts()
|
||||
{
|
||||
static const char *gmstFloats[] =
|
||||
|
@ -2272,21 +2255,6 @@ CSMDoc::Document::~Document()
|
|||
{
|
||||
}
|
||||
|
||||
void CSMDoc::Document::setupData()
|
||||
{
|
||||
if (!mNew || mContentFiles.size()>1)
|
||||
{
|
||||
std::vector<boost::filesystem::path>::const_iterator end = mContentFiles.end();
|
||||
|
||||
if (mNew)
|
||||
--end;
|
||||
|
||||
load (mContentFiles.begin(), end, !mNew);
|
||||
}
|
||||
|
||||
getData().loadFile (mProjectPath, false, true);
|
||||
}
|
||||
|
||||
QUndoStack& CSMDoc::Document::getUndoStack()
|
||||
{
|
||||
return mUndoStack;
|
||||
|
@ -2313,6 +2281,11 @@ const boost::filesystem::path& CSMDoc::Document::getSavePath() const
|
|||
return mSavePath;
|
||||
}
|
||||
|
||||
const boost::filesystem::path& CSMDoc::Document::getProjectPath() const
|
||||
{
|
||||
return mProjectPath;
|
||||
}
|
||||
|
||||
const std::vector<boost::filesystem::path>& CSMDoc::Document::getContentFiles() const
|
||||
{
|
||||
return mContentFiles;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue