| 16 | #include <QStringList> |
| 17 | |
| 18 | bool FilesystemHelpers::createNewFileAndWrite(const QString& filePath, |
| 19 | const QByteArray& fileContents) |
| 20 | { |
| 21 | QFile file(filePath); |
| 22 | |
| 23 | if (!file.open(QIODevice::NewOnly)) { |
| 24 | qCritical() << Q_FUNC_INFO << file.error() << file.errorString(); |
| 25 | return false; |
| 26 | } |
| 27 | |
| 28 | if (!fileContents.isEmpty() && file.write(fileContents) == -1) { |
| 29 | qCritical() << Q_FUNC_INFO << file.error() << file.errorString(); |
| 30 | return false; |
| 31 | } |
| 32 | return true; |
| 33 | } |
| 34 | |
| 35 | QString FilesystemHelpers::makeAbsoluteCreateAndWrite(const QString& dirPath, QString& filePath, |
| 36 | const QByteArray& fileContents) |
nothing calls this directly
no test coverage detected