Workaround for hidden files on Win32

Ride files may be created as hidden files in some
instances on Windows 32. This patch ensures that
they are subsequently included in the ride list
(i.e. ride files can be hidden files).

Fixes #176
This commit is contained in:
Mark Liversedge
2010-11-04 20:43:43 +00:00
parent d483445291
commit 7e25eedb8e

View File

@@ -273,10 +273,14 @@ QStringList RideFileFactory::listRideFiles(const QDir &dir) const
// This will read the user preferences and change the file list order as necessary:
boost::shared_ptr<QSettings> settings = GetApplicationSettings();
QVariant isAscending = settings->value(GC_ALLRIDES_ASCENDING,Qt::Checked);
QFlags<QDir::Filter> spec = QDir::Files;
#ifdef Q_OS_WIN32
spec |= QDir::Hidden;
#endif
if(isAscending.toInt()>0){
return dir.entryList(filters, QDir::Files, QDir::Name);
return dir.entryList(filters, spec, QDir::Name);
}
return dir.entryList(filters, QDir::Files, QDir::Name|QDir::Reversed);
return dir.entryList(filters, spec, QDir::Name|QDir::Reversed);
}
void RideFile::appendPoint(double secs, double cad, double hr, double km,