Hello community,

here is the log from the commit of package kio for openSUSE:Factory checked in 
at 2019-06-30 10:19:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kio (Old)
 and      /work/SRC/openSUSE:Factory/.kio.new.4615 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kio"

Sun Jun 30 10:19:43 2019 rev:81 rq:712345 version:5.59.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kio/kio.changes  2019-06-22 11:12:18.496595512 
+0200
+++ /work/SRC/openSUSE:Factory/.kio.new.4615/kio.changes        2019-06-30 
10:19:44.771456595 +0200
@@ -1,0 +2,7 @@
+Wed Jun 26 06:26:38 UTC 2019 - wba...@tmo.at
+
+- Add upstream patch to fix downloaded files (via http) getting an
+  "invalid" modification time (boo#1104595, kde#374420)
+  * copyjob-Only-set-modification-time-if-the-kio-slave-provided-it.patch
+
+-------------------------------------------------------------------

New:
----
  copyjob-Only-set-modification-time-if-the-kio-slave-provided-it.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kio.spec ++++++
--- /var/tmp/diff_new_pack.YCJ2EO/_old  2019-06-30 10:19:45.363457514 +0200
+++ /var/tmp/diff_new_pack.YCJ2EO/_new  2019-06-30 10:19:45.367457521 +0200
@@ -33,6 +33,8 @@
 Source1:        baselibs.conf
 # PATCH-FIX-OPENSUSE kio_help-fallback-to-kde4-docs.patch -- allow kio_help to 
see into kde4 documentation, needed especially for khelpcenter5
 Patch0:         kio_help-fallback-to-kde4-docs.patch
+# PATCH-FIX-UPSTREAM
+Patch1:         
copyjob-Only-set-modification-time-if-the-kio-slave-provided-it.patch
 BuildRequires:  cmake >= 3.0
 BuildRequires:  extra-cmake-modules >= %{_kf5_bugfix_version}
 BuildRequires:  fdupes

++++++ copyjob-Only-set-modification-time-if-the-kio-slave-provided-it.patch 
++++++
>From 5e791ef216c230efc15b853c08b21d41eca65e0c Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wba...@tmo.at>
Date: Fri, 21 Jun 2019 15:30:48 +0200
Subject: [copyjob] Only set modification time if the kio-slave provided it

If the slave didn't pass a modification time (e.g. the http slave
doesn't), it was set to -1, resulting in setting a wrong modification
time for the destination file in copyNextFile() later on because that
case wasn't checked.

So only set info.mtime when the slave actually provided a value.

There's no need for further checks later in copyNextFile() (where
FileCopyJob::setModificationTime() is called) because FileCopyJob checks
for validity anyway.

BUG: 374420
FIXED-IN: 5.60.0
Differential Revision: https://phabricator.kde.org/D21955
---
 src/core/copyjob.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/core/copyjob.cpp b/src/core/copyjob.cpp
index 7288a26..0a14edc 100644
--- a/src/core/copyjob.cpp
+++ b/src/core/copyjob.cpp
@@ -664,7 +664,10 @@ void CopyJobPrivate::addCopyInfoFromUDSEntry(const 
UDSEntry &entry, const QUrl &
 {
     struct CopyInfo info;
     info.permissions = entry.numberValue(KIO::UDSEntry::UDS_ACCESS, -1);
-    info.mtime = QDateTime::fromMSecsSinceEpoch(1000 * 
entry.numberValue(KIO::UDSEntry::UDS_MODIFICATION_TIME, -1), Qt::UTC);
+    const auto timeVal = 
entry.numberValue(KIO::UDSEntry::UDS_MODIFICATION_TIME, -1);
+    if (timeVal != -1) {
+        info.mtime = QDateTime::fromMSecsSinceEpoch(1000 * timeVal, Qt::UTC);
+    }
     info.ctime = QDateTime::fromMSecsSinceEpoch(1000 * 
entry.numberValue(KIO::UDSEntry::UDS_CREATION_TIME, -1), Qt::UTC);
     info.size = 
static_cast<KIO::filesize_t>(entry.numberValue(KIO::UDSEntry::UDS_SIZE, -1));
 
-- 
cgit v1.1


Reply via email to