ark x-cd-image support
Rolf Eike Beer
kde at opensource.sf-tec.de
Thu Apr 1 08:12:19 CEST 2010
Am Mittwoch, 31. März 2010 schrieb Duns Ens:
> hi,
>
> 7z supports iso (iso9660 and udf as far as i've seen now) unpacking and i
> have expanded the cli plugin to support this (sadly the output is a bit
> different).
>
> hope you can commit it,
> duns
Just some minor bits from me, but it's the maintainers decision.
Index: cliplugin.cpp
===================================================================
--- cliplugin.cpp (Revision 1106407)
+++ cliplugin.cpp (Arbeitskopie)
@@ -34,6 +34,7 @@
CliPlugin::CliPlugin(QObject *parent, const QVariantList & args)
: CliInterface(parent, args)
, m_state(0)
+ , m_isIso(false)
{
}
@@ -79,6 +80,8 @@
case 0: // header
if (line.startsWith(QLatin1String("Listing archive:"))) {
kDebug() << "Archive name: " << line.right(line.size() -
16).trimmed();
+ } else if (line.startsWith(QLatin1String("Type = Iso"))) {
+ m_isIso = true;
What might come in this line after the Iso? Or can that be (line == ...)?
} else if (line.startsWith(QLatin1String("----------"))) {
m_state = 1;
} else if (line.contains("Error:")) {
@@ -97,13 +100,21 @@
break;
case 2: // file details
- if (line.startsWith(QLatin1String("Size = "))) {
+ if (line.startsWith(QLatin1String("Folder = "))) {
+ m_currentArchiveEntry[ IsDirectory ] = line.at(9)=='+';
What happens with (line == "Folder = ")? And I would suggest writing
"= (line.at(9) == '+');"
This makes at least my brain parser faster.
+ } else if (line.startsWith(QLatin1String("Size = "))) {
m_currentArchiveEntry[ Size ] = line.mid(7).trimmed();
} else if (line.startsWith(QLatin1String("Packed Size = "))) {
m_currentArchiveEntry[ CompressedSize ] = line.mid(14).trimmed();
} else if (line.startsWith(QLatin1String("Modified = "))) {
QDateTime ts = QDateTime::fromString(line.mid(11).trimmed(),
"yyyy-MM-dd hh:mm:ss");
m_currentArchiveEntry[ Timestamp ] = ts;
+ if (m_isIso) {
+ if (m_currentArchiveEntry.contains(FileName)) {
+ entry(m_currentArchiveEntry);
+ }
+ m_state = 1;
+ }
Without looking at the other code: do you really want to set m_state to 1 here
even if the filename is not in this archive entry?
} else if (line.startsWith(QLatin1String("Attributes = "))) {
QString attributes = line.mid(13).trimmed();
Greetings,
Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-utils-devel/attachments/20100401/96fba4be/attachment.sig
More information about the Kde-utils-devel
mailing list