From e233c18c14f96071e9103acd381834403457c90524804bf9fd2bc2f038fcedd3 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Tue, 12 Feb 2019 19:03:24 +0000 Subject: [PATCH] KDE Frameworks 5.55.0 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kio?expand=0&rev=246 --- ...rt-Refactor-SlaveInterface-calcSpeed.patch | 144 ------------------ kio-5.54.0.tar.xz | 3 - kio-5.55.0.tar.xz | 3 + kio.changes | 27 ++++ kio.spec | 6 +- 5 files changed, 32 insertions(+), 151 deletions(-) delete mode 100644 0002-Revert-Refactor-SlaveInterface-calcSpeed.patch delete mode 100644 kio-5.54.0.tar.xz create mode 100644 kio-5.55.0.tar.xz diff --git a/0002-Revert-Refactor-SlaveInterface-calcSpeed.patch b/0002-Revert-Refactor-SlaveInterface-calcSpeed.patch deleted file mode 100644 index ecd7fab..0000000 --- a/0002-Revert-Refactor-SlaveInterface-calcSpeed.patch +++ /dev/null @@ -1,144 +0,0 @@ -From b8a5f34b34b6c4e37684fe2782b8cf39c38cd928 Mon Sep 17 00:00:00 2001 -From: Fabian Vogt -Date: Mon, 14 Jan 2019 13:32:52 +0100 -Subject: [PATCH 2/2] Revert "Refactor SlaveInterface::calcSpeed" - -This reverts commit 4e2a815b9a107663a3d75e9d9d1be336adea888e. -This commit causes crashes due to improper division and there are some -outstanding code review issues as well. - -BUG: 402665 ---- - src/core/slaveinterface.cpp | 48 ++++++++++++++++++++++++------------- - src/core/slaveinterface_p.h | 19 +++++++-------- - 2 files changed, 39 insertions(+), 28 deletions(-) - -diff --git a/src/core/slaveinterface.cpp b/src/core/slaveinterface.cpp -index 6eb2b08d..88f649c8 100644 ---- a/src/core/slaveinterface.cpp -+++ b/src/core/slaveinterface.cpp -@@ -45,7 +45,6 @@ SlaveInterface::SlaveInterface(SlaveInterfacePrivate &dd, QObject *parent) - : QObject(parent), d_ptr(&dd) - { - connect(&d_ptr->speed_timer, &QTimer::timeout, this, &SlaveInterface::calcSpeed); -- d_ptr->transfer_details.reserve(max_count); - } - - SlaveInterface::~SlaveInterface() -@@ -98,24 +97,36 @@ void SlaveInterface::calcSpeed() - return; - } - -- // Note for future reference: A list is maintained for sizes and times. -- // Minimum list size is 1 and maximum list size is 8. Delta is calculated -- // using first and last item from the list. -- -- const qint64 elapsed_time = d->elapsed_timer.elapsed(); -- if (elapsed_time >= 900) { -- if (d->transfer_details.count() == max_count) { -- d->transfer_details.removeFirst(); -+ const qint64 currentTime = QDateTime::currentMSecsSinceEpoch(); -+ const qint64 diff = currentTime - d->start_time; -+ if (diff - d->last_time >= 900) { -+ d->last_time = diff; -+ if (d->nums == max_nums) { -+ // let's hope gcc can optimize that well enough -+ // otherwise I'd try memcpy :) -+ for (unsigned int i = 1; i < max_nums; ++i) { -+ d->times[i - 1] = d->times[i]; -+ d->sizes[i - 1] = d->sizes[i]; -+ } -+ d->nums--; - } -+ d->times[d->nums] = diff; -+ d->sizes[d->nums++] = d->filesize - d->offset; -+ -+ KIO::filesize_t lspeed = 1000 * (d->sizes[d->nums - 1] - d->sizes[0]) / (d->times[d->nums - 1] - d->times[0]); -+ -+//qDebug() << (long)d->filesize << diff -+// << long(d->sizes[d->nums-1] - d->sizes[0]) -+// << d->times[d->nums-1] - d->times[0] -+// << long(lspeed) << double(d->filesize) / diff -+// << convertSize(lspeed) -+// << convertSize(long(double(d->filesize) / diff) * 1000); - -- const SlaveInterfacePrivate::TransferInfo first = d->transfer_details.first(); -- const SlaveInterfacePrivate::TransferInfo last = {elapsed_time, (d->filesize - d->offset)}; -- KIO::filesize_t lspeed = 1000 * (last.size - first.size) / (last.time - first.time); - if (!lspeed) { -- d->transfer_details.clear(); -+ d->nums = 1; -+ d->times[0] = diff; -+ d->sizes[0] = d->filesize - d->offset; - } -- d->transfer_details.append(last); -- - emit speed(lspeed); - } - } -@@ -198,10 +209,13 @@ bool SlaveInterface::dispatch(int _cmd, const QByteArray &rawdata) - } - case INF_TOTAL_SIZE: { - KIO::filesize_t size = readFilesize_t(stream); -+ d->start_time = QDateTime::currentMSecsSinceEpoch(); -+ d->last_time = 0; - d->filesize = d->offset; -- d->transfer_details.append({0, 0}); -+ d->sizes[0] = d->filesize - d->offset; -+ d->times[0] = 0; -+ d->nums = 1; - d->speed_timer.start(1000); -- d->elapsed_timer.start(); - d->slave_calcs_speed = false; - emit totalSize(size); - break; -diff --git a/src/core/slaveinterface_p.h b/src/core/slaveinterface_p.h -index efb17d0f..a4cb5d3f 100644 ---- a/src/core/slaveinterface_p.h -+++ b/src/core/slaveinterface_p.h -@@ -29,19 +29,17 @@ - #include - #include - #include --#include --#include - - #include "kiocoredebug.h" - --static const unsigned int max_count = 8; -+static const unsigned int max_nums = 8; - - class KIO::SlaveInterfacePrivate - { - public: - SlaveInterfacePrivate() -- : connection(nullptr), filesize(0), offset(0), -- slave_calcs_speed(false) -+ : connection(nullptr), filesize(0), offset(0), last_time(0), start_time(0), -+ nums(0), slave_calcs_speed(false) - { - } - virtual ~SlaveInterfacePrivate() -@@ -55,14 +53,13 @@ public: - // We need some metadata here for our SSL code in messageBox() and for sslMetaData(). - MetaData sslMetaData; - -- struct TransferInfo { -- qint64 time; -- KIO::filesize_t size; -- }; -- QVector transfer_details; -- QElapsedTimer elapsed_timer; -+ KIO::filesize_t sizes[max_nums]; -+ qint64 times[max_nums]; - - KIO::filesize_t filesize, offset; -+ size_t last_time; -+ qint64 start_time; -+ uint nums; - bool slave_calcs_speed; - - void slotHostInfo(const QHostInfo &info); --- -2.20.1 - diff --git a/kio-5.54.0.tar.xz b/kio-5.54.0.tar.xz deleted file mode 100644 index 70d51ad..0000000 --- a/kio-5.54.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3cf05a021e6431c2d2b16525dd130a02269cb6fc2cf99ce3b4725d33c0bf5c7d -size 3150624 diff --git a/kio-5.55.0.tar.xz b/kio-5.55.0.tar.xz new file mode 100644 index 0000000..908356b --- /dev/null +++ b/kio-5.55.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ac7944c97d6278e183193f61d31dd34430589093b09ad73b4e997bbe1b16ccc +size 3153112 diff --git a/kio.changes b/kio.changes index c58a12c..232a7ba 100644 --- a/kio.changes +++ b/kio.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Sun Feb 10 22:03:11 UTC 2019 - lbeltrame@kde.org + +- Update to 5.55.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.55.0.php +- Changes since 5.54.0: + * Improve keyboard controls of the checksum widget + * Add helper function to disable redirections (useful for kde-open) + * Correct tag + * Revert "Refactor SlaveInterface::calcSpeed" (kde#402665) + * Revert "Fix elapsed time check" + * NetRC: Delete copy constructor and assignment operator + * KPasswdServerClient: Delete copy constructor and assignment operator + * KSSLSettings: Delete copy constructor and assignment operator + * delete copy constructor and assignment operator of some internal classes + * Fix elapsed time check + * Don't set CMake policy CMP0028 to old. We don't have targets with :: unless they are imported... + * [kio] Add ellipsis to search label in Cookies section + * [KNewFileMenu] Don't emit fileCreated when creating a directory + * Use (and suggest using) the nicer K_PLUGIN_CLASS_WITH_JSON + * avoid blocking kio_http_cache_cleaner and ensure exit with session (kde#367575) + * Fix failing knewfilemenu test and underlying reason for its failure +- Dropped patches, now upstream: + * 0002-Revert-Refactor-SlaveInterface-calcSpeed.patch + ------------------------------------------------------------------- Mon Jan 14 06:08:48 UTC 2019 - lbeltrame@kde.org diff --git a/kio.spec b/kio.spec index 88dce74..0595e85 100644 --- a/kio.spec +++ b/kio.spec @@ -16,14 +16,14 @@ # -%define _tar_path 5.54 +%define _tar_path 5.55 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} %bcond_without lang Name: kio -Version: 5.54.0 +Version: 5.55.0 Release: 0 Summary: Network transparent access to files and data License: LGPL-2.1-or-later @@ -33,8 +33,6 @@ Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-% 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: 0002-Revert-Refactor-SlaveInterface-calcSpeed.patch BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: fdupes