DevHeads.net

Review Request: Report file errors when extracting files using karchive

Review request for kdelibs.

Description
A simple patch to check if something goes wrong when extracting files from an archive. You can read the error code using copyToErrorCode()

Diffs
kdecore/io/karchive.h 7cd7c0c
kdecore/io/karchive.cpp 86d61d5

Diff: <a href="http://git.reviewboard.kde.org/r/103808/diff/diff" title="http://git.reviewboard.kde.org/r/103808/diff/diff">http://git.reviewboard.kde.org/r/103808/diff/diff</a>

Testing

Thanks,

Theofilos Intzoglou

Comments

Re: Review Request: Report file errors when extracting files usi

By =?utf-8?b?zpjOt... at 01/28/2012 - 12:46

(Updated Jan. 28, 2012, 4:46 p.m.)

Review request for kdelibs.

Changes
* Added doxygen documentation

Description
A simple patch to check if something goes wrong when extracting files from an archive. You can read the error code using copyToErrorCode()

Diffs (updated)
kdecore/io/karchive.h 7cd7c0c
kdecore/io/karchive.cpp 86d61d5

Diff: <a href="http://git.reviewboard.kde.org/r/103808/diff/diff" title="http://git.reviewboard.kde.org/r/103808/diff/diff">http://git.reviewboard.kde.org/r/103808/diff/diff</a>

Testing

Thanks,

Theofilos Intzoglou

Re: Review Request 103808: Report file errors when extracting fi

By =?utf-8?b?zpjOt... at 10/27/2013 - 15:03

(Updated Oct. 27, 2013, 7:03 p.m.)

Status
This change has been discarded.

Review request for kdelibs.

Repository: kdelibs

Description
A simple patch to check if something goes wrong when extracting files from an archive. You can read the error code using copyToErrorCode()

Diffs
kdecore/io/karchive.h 7cd7c0c
kdecore/io/karchive.cpp 86d61d5

Diff: <a href="http://git.reviewboard.kde.org/r/103808/diff/" title="http://git.reviewboard.kde.org/r/103808/diff/">http://git.reviewboard.kde.org/r/103808/diff/</a>

Testing

Thanks,

Theofilos Intzoglou

Re: Review Request 103808: Report file errors when extracting fi

By Mario Bensi at 10/28/2013 - 04:58

In fact, I prefer you return the QFile::FileError from copyTo
Another solution will be copyTo return a bool and we add two method errorCode()/errorString() but not only for KArchiveFile but for all KArchiveEntry and in this case we need to determine if we use a QFile::Error or a specific enum.

- Mario Bensi

On Oct. 27, 2013, 7:03 p.m., Theofilos Intzoglou wrote:

Re: Review Request: Report file errors when extracting files usi

By Mario Bensi at 02/13/2012 - 08:55

If you can, i prefer you use an enum Error (you need to create this) in class KArchiveFile and KArchiveDirectory and return this with a method "error" or "lastError" to check if all is ok or not. And why not change "void copyTo..." by "bool copyTo..." when the copyTo return false you can check why you have this error with "(last)Error".

- Mario Bensi

On Jan. 28, 2012, 4:46 p.m., Theofilos Intzoglou wrote:

Re: Review Request: Report file errors when extracting files usi

By Raphael Kubo da... at 01/28/2012 - 13:27

Not sure if this is 4.x material or frameworks-only (I occasionally see karchive undergoing some changes there). Only returning errors from that QFile::write call seems weird IMHO (other parts of the code may fail too).

kdecore/io/karchive.h
<http://git.reviewboard.kde.org/r/103808/#comment8364>

The documentation is still missing the "@since" tag.

kdecore/io/karchive.cpp
<http://git.reviewboard.kde.org/r/103808/#comment8367>

If you're just breaking out of the loop in the next iteration, why not do something like this:

while (remainingSize > 0) {
// yadda, yadda
if (f.write(...) == -1) {
d->fileError = f.error();
break;
}
}

- Raphael Kubo da Costa

On Jan. 28, 2012, 4:46 p.m., Theofilos Intzoglou wrote:

Re: Review Request: Report file errors when extracting files usi

By Albert Astals Cid at 01/28/2012 - 11:32

kdecore/io/karchive.h
<http://git.reviewboard.kde.org/r/103808/#comment8363>

Needs doxygen documentation

- Albert Astals Cid

On Jan. 28, 2012, 12:09 p.m., Theofilos Intzoglou wrote: