Commit a89e1799 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Fix subfolder name of archives with single files

Archives which are not single folder should not suggest a subfolder name.
Otherwise archives which contain only a single file would report that file's
name as the subfolder name.

The archivetest is now updated to assert this.
parent bb76f994
......@@ -255,6 +255,10 @@ void ListJob::onNewEntry(const ArchiveEntry& entry)
QString ListJob::subfolderName() const
{
if (!isSingleFolderArchive()) {
return QString();
}
return m_subfolderName;
}
......
......@@ -70,16 +70,14 @@ void ArchiveTest::testProperties_data()
<< archivePath
<< QFileInfo(archivePath).fileName()
<< false << false << true
// FIXME: possibly a bug? I was expecting to get "archivetest_encrypted" as subfolder name...
<< QStringLiteral("foo.txt");
<< QStringLiteral("archivetest_encrypted");
archivePath = QFINDTESTDATA("data/archivetest_unencrypted.zip");
QTest::newRow("simple zip, one unencrypted entry")
<< archivePath
<< QFileInfo(archivePath).fileName()
<< false << false << false
// FIXME: possibly a bug? I was expecting to get "archivetest_encrypted" as subfolder name...
<< QStringLiteral("foo.txt");
<< QStringLiteral("archivetest_unencrypted");
}
void ArchiveTest::testProperties()
......
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