Commit cf125bd1 authored by Lukas Appelhans's avatar Lukas Appelhans
Browse files

Small speed improvement plus change Md5Error to ChecksumError as suggested by Inkane

parent fac7b4a6
......@@ -49,7 +49,7 @@ class Error
ArchiveError = 10,
SignatureError = 11,
BackendInitializationError = 12,
Md5Error = 13,
ChecksumError = 13,
OpenFileError = 14,
FullDiskError = 15,
//
......
......@@ -107,8 +107,7 @@ ArchiveHandler::ArchiveHandler(const QString &path)
*/
archive_entry *e;
while (archive_read_next_header(archive, &e) == ARCHIVE_OK) {
ArchiveEntry const entry( e );
entries[entry.getFileName()] = new ArchiveEntry( entry );
entries[QString::fromAscii(archive_entry_pathname(e))] = new ArchiveEntry( e );
archive_read_data_skip(archive);
}
......@@ -427,7 +426,7 @@ QByteArray ArchiveHandler::md5(const QString& file)
if (hashes.isEmpty()) {
QString errorString = QObject::tr("MD5: requested file %1 isn't present in archive %2").arg(file, archiveName);
errs << Akabei::Error(Akabei::Error::Md5Error, errorString);
errs << Akabei::Error(Akabei::Error::ChecksumError, errorString);
return QByteArray();
}
......@@ -449,7 +448,7 @@ QList< QByteArray > ArchiveHandler::md5(const QStringList& files)
description += QObject::tr("MD5: requested file %1 isn't present in archive %2\n").arg(target, archiveName);
}
errs << Akabei::Error(Akabei::Error::Md5Error, description);
errs << Akabei::Error(Akabei::Error::ChecksumError, description);
}
return hasher.result();
......
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