mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 15:35:23 +00:00
Changed filter mechanism for game / addons
Filters by number of master references, regardless of extension
This commit is contained in:
parent
21121d5ba5
commit
bfb71f23c9
@ -25,13 +25,13 @@ FileDialog::FileDialog(QWidget *parent) :
|
||||
mDataFilesModel = new DataFilesModel(this);
|
||||
|
||||
mMastersProxyModel = new QSortFilterProxyModel();
|
||||
mMastersProxyModel->setFilterRegExp(QString("^.*\\.esm"));
|
||||
mMastersProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
mMastersProxyModel->setFilterRegExp("game"); //QString("^.*\\.esm"));
|
||||
mMastersProxyModel->setFilterRole (Qt::UserRole);
|
||||
mMastersProxyModel->setSourceModel(mDataFilesModel);
|
||||
|
||||
mPluginsProxyModel = new PluginsProxyModel();
|
||||
mPluginsProxyModel->setFilterRegExp(QString("^.*\\.esp"));
|
||||
mPluginsProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
mPluginsProxyModel->setFilterRegExp("addon"); //QString("^.*\\.esp"));
|
||||
mPluginsProxyModel->setFilterRole (Qt::UserRole);
|
||||
mPluginsProxyModel->setSourceModel(mDataFilesModel);
|
||||
|
||||
mFilterProxyModel = new QSortFilterProxyModel();
|
||||
|
@ -144,6 +144,15 @@ QVariant DataFilesModel::data(const QModelIndex &index, int role) const
|
||||
return tooltip;
|
||||
|
||||
}
|
||||
|
||||
case Qt::UserRole:
|
||||
{
|
||||
if (file->masters().size() == 0)
|
||||
return "game";
|
||||
else
|
||||
return "addon";
|
||||
}
|
||||
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user