| 178 | } |
| 179 | |
| 180 | bool putLevelDatDataToFS(const QFileInfo& file, QByteArray& data) |
| 181 | { |
| 182 | auto fullFilePath = getLevelDatFromFS(file); |
| 183 | if (fullFilePath.isNull()) { |
| 184 | return false; |
| 185 | } |
| 186 | PSaveFile f(fullFilePath); |
| 187 | if (!f.open(QIODevice::WriteOnly)) { |
| 188 | return false; |
| 189 | } |
| 190 | QByteArray compressed; |
| 191 | if (!GZip::zip(data, compressed)) { |
| 192 | return false; |
| 193 | } |
| 194 | if (f.write(compressed) != compressed.size()) { |
| 195 | f.cancelWriting(); |
| 196 | return false; |
| 197 | } |
| 198 | return f.commit(); |
| 199 | } |
| 200 | |
| 201 | int64_t calculateWorldSize(const QFileInfo& file) |
| 202 | { |
no test coverage detected