diff --git a/plugins/cli7zplugin/cliplugin.cpp b/plugins/cli7zplugin/cliplugin.cpp --- a/plugins/cli7zplugin/cliplugin.cpp +++ b/plugins/cli7zplugin/cliplugin.cpp @@ -226,22 +226,30 @@ } else if (line.startsWith(QStringLiteral("Modified = "))) { m_currentArchiveEntry->setProperty("timestamp", QDateTime::fromString(line.mid(11).trimmed(), QStringLiteral("yyyy-MM-dd hh:mm:ss"))); - } else if (line.startsWith(QStringLiteral("Attributes = "))) { - const QString attributes = line.mid(13).trimmed(); - - const bool isDirectory = attributes.startsWith(QLatin1Char('D')); + } else if (line.startsWith(QStringLiteral("Folder = "))) { + const QString isDirectoryStr = line.mid(9).trimmed(); + Q_ASSERT(isDirectoryStr == QStringLiteral("+") || isDirectoryStr == QStringLiteral("-")); + const bool isDirectory = isDirectoryStr.startsWith(QLatin1Char('+')); m_currentArchiveEntry->setProperty("isDirectory", isDirectory); if (isDirectory) { const QString directoryName = m_currentArchiveEntry->fullPath(); if (!directoryName.endsWith(QLatin1Char('/'))) { - const bool isPasswordProtected = (line.at(12) == QLatin1Char('+')); m_currentArchiveEntry->setProperty("fullPath", QString(directoryName + QLatin1Char('/'))); - m_currentArchiveEntry->setProperty("isPasswordProtected", isPasswordProtected); } } + } else if (line.startsWith(QStringLiteral("Attributes = "))) { + const QString attributes = line.mid(13).trimmed(); + + if (attributes.contains(QLatin1Char('_'))) { + // Unix attributes + m_currentArchiveEntry->setProperty("permissions", + attributes.mid(attributes.indexOf(QLatin1Char(' ')) + 1)); + } else { + // FAT attributes + m_currentArchiveEntry->setProperty("permissions", attributes); + } - m_currentArchiveEntry->setProperty("permissions", attributes.mid(1)); } else if (line.startsWith(QStringLiteral("CRC = "))) { m_currentArchiveEntry->setProperty("CRC", line.mid(6).trimmed()); } else if (line.startsWith(QStringLiteral("Method = "))) {