mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-11 06:34:14 +02:00
3f23e3dd2b
The catalogue is written with QSaveFile, which cannot write into a folder that is not there. A fresh profile has no documents folder, and a path typed into the settings may name a folder which was never created, so the first write failed with "No such file or directory" and no way for the user to see that the folder was the problem rather than the file (non-blocking review comment by ispyisail). writeFile() makes the folder first, which covers every writer: creating the template, appending a type and editing one all go through it. Covered by tst_cabletypelist::aMissingFolderIsCreated, writing into <tmp>/not/there/yet/qet_cable_types.csv. Verified in both directions: without the fix the test fails with 'createFile(path, &error) returned FALSE. (No such file or directory)', with it the file is created and reads back.