public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/kio/, kde-frameworks/kio/files/
Date: Wed, 17 May 2017 22:08:18 +0000 (UTC)	[thread overview]
Message-ID: <1495058865.f1bce2a565cb22376963d4a63d8b566a748c7559.asturm@gentoo> (raw)

commit:     f1bce2a565cb22376963d4a63d8b566a748c7559
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun May 14 16:05:02 2017 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed May 17 22:07:45 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1bce2a5

kde-frameworks/kio: Fix major PreviewJob bugs

- Cleanup temp files of failed get()
- Skip remote directories

See also KDE Bug: https://bugs.kde.org/show_bug.cgi?id=208625

Package-Manager: Portage-2.3.5, Repoman-2.3.1

 .../kio/files/kio-5.34.0-previewjob1.patch         | 64 +++++++++++++++++
 .../kio/files/kio-5.34.0-previewjob2.patch         | 35 ++++++++++
 kde-frameworks/kio/kio-5.34.0-r1.ebuild            | 81 ++++++++++++++++++++++
 3 files changed, 180 insertions(+)

diff --git a/kde-frameworks/kio/files/kio-5.34.0-previewjob1.patch b/kde-frameworks/kio/files/kio-5.34.0-previewjob1.patch
new file mode 100644
index 00000000000..87ba27d807f
--- /dev/null
+++ b/kde-frameworks/kio/files/kio-5.34.0-previewjob1.patch
@@ -0,0 +1,64 @@
+From 78c45a1ea0e28a98f34c6d113c807f14700b22d4 Mon Sep 17 00:00:00 2001
+From: David Faure <faure@kde.org>
+Date: Sun, 14 May 2017 15:40:02 +0200
+Subject: [PATCH 1/2] PreviewJob: clean up empty temp file when get() fails.
+
+(e.g. because it's a directory)
+
+CCBUG: 208625
+---
+ src/widgets/previewjob.cpp | 17 +++++++++++++----
+ 1 file changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp
+index 9eae3469..e836f7da 100644
+--- a/src/widgets/previewjob.cpp
++++ b/src/widgets/previewjob.cpp
+@@ -143,6 +143,7 @@ public:
+     void getOrCreateThumbnail();
+     bool statResultThumbnail();
+     void createThumbnail(const QString &);
++    void cleanupTempFile();
+     void determineNextFile();
+     void emitPreview(const QImage &thumb);
+ 
+@@ -409,6 +410,16 @@ void PreviewJob::setIgnoreMaximumSize(bool ignoreSize)
+     d_func()->ignoreMaximumSize = ignoreSize;
+ }
+ 
++void PreviewJobPrivate::cleanupTempFile()
++{
++    if (!tempName.isEmpty()) {
++        Q_ASSERT(!QFileInfo(tempName).isDir());
++        Q_ASSERT(QFileInfo(tempName).isFile());
++        QFile::remove(tempName);
++        tempName.clear();
++    }
++}
++
+ void PreviewJobPrivate::determineNextFile()
+ {
+     Q_Q(PreviewJob);
+@@ -491,6 +502,7 @@ void PreviewJob::slotResult(KJob *job)
+     }
+     case PreviewJobPrivate::STATE_GETORIG: {
+         if (job->error()) {
++            d->cleanupTempFile();
+             d->determineNextFile();
+             return;
+         }
+@@ -499,10 +511,7 @@ void PreviewJob::slotResult(KJob *job)
+         return;
+     }
+     case PreviewJobPrivate::STATE_CREATETHUMB: {
+-        if (!d->tempName.isEmpty()) {
+-            QFile::remove(d->tempName);
+-            d->tempName.clear();
+-        }
++        d->cleanupTempFile();
+         d->determineNextFile();
+         return;
+     }
+-- 
+2.13.0
+

diff --git a/kde-frameworks/kio/files/kio-5.34.0-previewjob2.patch b/kde-frameworks/kio/files/kio-5.34.0-previewjob2.patch
new file mode 100644
index 00000000000..fab4d8825f4
--- /dev/null
+++ b/kde-frameworks/kio/files/kio-5.34.0-previewjob2.patch
@@ -0,0 +1,35 @@
+From 1620032772465be475ae0746aff63a566ef2a546 Mon Sep 17 00:00:00 2001
+From: David Faure <faure@kde.org>
+Date: Sun, 14 May 2017 15:48:33 +0200
+Subject: [PATCH 2/2] PreviewJob: skip remote directories. Too expensive to
+ preview.
+
+For some protocols, file_copy() would end up copying the whole
+directory locally!
+
+FIXED-IN: 5.35
+BUG: 208625
+---
+ src/widgets/previewjob.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp
+index e836f7da..da50b219 100644
+--- a/src/widgets/previewjob.cpp
++++ b/src/widgets/previewjob.cpp
+@@ -599,6 +599,12 @@ void PreviewJobPrivate::getOrCreateThumbnail()
+             createThumbnail(fileUrl.toString());
+             return;
+         }
++        if (item.isDir()) {
++            // Skip remote dirs (bug 208625)
++            cleanupTempFile();
++            determineNextFile();
++            return;
++        }
+         // No plugin support access to this remote content, copy the file
+         // to the local machine, then create the thumbnail
+         state = PreviewJobPrivate::STATE_GETORIG;
+-- 
+2.13.0
+

diff --git a/kde-frameworks/kio/kio-5.34.0-r1.ebuild b/kde-frameworks/kio/kio-5.34.0-r1.ebuild
new file mode 100644
index 00000000000..da2f973163c
--- /dev/null
+++ b/kde-frameworks/kio/kio-5.34.0-r1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+KDE_TEST="forceoptional-recursive"
+VIRTUALX_REQUIRED="test"
+inherit kde5
+
+DESCRIPTION="Framework providing transparent file and data management"
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="acl +handbook kerberos +kwallet X"
+
+COMMON_DEPEND="
+	$(add_frameworks_dep karchive)
+	$(add_frameworks_dep kbookmarks)
+	$(add_frameworks_dep kcodecs)
+	$(add_frameworks_dep kcompletion)
+	$(add_frameworks_dep kconfig)
+	$(add_frameworks_dep kconfigwidgets)
+	$(add_frameworks_dep kcoreaddons)
+	$(add_frameworks_dep kdbusaddons)
+	$(add_frameworks_dep ki18n)
+	$(add_frameworks_dep kiconthemes)
+	$(add_frameworks_dep kitemviews)
+	$(add_frameworks_dep kjobwidgets)
+	$(add_frameworks_dep knotifications)
+	$(add_frameworks_dep kservice)
+	$(add_frameworks_dep ktextwidgets)
+	$(add_frameworks_dep kwidgetsaddons)
+	$(add_frameworks_dep kwindowsystem)
+	$(add_frameworks_dep kxmlgui)
+	$(add_frameworks_dep solid)
+	$(add_qt_dep qtdbus)
+	$(add_qt_dep qtgui)
+	$(add_qt_dep qtnetwork 'ssl')
+	$(add_qt_dep qtscript)
+	$(add_qt_dep qtwidgets)
+	$(add_qt_dep qtxml)
+	dev-libs/libxml2
+	dev-libs/libxslt
+	acl? (
+		sys-apps/attr
+		virtual/acl
+	)
+	kerberos? ( virtual/krb5 )
+	kwallet? ( $(add_frameworks_dep kwallet) )
+	X? ( $(add_qt_dep qtx11extras) )
+"
+DEPEND="${COMMON_DEPEND}
+	$(add_qt_dep qtconcurrent)
+	handbook? ( $(add_frameworks_dep kdoctools) )
+	test? ( sys-libs/zlib )
+	X? (
+		x11-libs/libX11
+		x11-libs/libXrender
+		x11-proto/xproto
+	)
+"
+PDEPEND="
+	$(add_frameworks_dep kded)
+"
+RDEPEND="${COMMON_DEPEND}"
+
+# tests hang
+RESTRICT+=" test"
+
+PATCHES=( "${FILESDIR}"/${P}-previewjob{1,2}.patch )
+
+src_configure() {
+	local mycmakeargs=(
+		$(cmake-utils_use_find_package acl ACL)
+		$(cmake-utils_use_find_package handbook KF5DocTools)
+		$(cmake-utils_use_find_package kerberos GSSAPI)
+		$(cmake-utils_use_find_package kwallet KF5Wallet)
+		$(cmake-utils_use_find_package X X11)
+	)
+
+	kde5_src_configure
+}


             reply	other threads:[~2017-05-17 22:08 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 22:08 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-10-15 21:22 [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/kio/, kde-frameworks/kio/files/ Andreas Sturmlechner
2024-11-15 13:46 Andreas Sturmlechner
2024-08-10  7:57 Andreas Sturmlechner
2024-07-16 16:32 Andreas Sturmlechner
2024-03-24 21:03 Andreas Sturmlechner
2024-03-19  9:10 Andreas Sturmlechner
2023-06-22 21:16 Andreas Sturmlechner
2023-03-26  9:52 Andreas Sturmlechner
2023-03-23 16:47 Andreas Sturmlechner
2023-03-23  8:11 Andreas Sturmlechner
2023-01-25 10:22 Andreas Sturmlechner
2022-11-27 11:20 Andreas Sturmlechner
2022-08-08 14:40 Andreas Sturmlechner
2022-07-26 12:08 Andreas Sturmlechner
2022-07-19 13:29 Andreas Sturmlechner
2022-06-29 19:53 Andreas Sturmlechner
2021-12-08 15:08 Andreas Sturmlechner
2021-11-18 10:38 Andreas Sturmlechner
2021-08-15 18:57 Andreas Sturmlechner
2021-08-14 17:09 Andreas Sturmlechner
2021-07-16 15:21 Andreas Sturmlechner
2021-07-14 12:41 Andreas Sturmlechner
2021-05-30 15:51 Andreas Sturmlechner
2021-05-15 10:49 Andreas Sturmlechner
2021-04-11 14:23 Andreas Sturmlechner
2021-04-04 13:23 Andreas Sturmlechner
2021-03-25 23:13 Andreas Sturmlechner
2021-02-13 20:49 Andreas Sturmlechner
2021-02-12 21:48 Andreas Sturmlechner
2021-01-24 13:02 Andreas Sturmlechner
2021-01-11 12:28 Andreas Sturmlechner
2020-12-23 21:32 Andreas Sturmlechner
2020-11-16 23:41 Andreas Sturmlechner
2020-09-29 12:49 Andreas Sturmlechner
2020-05-16 22:38 Andreas Sturmlechner
2019-01-16 12:50 Andreas Sturmlechner
2018-07-21 16:51 Andreas Sturmlechner
2017-12-03 12:34 Andreas Sturmlechner
2017-09-30 20:34 Andreas Sturmlechner
2017-02-28 21:02 Johannes Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495058865.f1bce2a565cb22376963d4a63d8b566a748c7559.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox