mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
This code should now allow GC to be run off a USB stick.. or the Qollector. If GC finds a Library/GoldenCheetah next to the executable, it will use that location to store all of its settings and Libraries. Otherwise, it reverts to how GC handled settings previously.
This commit is contained in:
committed by
Justin Knotzke
parent
41063d069d
commit
622516b63d
@@ -189,8 +189,15 @@ QStringList RideFileFactory::listRideFiles(const QDir &dir) const
|
||||
filters << ("*." + i.key());
|
||||
}
|
||||
// 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);
|
||||
//First check to see if the Library folder exists where the executable is (for USB sticks)
|
||||
QDir home = QDir();
|
||||
QSettings *settings;
|
||||
if(!home.exists("Library/GoldenCheetah"))
|
||||
settings = new QSettings(GC_SETTINGS_CO, GC_SETTINGS_APP);
|
||||
else
|
||||
settings = new QSettings(home.absolutePath()+"/gc", QSettings::IniFormat);
|
||||
|
||||
QVariant isAscending = settings->value(GC_ALLRIDES_ASCENDING,Qt::Checked);
|
||||
if(isAscending.toInt()>0){
|
||||
return dir.entryList(filters, QDir::Files, QDir::Name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user