Accepting request 712340 from home:wolfi323:test

- 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

OBS-URL: https://build.opensuse.org/request/show/712340
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kio?expand=0&rev=260
This commit is contained in:
Fabian Vogt 2019-06-28 06:54:47 +00:00 committed by Git OBS Bridge
parent 61d3c1d1d5
commit c461e47905
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,42 @@
From 5e791ef216c230efc15b853c08b21d41eca65e0c Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@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

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jun 26 06:26:38 UTC 2019 - wbauer@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
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Jun 09 07:35:12 UTC 2019 - lbeltrame@kde.org Sun Jun 09 07:35:12 UTC 2019 - lbeltrame@kde.org

View File

@ -33,6 +33,8 @@ Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%
Source1: baselibs.conf 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 # 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 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: cmake >= 3.0
BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version}
BuildRequires: fdupes BuildRequires: fdupes