mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 17:09:56 +00:00
AthleteDirectory - Folder Structure Part 2 of 2 + Always create .JSON
... create folder structure for existing and new athletes ... upgrade existing athlete to new structure when opening / incl. logging and error handling ... convert any "Downloaded" file to .JSON directly - store source file in /downloads ... convert any "Imported" file to .JSON directly - store source file in /imports
This commit is contained in:
@@ -553,10 +553,10 @@ AddFirmware::validatePage()
|
||||
if (copy->isChecked()) {
|
||||
|
||||
QString fileName = QFileInfo(filePath).fileName();
|
||||
QString targetFileName = QFileInfo(context->athlete->home->root().absolutePath() + "/../").absolutePath() + "/" + fileName;
|
||||
QString targetFileName = QFileInfo(context->athlete->home->root().canonicalPath() + "/../").canonicalPath() + "/" + fileName;
|
||||
|
||||
// check not the same thing!
|
||||
if(QFileInfo(fileName).absolutePath() != QFileInfo(targetFileName).absolutePath()) {
|
||||
if(QFileInfo(fileName).canonicalPath() != QFileInfo(targetFileName).canonicalPath()) {
|
||||
// if the current file exists, wipe it
|
||||
if (QFile(targetFileName).exists()) QFile(targetFileName).remove();
|
||||
QFile(filePath).copy(targetFileName);
|
||||
|
||||
Reference in New Issue
Block a user