mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
Fixed broken workout directory check for the first start (#4410)
Fix1: appsettings->value default fallback "0" if no fallback value was given. So a new GoldenCheetah installation will always use path "0" until a workout directory was set in the settings. We now use an empty string as fallback to get the condition working again Fix2: Instead of using the athlete->home parent folder, the old code returned the parent's parent folder. Until a workout directory was set in the settings, the user had to navigate to the (hidden) athletes folder everytime by hand.
This commit is contained in:
@@ -178,8 +178,9 @@ MainWindow::MainWindow(const QDir &home)
|
||||
|
||||
// if no workout directory is configured, default to the
|
||||
// top level GoldenCheetah directory
|
||||
if (appsettings->value(NULL, GC_WORKOUTDIR).toString() == "")
|
||||
appsettings->setValue(GC_WORKOUTDIR, QFileInfo(context->athlete->home->root().canonicalPath() + "/../").canonicalPath());
|
||||
if (appsettings->value(NULL, GC_WORKOUTDIR, "").toString() == ""){
|
||||
appsettings->setValue(GC_WORKOUTDIR, QFileInfo(context->athlete->home->root().canonicalPath()).canonicalPath());
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* GUI setup
|
||||
|
||||
Reference in New Issue
Block a user