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:
Joern
2014-11-02 19:55:01 +01:00
parent 0bf8a8ab89
commit 230f028037
42 changed files with 1016 additions and 325 deletions

View File

@@ -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);