ark x-cd-image support
Duns Ens
dunsens at web.de
Thu Apr 1 14:00:14 CEST 2010
hi,
updated patch attached. I hope that the 7z guys don't change their output too
often... What is most likely still missing is an addition of *.iso in the
filter list of the open dialog. The *.iso files are shown though.
Am Donnerstag, 1. April 2010 schrieb Rolf Eike Beer:
> 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 == ...)?
Fixed.
>
> } 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.
Fixed. The output of 7z for Iso files is slightly different (and shorter) from
archive output, where Folder only indicates if the file is a folder or not. You
have no "Attributes = " line here.
>
> + } 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?
I have just copied that from its original position at the end of usual archive
parsing. I guess it is meant to still resume parsing even if an error occured?
It is the final line of every entry finally ;-) I have added comments indicating
what parts are for iso parsing.
>
> } else if (line.startsWith(QLatin1String("Attributes = "))) {
> QString attributes = line.mid(13).trimmed();
>
> Greetings,
>
> Eike
>
Cheers,
duns
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x-cd-image-support.diff
Type: text/x-patch
Size: 2628 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-utils-devel/attachments/20100401/d8e2eb90/attachment.diff
More information about the Kde-utils-devel
mailing list