Accepting request 586838 from KDE:Frameworks5
KDE Frameworks 5.44 OBS-URL: https://build.opensuse.org/request/show/586838 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kio?expand=0&rev=61
This commit is contained in:
commit
2443bf3f47
@ -1,125 +0,0 @@
|
||||
From 8d73867b3d4339ec026f92c4c2e89c265249aeb2 Mon Sep 17 00:00:00 2001
|
||||
From: Jaime Torres <jtamate@gmail.com>
|
||||
Date: Wed, 7 Feb 2018 19:02:16 +0100
|
||||
Subject: Don't stat(/etc/localtime) between read() and write() copying files
|
||||
|
||||
Summary:
|
||||
CCBUG: 384561
|
||||
|
||||
Unfortunately, QDateTime::currentDateTime() checks /etc/localtime
|
||||
each time it is called.
|
||||
Chaning to QElapsedTime, no check of /etc/localtime.
|
||||
Reproducing bug 384561, the strace of file.so was something like:
|
||||
read(), stat(/etc/localtime), stat(/etc/localtime),
|
||||
stat(/etc/localtime), stat(/etc/localtime), stat(/etc/localtime),
|
||||
write(), read() ......
|
||||
Now it is: read(), write()
|
||||
It also reduces the cpu in io/wait around 10% in a debug build.
|
||||
|
||||
Test Plan:
|
||||
kio tests work as before
|
||||
desktop: works in dolphin
|
||||
|
||||
Reviewers: #frameworks, fvogt, dfaure
|
||||
|
||||
Reviewed By: dfaure
|
||||
|
||||
Subscribers: fvogt, ngraham
|
||||
|
||||
Tags: #frameworks
|
||||
|
||||
Differential Revision: https://phabricator.kde.org/D9983
|
||||
---
|
||||
src/core/slavebase.cpp | 27 ++++++++++++++-------------
|
||||
1 file changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/core/slavebase.cpp b/src/core/slavebase.cpp
|
||||
index 4f8a5da..5e8effb 100644
|
||||
--- a/src/core/slavebase.cpp
|
||||
+++ b/src/core/slavebase.cpp
|
||||
@@ -80,7 +80,7 @@ class SlaveBasePrivate
|
||||
{
|
||||
public:
|
||||
SlaveBase *q;
|
||||
- SlaveBasePrivate(SlaveBase *owner): q(owner), m_passwdServerClient(nullptr)
|
||||
+ SlaveBasePrivate(SlaveBase *owner): q(owner), nextTimeoutMsecs(0), m_passwdServerClient(nullptr)
|
||||
{
|
||||
if (!qEnvironmentVariableIsEmpty("KIOSLAVE_ENABLE_TESTMODE")) {
|
||||
QStandardPaths::enableTestMode(true);
|
||||
@@ -110,8 +110,9 @@ public:
|
||||
KConfigGroup *configGroup;
|
||||
QUrl onHoldUrl;
|
||||
|
||||
- QDateTime lastTimeout;
|
||||
- QDateTime nextTimeout;
|
||||
+ QElapsedTimer lastTimeout;
|
||||
+ QElapsedTimer nextTimeout;
|
||||
+ qint64 nextTimeoutMsecs;
|
||||
KIO::filesize_t totalSize;
|
||||
KRemoteEncoding *remotefile;
|
||||
enum { Idle, InsideMethod, FinishedCalled, ErrorCalled } m_state;
|
||||
@@ -273,9 +274,9 @@ SlaveBase::~SlaveBase()
|
||||
void SlaveBase::dispatchLoop()
|
||||
{
|
||||
while (!d->exit_loop) {
|
||||
- if (d->nextTimeout.isValid() && (d->nextTimeout < QDateTime::currentDateTime())) {
|
||||
+ if (d->nextTimeout.isValid() && (d->nextTimeout.hasExpired(d->nextTimeoutMsecs))) {
|
||||
QByteArray data = d->timeoutData;
|
||||
- d->nextTimeout = QDateTime();
|
||||
+ d->nextTimeout.invalidate();
|
||||
d->timeoutData = QByteArray();
|
||||
special(data);
|
||||
}
|
||||
@@ -284,7 +285,7 @@ void SlaveBase::dispatchLoop()
|
||||
|
||||
int ms = -1;
|
||||
if (d->nextTimeout.isValid()) {
|
||||
- ms = qMax<int>(QDateTime::currentDateTime().msecsTo(d->nextTimeout), 1);
|
||||
+ ms = qMax<int>(d->nextTimeout.elapsed() - d->nextTimeoutMsecs, 1);
|
||||
}
|
||||
|
||||
int ret = -1;
|
||||
@@ -529,13 +530,11 @@ void SlaveBase::processedSize(KIO::filesize_t _bytes)
|
||||
{
|
||||
bool emitSignal = false;
|
||||
|
||||
- QDateTime now = QDateTime::currentDateTime();
|
||||
-
|
||||
if (_bytes == d->totalSize) {
|
||||
emitSignal = true;
|
||||
} else {
|
||||
if (d->lastTimeout.isValid()) {
|
||||
- emitSignal = d->lastTimeout.msecsTo(now) >= 100; // emit size 10 times a second
|
||||
+ emitSignal = d->lastTimeout.hasExpired(100); // emit size 10 times a second
|
||||
} else {
|
||||
emitSignal = true;
|
||||
}
|
||||
@@ -544,7 +543,7 @@ void SlaveBase::processedSize(KIO::filesize_t _bytes)
|
||||
if (emitSignal) {
|
||||
KIO_DATA << KIO_FILESIZE_T(_bytes);
|
||||
send(INF_PROCESSED_SIZE, data);
|
||||
- d->lastTimeout = now;
|
||||
+ d->lastTimeout.start();
|
||||
}
|
||||
|
||||
// d->processed_size = _bytes;
|
||||
@@ -1046,11 +1045,13 @@ int SlaveBase::readData(QByteArray &buffer)
|
||||
void SlaveBase::setTimeoutSpecialCommand(int timeout, const QByteArray &data)
|
||||
{
|
||||
if (timeout > 0) {
|
||||
- d->nextTimeout = QDateTime::currentDateTime().addSecs(timeout);
|
||||
+ d->nextTimeoutMsecs = timeout*1000; // from seconds to miliseconds
|
||||
+ d->nextTimeout.start();
|
||||
} else if (timeout == 0) {
|
||||
- d->nextTimeout = QDateTime::currentDateTime().addSecs(1); // Immediate timeout
|
||||
+ d->nextTimeoutMsecs = 1000; // Immediate timeout
|
||||
+ d->nextTimeout.start();
|
||||
} else {
|
||||
- d->nextTimeout = QDateTime(); // Canceled
|
||||
+ d->nextTimeout.invalidate(); // Canceled
|
||||
}
|
||||
|
||||
d->timeoutData = data;
|
||||
--
|
||||
cgit v0.11.2
|
||||
|
@ -1,54 +0,0 @@
|
||||
From 0f8c2d7922ca130971ac3a83ed86d8e552171389 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Janssen <alaves17@gmail.com>
|
||||
Date: Sat, 10 Feb 2018 09:48:52 -0700
|
||||
Subject: Fix bug #382437 "Regression in kdialog causes wrong file extension"
|
||||
|
||||
Summary:
|
||||
BUG: 382437
|
||||
One cause of the bug is commit at plasma-integration:
|
||||
0dafb9403266d6064074250d44b74dc0db946cfb
|
||||
//Make sure we always set a default mime filter in save mode
|
||||
KFileWidget::setMimeFilter() documentation says a default mime filter
|
||||
should be set if the dialog is being open in save mode.
|
||||
Without a default filter, the dialog uses a custom item (created by
|
||||
concatenating all the mime type filters) as default. This is not useful
|
||||
because it means an additional click for the user to select a filter that can
|
||||
actually be useful.
|
||||
If the initiallySelectedMimeTypeFilter() is empty, we use the first mime
|
||||
filter as fallback.//
|
||||
|
||||
Chrome opens kdialog with 2 mime types: application/octet-stream (means any file) and (for example) image/jpeg. But application/octet-stream is associated with *.bin extension. When you choose this mime extention becomes *.bin. That commit does this mime default (it's first).
|
||||
This patch blocks changing extention to bin for "application/octet-stream" selected.
|
||||
|
||||
Test Plan: Tested with Google Chrome. Used Open/Save dialogs for files.
|
||||
|
||||
Reviewers: #plasma, dfaure
|
||||
|
||||
Reviewed By: dfaure
|
||||
|
||||
Subscribers: ngraham, aacid, broulik, plasma-devel, #frameworks
|
||||
|
||||
Tags: #frameworks, #plasma
|
||||
|
||||
Differential Revision: https://phabricator.kde.org/D10114
|
||||
---
|
||||
src/filewidgets/kfilewidget.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/filewidgets/kfilewidget.cpp b/src/filewidgets/kfilewidget.cpp
|
||||
index aeb8dea..39c09b8 100644
|
||||
--- a/src/filewidgets/kfilewidget.cpp
|
||||
+++ b/src/filewidgets/kfilewidget.cpp
|
||||
@@ -2258,7 +2258,8 @@ void KFileWidgetPrivate::updateAutoSelectExtension()
|
||||
}
|
||||
}
|
||||
|
||||
- if (!currentExtension.isEmpty() && extensionList.contains(QLatin1String("*.") + currentExtension)) {
|
||||
+ if ((!currentExtension.isEmpty() && extensionList.contains(QLatin1String("*.") + currentExtension))
|
||||
+ || filter == QStringLiteral("application/octet-stream")) {
|
||||
extension = QLatin1Char('.') + currentExtension;
|
||||
} else {
|
||||
extension = defaultExtension;
|
||||
--
|
||||
cgit v0.11.2
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e6ecd2290d19e0680f4bc35dc157cf8f4df85ab3a967521dd510163843a372d5
|
||||
size 3139276
|
3
kio-5.44.0.tar.xz
Normal file
3
kio-5.44.0.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7a8fc6f0af101c4a16270d328806fbf96ee8855e756b033d6a08ce744e7071b7
|
||||
size 3145388
|
13
kio.changes
13
kio.changes
@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 12 23:29:41 CET 2018 - lbeltrame@kde.org
|
||||
|
||||
- Update to 5.44.0
|
||||
* New feature release
|
||||
* For more details please see:
|
||||
* https://www.kde.org/announcements/kde-frameworks-5.44.0.php
|
||||
- Changes since 5.43.0:
|
||||
* Too many changes to list here
|
||||
- Dropped patches, now upstream:
|
||||
* 0001-Dont-stat-etc-localtime-between-read-and-write.patch
|
||||
* 0001-Fix-bug-382437-Regression-in-kdialog-causes-wrong-file-ext.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 13 16:52:12 UTC 2018 - alarrosa@suse.com
|
||||
|
||||
|
12
kio.spec
12
kio.spec
@ -17,9 +17,9 @@
|
||||
|
||||
|
||||
%bcond_without lang
|
||||
%define _tar_path 5.43
|
||||
%define _tar_path 5.44
|
||||
Name: kio
|
||||
Version: 5.43.0
|
||||
Version: 5.44.0
|
||||
Release: 0
|
||||
%define kf5_version %{version}
|
||||
# Full KF5 version (e.g. 5.33.0)
|
||||
@ -27,17 +27,13 @@ Release: 0
|
||||
# Last major and minor KF5 version (e.g. 5.33)
|
||||
%{!?_kf5_bugfix_version: %global _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')}
|
||||
Summary: Network transparent access to files and data
|
||||
License: LGPL-2.1+
|
||||
License: LGPL-2.1-or-later
|
||||
Group: System/GUI/KDE
|
||||
Url: http://www.kde.org
|
||||
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz
|
||||
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: 0001-Dont-stat-etc-localtime-between-read-and-write.patch
|
||||
# PATCH-FIX-UPSTREAM
|
||||
Patch2: 0001-Fix-bug-382437-Regression-in-kdialog-causes-wrong-file-ext.patch
|
||||
BuildRequires: cmake >= 3.0
|
||||
BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version}
|
||||
BuildRequires: fdupes
|
||||
@ -128,8 +124,6 @@ Development files.
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
%build
|
||||
%cmake_kf5 -d build
|
||||
|
Loading…
Reference in New Issue
Block a user