mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-15 06:56:34 +00:00
Merge branch 'setnew' into 'master'
Don't use item(QString) while marking new content files See merge request OpenMW/openmw!4701
This commit is contained in:
commit
1fff2f0199
2 changed files with 5 additions and 10 deletions
|
@ -424,7 +424,7 @@ void ContentSelectorModel::ContentModel::addFiles(const QString& path, bool newf
|
|||
file->setFilePath(info.absoluteFilePath());
|
||||
if (add)
|
||||
addFile(newFile.release());
|
||||
setNew(file->fileName(), newfiles);
|
||||
setNew(file, newfiles);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -480,7 +480,7 @@ void ContentSelectorModel::ContentModel::addFiles(const QString& path, bool newf
|
|||
// Put the file in the table
|
||||
if (add)
|
||||
addFile(newFile.release());
|
||||
setNew(file->fileName(), newfiles);
|
||||
setNew(file, newfiles);
|
||||
}
|
||||
catch (std::runtime_error& e)
|
||||
{
|
||||
|
@ -619,17 +619,12 @@ bool ContentSelectorModel::ContentModel::isNew(const QString& filepath) const
|
|||
return it.value();
|
||||
}
|
||||
|
||||
void ContentSelectorModel::ContentModel::setNew(const QString& filepath, bool isNew)
|
||||
void ContentSelectorModel::ContentModel::setNew(const EsmFile* file, bool isNew)
|
||||
{
|
||||
if (filepath.isEmpty())
|
||||
return;
|
||||
|
||||
const EsmFile* file = item(filepath);
|
||||
|
||||
if (!file)
|
||||
return;
|
||||
|
||||
mNewFiles[filepath] = isNew;
|
||||
mNewFiles[file->fileName()] = isNew;
|
||||
}
|
||||
|
||||
void ContentSelectorModel::ContentModel::setNonUserContent(const QStringList& fileList)
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace ContentSelectorModel
|
|||
bool isEnabled(const QModelIndex& index) const;
|
||||
bool setCheckState(const EsmFile* file, bool isChecked);
|
||||
bool isNew(const QString& filepath) const;
|
||||
void setNew(const QString& filepath, bool isChecked);
|
||||
void setNew(const EsmFile* file, bool isChecked);
|
||||
void setNonUserContent(const QStringList& fileList);
|
||||
void setContentList(const QStringList& fileList);
|
||||
ContentFileList checkedItems() const;
|
||||
|
|
Loading…
Reference in a new issue