Permalink
Browse files

Fix some more breakage caused by [a05b4d4]. Calling QDir::setFilter()…

… with a negative filter overwrites the default positive filters of QDir::Files | QDir::Dirs.
  • Loading branch information...
stuartm committed Mar 4, 2013
1 parent cc7d774 commit 6e088edd05a06becf724ba385feb11dfdf1d6882
@@ -584,7 +584,7 @@ bool GalleryUtil::CopyDirectory(const QFileInfo src, QFileInfo &dst)
bool ok = true;
QDir dstDir(dst.absoluteFilePath());
srcDir.setFilter(QDir::NoDotAndDotDot);
srcDir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = srcDir.entryInfoList();
QFileInfoList::const_iterator it = list.begin();
for (; it != list.end(); ++it)
@@ -613,7 +613,7 @@ bool GalleryUtil::MoveDirectory(const QFileInfo src, QFileInfo &dst)
bool ok = true;
QDir dstDir(dst.absoluteFilePath());
srcDir.setFilter(QDir::NoDotAndDotDot);
srcDir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = srcDir.entryInfoList();
QFileInfoList::const_iterator it = list.begin();
for (; it != list.end(); ++it)
@@ -632,7 +632,7 @@ bool GalleryUtil::DeleteDirectory(const QFileInfo &dir)
return false;
QDir srcDir(dir.absoluteFilePath());
srcDir.setFilter(QDir::NoDotAndDotDot);
srcDir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = srcDir.entryInfoList();
QFileInfoList::const_iterator it = list.begin();
for (; it != list.end(); ++it)
@@ -561,7 +561,7 @@ int GameHandler::buildFileCount(QString directory, GameHandler *handler)
if (!RomDir.isReadable())
return 0;
RomDir.setFilter(QDir::NoDotAndDotDot);
RomDir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList List = RomDir.entryInfoList();
for (QFileInfoList::const_iterator it = List.begin();
it != List.end(); ++it)
@@ -628,7 +628,7 @@ void GameHandler::buildFileList(QString directory, GameHandler *handler,
return;
RomDir.setSorting( QDir:: DirsFirst | QDir::Name );
RomDir.setFilter(QDir::NoDotAndDotDot);
RomDir.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList List = RomDir.entryInfoList();
for (QFileInfoList::const_iterator it = List.begin();
it != List.end(); ++it)
@@ -87,7 +87,7 @@ void FileScanner::BuildFileList(QString &directory, MusicLoadedMap &music_files,
if (!d.exists())
return;
d.setFilter(QDir::NoDotAndDotDot);
d.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = d.entryInfoList();
if (list.isEmpty())
return;
@@ -554,7 +554,7 @@ void ImportMusicDialog::scanDirectory(QString &directory, vector<TrackInfo*> *tr
if (!d.exists())
return;
d.setFilter(QDir::NoDotAndDotDot);
d.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
const QFileInfoList list = d.entryInfoList();
if (list.isEmpty())
return;
@@ -1028,6 +1028,7 @@ void ImportCoverArtDialog::scanDirectory()
"*.png;*.jpg;*.jpeg;*.gif;*.bmp");
QFileInfoList list = d.entryInfoList(nameFilter.split(";"),
QDir::Files | QDir::Dirs |
QDir::NoDotAndDotDot);
if (list.isEmpty())
return;

0 comments on commit 6e088ed

Please sign in to comment.