From 7e25eedb8ee9ca9cdfd61a2aa31078b0f99f581c Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Thu, 4 Nov 2010 20:43:43 +0000 Subject: [PATCH] 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 --- src/RideFile.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/RideFile.cpp b/src/RideFile.cpp index 2f4aa491c..9d382ab9f 100644 --- a/src/RideFile.cpp +++ b/src/RideFile.cpp @@ -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 settings = GetApplicationSettings(); QVariant isAscending = settings->value(GC_ALLRIDES_ASCENDING,Qt::Checked); + QFlags 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,