|
VivoQuant 6.5.0
|
Copying the workflows shipped with VivoQuant into the user's workflows folder. More...
Functions | |
| DLLEXPORT Array< string > | files (string fromDir) |
| The files in fromDir and its subfolders, as sorted relative paths. | |
| DLLEXPORT Array< string > | originalFiles () |
| The files shipped before VivoQuant kept track of what it copied: the original tutorial. | |
| DLLEXPORT Array< string > | copy (string fromDir, string userDir, Array< string > files, bool overwrite) |
| DLLEXPORT Array< string > | addNew (string fromDir, string userDir, QSettings &settings) |
| DLLEXPORT void | markOffered (Array< string > files, QSettings &settings) |
| Records files (relative paths) as offered, e.g. the ones Restore Tutorial copied. | |
Copying the workflows shipped with VivoQuant into the user's workflows folder.
The workflows folder installed with VivoQuant is a seed. Each file in it is copied into the user's folder once: all of them when that folder doesn't exist yet, and later the ones a new version of VivoQuant adds. The files offered so far are kept in the setting Workflows/shippedFiles, so a file the user deleted isn't copied again. Used by WorkflowManager; kept apart from it so it can be tested without the UI.
| DLLEXPORT Array< string > addNew | ( | string | fromDir, |
| string | userDir, | ||
| QSettings & | settings ) |
Copies into userDir each file in fromDir that hasn't been offered before, and returns them (relative paths), recording them in settings. When userDir doesn't exist (first use, or the user deleted the folder to start again) every file is offered. A file the user already has with the same name is kept, and counts as offered. A file that couldn't be copied isn't returned or recorded, so it is tried again next time. A folder from before the setting existed counts as having been offered originalFiles().
| DLLEXPORT Array< string > copy | ( | string | fromDir, |
| string | userDir, | ||
| Array< string > | files, | ||
| bool | overwrite ) |
Copies files (paths relative to fromDir) into userDir. Existing files are kept unless overwrite is set. In .md files, "{{workflows}}" is replaced with the absolute path of userDir. Copies are made writable. Returns the files now in userDir: those copied, and those kept because the user already had them. A file that couldn't be copied is left out.