mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-02 14:57:59 +03:00
Fixed broken dependency check
This commit is contained in:
parent
973803eb2f
commit
12c06a5615
2 changed files with 10 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue