Commit 3969f619 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa
Browse files

Support different 7z archive delimiters.

For some weird reason, 7z has decided to change the archive
delimiter from "----" to "--" from version 9.04 to 9.13.

We now detect both correctly.

CCBUG: 247628

svn path=/trunk/KDE/kdeutils/ark/; revision=1164368
parent 17a5d446
......@@ -78,7 +78,8 @@ ParameterList CliPlugin::parameterList() const
bool CliPlugin::readListLine(const QString& line)
{
static const QLatin1String archiveInfoDelimiter("--");
static const QLatin1String archiveInfoDelimiter1("--"); // 7z 9.13+
static const QLatin1String archiveInfoDelimiter2("----"); // 7z 9.04
static const QLatin1String entryInfoDelimiter("----------");
switch (m_state) {
......@@ -86,7 +87,8 @@ bool CliPlugin::readListLine(const QString& line)
if (line.startsWith(QLatin1String("Listing archive:"))) {
kDebug() << "Archive name: "
<< line.right(line.size() - 16).trimmed();
} else if (line == archiveInfoDelimiter) {
} else if ((line == archiveInfoDelimiter1) ||
(line == archiveInfoDelimiter2)) {
m_state = ReadStateArchiveInformation;
} else if (line.contains("Error:")) {
kDebug() << line.mid(6);
......
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