1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 06:15:32 +00:00

Fixed broken dependency check

This commit is contained in:
graffy76 2013-11-03 06:21:28 -06:00
parent 973803eb2f
commit 12c06a5615
2 changed files with 10 additions and 6 deletions

View file

@ -138,7 +138,7 @@ void CSVDoc::FileDialog::slotUpdateAcceptButton(const QString &name, bool)
success = success && !(name.isEmpty());
else
{
ContentSelectorModel::EsmFile *file = mSelector->selectedFiles().back();;
ContentSelectorModel::EsmFile *file = mSelector->selectedFiles().back();
mAdjusterWidget->setName (file->filePath(), !file->isGameFile());
}

View file

@ -3,7 +3,6 @@
#include <QDir>
#include <QTextCodec>
#include <QMessageBox>
#include <QDebug>
#include "components/esm/esmreader.hpp"
@ -69,9 +68,14 @@ ContentSelectorModel::EsmFile *ContentSelectorModel::ContentModel::item(int row)
}
const ContentSelectorModel::EsmFile *ContentSelectorModel::ContentModel::item(const QString &name) const
{
EsmFile::FileProperty fp = EsmFile::FileProperty_FileName;
if (name.contains ('/'))
fp = EsmFile::FileProperty_FilePath;
foreach (const EsmFile *file, mFiles)
{
if (name == file->filePath())
if (name == file->fileProperty (fp).toString())
return file;
}
return 0;
@ -538,15 +542,15 @@ bool ContentSelectorModel::ContentModel::setCheckState(const QString &name, bool
//if we're checking an item, ensure all "upstream" files (dependencies) are checked as well.
if (state == Qt::Checked)
{
foreach (const QString &upstreamName, file->gameFiles())
foreach (QString upstreamName, file->gameFiles())
{
const EsmFile *upstreamFile = item(upstreamName);
if (!upstreamFile)
continue;
if (!isChecked(upstreamName))
mCheckStates[upstreamName] = Qt::Checked;
if (!isChecked(upstreamFile->filePath()))
mCheckStates[upstreamFile->filePath()] = Qt::Checked;
emit dataChanged(indexFromItem(upstreamFile), indexFromItem(upstreamFile));