Added a user preference to change the Ride List sorting. Default should be ascending by date, as it has been. Disabling the "Sort ride list ascending" preference will sort the ride list descending by date.

Also, added margins to the widgets in the main window.
This commit is contained in:
Robert Carlsen
2009-01-05 01:47:37 +00:00
parent f8a94dc767
commit 8d2edd4c48
6 changed files with 36 additions and 5 deletions

View File

@@ -19,6 +19,7 @@
#include "RideFile.h"
#include <QtXml/QtXml>
#include <assert.h>
#include "Settings.h"
static void
markInterval(QDomDocument &xroot, QDomNode &xride, QDomNode &xintervals,
@@ -140,6 +141,12 @@ QStringList RideFileFactory::listRideFiles(const QDir &dir) const
i.next();
filters << ("*." + i.key());
}
return dir.entryList(filters, QDir::Files, QDir::Name);
// This will read the user preferences and change the file list order as necessary:
QSettings settings(GC_SETTINGS_CO, GC_SETTINGS_APP);
QVariant isAscending = settings.value(GC_ALLRIDES_ASCENDING,Qt::Checked);
if(isAscending.toInt()>0){
return dir.entryList(filters, QDir::Files, QDir::Name);
}
return dir.entryList(filters, QDir::Files, QDir::Name|QDir::Reversed);
}