forked from teamnwah/openmw-tes3coop
Fixed broken dependency check
This commit is contained in:
parent
973803eb2f
commit
12c06a5615
2 changed files with 10 additions and 6 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in a new issue