https://bugs.kde.org/show_bug.cgi?id=372023

--- Comment #9 from Theo <alpha0...@yahoo.de> ---
(In reply to Theo from comment #8)
> This does not fix the issue of missing files in the directory listing,
> compare for instance the contents of '/ISO9660' and '/El Torito BootJoliet
> level 3' when browsing sgd_cdrom_1.30.iso as archive.

This is caused by the same problem: KCompressionDevice and its QFile, both
derived from QIODevice, have member variables 'pos' and 'devicePos' that get
out of sync. The following workaround fixes both the incomplete file listing
and the wrong file data on the first try (makes my previously posted fix
unnecessary): Insert

    dev->seek(0);

before

    if (dev->seek((qint64)start << (qint64)11)) {
        if ((dev->read(buf, len << 11u)) != -1) return (len);
    }

in the callback function 'readf' in kiso.cpp. This seek is done in
KCompressionDevice::seek(qint64 pos) only in some cases, see
kcompressiondevice.cpp[1]:

    if (d->deviceReadPos < pos) { // we can start from here
[...]
    } else {
        // we have to start from 0 ! Ugly and slow, but better than the
previous
        // solution (KTarGz was allocating everything into memory)
        if (!seek(0)) { // recursive
            return false;
        }
[...]
    }

Apparently, this is considered ugly, but I start to believe that
KCompressionDevice is broken, and unless someone explains to me why I'm wrong
and how KCompressionDevice is supposed to work I see no other way to fix this
(again, I'm not a developer and might have no clue what I'm talking about).

Ceterum censeo KCompressionDevice should not be used on uncompressed ISO files
anyway: https://bugs.kde.org/show_bug.cgi?id=395296

[1]
https://api.kde.org/frameworks/karchive/html/kcompressiondevice_8cpp_source.html#l00178

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to