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
@@ -134,12 +134,25 @@ void ConfigDialog::changePage(QListWidgetItem *current, QListWidgetItem *previou
|
||||
// ! new mode: change the CP associated with the present mode
|
||||
void ConfigDialog::save_Clicked()
|
||||
{
|
||||
QSettings settings(GC_SETTINGS_CO, GC_SETTINGS_APP);
|
||||
settings.setValue(GC_UNIT, configPage->unitCombo->currentText());
|
||||
settings.setValue(GC_ALLRIDES_ASCENDING, configPage->allRidesAscending->checkState());
|
||||
settings.setValue(GC_CRANKLENGTH, configPage->crankLengthCombo->currentText());
|
||||
settings.setValue(GC_BIKESCOREDAYS, configPage->BSdaysEdit->text());
|
||||
settings.setValue(GC_BIKESCOREMODE, configPage->bsModeCombo->currentText());
|
||||
QDir home = QDir();
|
||||
QSettings *settings;
|
||||
|
||||
if(!home.exists("Library/GoldenCheetah"))
|
||||
{
|
||||
settings = new QSettings(GC_SETTINGS_CO, GC_SETTINGS_APP);
|
||||
home = QDir::home();
|
||||
}
|
||||
else
|
||||
{
|
||||
settings = new QSettings(home.absolutePath()+"/gc", QSettings::IniFormat);
|
||||
|
||||
}
|
||||
|
||||
settings->setValue(GC_UNIT, configPage->unitCombo->currentText());
|
||||
settings->setValue(GC_ALLRIDES_ASCENDING, configPage->allRidesAscending->checkState());
|
||||
settings->setValue(GC_CRANKLENGTH, configPage->crankLengthCombo->currentText());
|
||||
settings->setValue(GC_BIKESCOREDAYS, configPage->BSdaysEdit->text());
|
||||
settings->setValue(GC_BIKESCOREMODE, configPage->bsModeCombo->currentText());
|
||||
|
||||
// if the CP text entry reads invalid, there's nothing we can do
|
||||
int cp = cyclistPage->getCP();
|
||||
|
||||
Reference in New Issue
Block a user