Commit eda07ac6 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Don't generate MD5 hash for files bigger than 10MB

This hash is used only for logging, so there is no reason for spending
time on it.

We should probably consider total removing of this hash, since its
calculation for a 7MiB file takes about 10ms.

BUG:419238
parent f460064e
......@@ -1122,7 +1122,7 @@ void KisDocument::slotChildCompletedSavingInBackground(KisImportExportErrorCode
.arg(QString::fromLatin1(job.mimeType))
.arg(!status.isOk() ? exportErrorToUserMessage(status, errorMessage) : "OK")
.arg(fi.size())
.arg(QString::fromLatin1(KoMD5Generator().generateHash(job.filePath).toHex())));
.arg(fi.size() > 10000000 ? "FILE_BIGGER_10MB" : QString::fromLatin1(KoMD5Generator().generateHash(job.filePath).toHex())));
emit sigCompleteBackgroundSaving(job, status, errorMessage);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment