Permalink
Browse files

FIx video scanning following [a05b4d4]. Calling QDir::setFilter() wit…

…h a negative filter overwrites the default positive filters of QDir::Files | QDir::Dirs.
  • Loading branch information...
stuartm authored and jyavenard committed Feb 16, 2013
1 parent b2d69b4 commit 507c92442f43c52312a352eecf3c65e1da56e7c9
@@ -249,7 +249,7 @@ bool MythMediaDevice::ScanMediaType(const QString &directory, ext_cnt_t &cnt)
if (!d.exists())
return false;
d.setFilter(QDir::NoDotAndDotDot);
d.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = d.entryInfoList();
for( QFileInfoList::iterator it = list.begin();
@@ -300,9 +300,9 @@ QStringList StorageGroup::GetFileInfoList(QString Path)
if (!d.exists())
return files;
d.setFilter(QDir::NoDotAndDotDot);
d.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = d.entryInfoList();
if (!list.size())
if (list.isEmpty())
return files;
for (QFileInfoList::iterator p = list.begin(); p != list.end(); ++p)
@@ -55,10 +55,10 @@ namespace
if (!d.exists())
return false;
d.setFilter(QDir::NoDotAndDotDot);
d.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = d.entryInfoList();
// An empty directory is fine
if (!list.size())
if (list.isEmpty())
return true;
QDir dir_tester;
@@ -149,7 +149,7 @@ namespace
return false;
}
if ((!list.size()) || (list.at(0) == "EMPTY LIST"))
if (list.isEmpty() || (list.at(0) == "EMPTY LIST"))
return true;
for (QStringList::iterator p = list.begin(); p != list.end(); ++p)
@@ -415,7 +415,7 @@ bool VideoMetadataImp::removeDir(const QString &dirName)
{
QDir d(dirName);
d.setFilter(QDir::NoDotAndDotDot);
d.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList contents = d.entryInfoList();
if (!contents.size())
{
@@ -746,7 +746,7 @@ void MythUIHelper::ClearOldImageCache(void)
dir.setPath(cachedirname);
dir.setFilter(QDir::NoDotAndDotDot);
dir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = dir.entryInfoList();
QFileInfoList::const_iterator it = list.begin();
@@ -803,7 +803,7 @@ void MythUIHelper::RemoveCacheDir(const QString &dirname)
if (!dir.exists())
return;
dir.setFilter(QDir::NoDotAndDotDot);
dir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = dir.entryInfoList();
QFileInfoList::const_iterator it = list.begin();
const QFileInfo *fi;
@@ -3365,7 +3365,7 @@ void MainServer::HandleSGGetFileList(QStringList &sList,
if (slaveUnreachable)
strList << "SLAVE UNREACHABLE: " << host;
if (strList.count() == 0 || (strList.at(0) == "0"))
if (strList.isEmpty() || (strList.at(0) == "0"))
strList << "EMPTY LIST";
SendResponse(pbssock, strList);
@@ -853,7 +853,7 @@ void ThemeChooser::removeThemeDir(const QString &dirname)
if (!dir.exists())
return;
dir.setFilter(QDir::NoDotAndDotDot);
dir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = dir.entryInfoList();
QFileInfoList::const_iterator it = list.begin();
const QFileInfo *fi;

0 comments on commit 507c924

Please sign in to comment.