mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 12:58:00 +03:00
Exclude directories from containsDataFiles
Also include capo's microoptimisation even though it doesn't make things any faster.
This commit is contained in:
parent
973282e471
commit
e779f115ef
1 changed files with 3 additions and 4 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <QDataStream>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QFont>
|
||||
#include <QIODevice>
|
||||
|
||||
|
@ -548,15 +549,13 @@ void ContentSelectorModel::ContentModel::addFiles(const QString& path, bool newf
|
|||
|
||||
bool ContentSelectorModel::ContentModel::containsDataFiles(const QString& path)
|
||||
{
|
||||
QDir dir(path);
|
||||
QStringList filters;
|
||||
filters << "*.esp"
|
||||
<< "*.esm"
|
||||
<< "*.omwgame"
|
||||
<< "*.omwaddon";
|
||||
dir.setNameFilters(filters);
|
||||
|
||||
return dir.entryList().count() != 0;
|
||||
QDirIterator it(path, filters, QDir::Files | QDir::NoDotAndDotDot);
|
||||
return it.hasNext();
|
||||
}
|
||||
|
||||
void ContentSelectorModel::ContentModel::clearFiles()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue