D8299: libzip: Preserve modtime when extracting

Elvis Angelaccio noreply at phabricator.kde.org
Sun Oct 15 16:26:52 UTC 2017


elvisangelaccio requested changes to this revision.
elvisangelaccio added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> libzipplugin.cpp:550
> +    // For top-level items, dont restore parent dir mtime.
> +    bool restoreParentMtime = (parentDir+QDir::separator() != destDirCorrected);
> +

nitpick, spaces around +

> libzipplugin.cpp:554
> +    if (restoreParentMtime) {
> +        struct stat result;
> +        if (stat(parentDir.toUtf8(), &result) != 0) {

Use `QT_STATBUF`

> libzipplugin.cpp:555
> +        struct stat result;
> +        if (stat(parentDir.toUtf8(), &result) != 0) {
> +            qCWarning(ARK) << "Failed to read mtime for parent dir of" << destination;

Use `QT_STAT`. Also, the filename should be passed to `QFile::encodeName()`.

I'm wondering if we can just use `QFileInfo::lastModified()` instead?

REPOSITORY
  R36 Ark

REVISION DETAIL
  https://phabricator.kde.org/D8299

To: rthomsen, elvisangelaccio
Cc: kde-utils-devel, #ark, tctara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20171015/b858d8ed/attachment.html>


More information about the Kde-utils-devel mailing list