| 4251 | } |
| 4252 | |
| 4253 | bool WizDatabase::saveCompressedAttachmentData(const CString& strGUID, const QByteArray& arrayData) |
| 4254 | { |
| 4255 | CString strTempZipFileName = Utils::WizPathResolve::tempPath() + WizIntToStr(WizGetTickCount()) + ".tmp"; |
| 4256 | if (!WizSaveDataToFile(strTempZipFileName, arrayData)) |
| 4257 | { |
| 4258 | Q_EMIT updateError("Failed to save attachment data to temp file: " + strTempZipFileName); |
| 4259 | return false; |
| 4260 | } |
| 4261 | WizUnzipFile zip; |
| 4262 | if (!zip.open(strTempZipFileName)) |
| 4263 | { |
| 4264 | Q_EMIT updateError("Failed to open temp zip file: " + strTempZipFileName); |
| 4265 | return false; |
| 4266 | } |
| 4267 | |
| 4268 | CString strFileName = getAttachmentFileName(strGUID); |
| 4269 | if (!zip.extractFile(0, strFileName)) |
| 4270 | { |
| 4271 | Q_EMIT updateError("Failed to extract attachment file: " + strFileName); |
| 4272 | return false; |
| 4273 | } |
| 4274 | |
| 4275 | zip.close(); |
| 4276 | // |
| 4277 | QFile::remove(strTempZipFileName); |
| 4278 | // |
| 4279 | return true; |
| 4280 | } |
| 4281 | |
| 4282 | bool WizDatabase::emptyProtectedAbstract(const QString &docGuid) |
| 4283 | { |
nothing calls this directly
no test coverage detected