| 184 | } |
| 185 | |
| 186 | bool putLevelDatDataToFS(const QFileInfo &file, QByteArray & data) |
| 187 | { |
| 188 | auto fullFilePath = getLevelDatFromFS(file); |
| 189 | if(fullFilePath.isNull()) |
| 190 | { |
| 191 | return false; |
| 192 | } |
| 193 | QSaveFile f(fullFilePath); |
| 194 | if(!f.open(QIODevice::WriteOnly)) |
| 195 | { |
| 196 | return false; |
| 197 | } |
| 198 | QByteArray compressed; |
| 199 | if(!GZip::zip(data, compressed)) |
| 200 | { |
| 201 | return false; |
| 202 | } |
| 203 | if(f.write(compressed) != compressed.size()) |
| 204 | { |
| 205 | f.cancelWriting(); |
| 206 | return false; |
| 207 | } |
| 208 | return f.commit(); |
| 209 | } |
| 210 | |
| 211 | int64_t calculateWorldSize(const QFileInfo &file) |
| 212 | { |
no test coverage detected