fix(color): Move mdls not in models.yml to /Models/Unused (#2397)

* Move models.yml that don't exist into /Models/Unused

* Add sdMove, Translations, move both models.yml

* Comments, break loop, rmv extra bool.

* Show Press_Any_Key on dialog

* Translations

* Always create /Models/UNUSED if models.yml exists.

* Close directories
This commit is contained in:
Cliff
2022-10-01 11:29:16 +10:00
committed by GitHub
parent c19f7eafd4
commit 5b6fac36c6
21 changed files with 327 additions and 40 deletions
+37
View File
@@ -416,6 +416,43 @@ const char * sdCopyFile(const char * srcFilename, const char * srcDir, const cha
return sdCopyFile(srcPath, destPath);
}
// Will overwrite if destination exists
const char * sdMoveFile(const char * srcPath, const char * destPath)
{
const char *result;
result = sdCopyFile(srcPath, destPath);
if(result != 0) {
return result;
}
FRESULT fres = f_unlink(srcPath);
if(fres != FR_OK) {
return SDCARD_ERROR(fres);
}
return nullptr;
}
// Will overwrite if destination exists
const char * sdMoveFile(const char * srcFilename, const char * srcDir, const char * destFilename, const char * destDir)
{
const char *result;
result = sdCopyFile(srcFilename, srcDir, destFilename, destDir);
if(result != 0) {
return result;
}
char srcPath[2*CLIPBOARD_PATH_LEN+1];
char * tmp = strAppend(srcPath, srcDir, CLIPBOARD_PATH_LEN);
*tmp++ = '/';
strAppend(tmp, srcFilename, CLIPBOARD_PATH_LEN);
FRESULT fres = f_unlink(srcPath);
if(fres != FR_OK) {
return SDCARD_ERROR(fres);
}
return nullptr;
}
#endif // defined(SDCARD)