Commit ef5c38a3 authored by Elvis Angelaccio's avatar Elvis Angelaccio

LoadJob: check result in onFinished()

It doesn't make sense to set these properties if loading the archive
failed. This also allows to fix the expected values of a testcase.
parent b1a251eb
......@@ -62,8 +62,8 @@ void LoadTest::testProperties_data()
QTest::newRow("non-existent tar archive")
<< QStringLiteral("/tmp/foo.tar.gz")
<< QStringLiteral("foo")
<< false << false << false << true << false << 0 << Archive::Unencrypted
<< QStringLiteral("foo");
<< false << false << false << false << false << 0 << Archive::Unencrypted
<< QString();
// Test non-archive file
QTest::newRow("not an archive")
......
......@@ -279,7 +279,7 @@ void LoadJob::doWork()
void LoadJob::onFinished(bool result)
{
if (archive()) {
if (archive() && result) {
archive()->setProperty("unpackedSize", extractedFilesSize());
archive()->setProperty("isSingleFolder", isSingleFolderArchive());
const auto name = subfolderName().isEmpty() ? archive()->completeBaseName() : subfolderName();
......
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