[SCM] karchive packaging branch, master, updated. debian/5.28.0-1-5-g772e19f

Maximiliano Curia maxy at moszumanska.debian.org
Wed Mar 29 13:16:32 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/frameworks/karchive.git;a=commitdiff;h=f7364bb

The following commit has been merged in the master branch:
commit f7364bb295a0a5f92bb84079190521a20691eca6
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date:   Wed Mar 29 14:54:32 2017 +0200

    Add upstream patches for KCompressionDevice::seek
    
    Fix-KCompressionDevice-to-work-with-Qt-5.7.patch and
    Fix-my-fix-for-KCompressionDevice-seek.patch
---
 ...ix-KCompressionDevice-to-work-with-Qt-5.7.patch | 78 ++++++++++++++++++++++
 .../Fix-my-fix-for-KCompressionDevice-seek.patch   | 50 ++++++++++++++
 debian/patches/series                              |  2 +
 3 files changed, 130 insertions(+)

diff --git a/debian/patches/Fix-KCompressionDevice-to-work-with-Qt-5.7.patch b/debian/patches/Fix-KCompressionDevice-to-work-with-Qt-5.7.patch
new file mode 100644
index 0000000..68cb296
--- /dev/null
+++ b/debian/patches/Fix-KCompressionDevice-to-work-with-Qt-5.7.patch
@@ -0,0 +1,78 @@
+From: Albert Astals Cid <aacid at kde.org>
+Date: Sat, 4 Feb 2017 17:02:34 +0100
+Subject: Fix KCompressionDevice to work with Qt >= 5.7
+
+Don't use QIODevice:pos to track our pos, doesn't do what we want it to do.
+Call QIODevice::seek at the beginning as documentation says has to be done.
+
+Differential Revision: 4422
+---
+ src/kcompressiondevice.cpp | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/src/kcompressiondevice.cpp b/src/kcompressiondevice.cpp
+index de22bf8..04466a6 100644
+--- a/src/kcompressiondevice.cpp
++++ b/src/kcompressiondevice.cpp
+@@ -48,6 +48,7 @@ public:
+         , bOpenedUnderlyingDevice(false)
+         , bIgnoreData(false)
+         , type(KCompressionDevice::None)
++        , deviceReadPos(0)
+     {
+     }
+     bool bNeedHeader;
+@@ -59,6 +60,7 @@ public:
+     KFilterBase::Result result;
+     KFilterBase *filter;
+     KCompressionDevice::CompressionType type;
++    qint64 deviceReadPos;
+ };
+ 
+ KFilterBase *KCompressionDevice::filterForCompressionType(KCompressionDevice::CompressionType type)
+@@ -174,8 +176,10 @@ void KCompressionDevice::close()
+ 
+ bool KCompressionDevice::seek(qint64 pos)
+ {
+-    qint64 ioIndex = this->pos(); // current position
+-    if (ioIndex == pos) {
++    if (!QIODevice::seek(pos))
++        return false;
++
++    if (d->deviceReadPos == pos) {
+         return true;
+     }
+ 
+@@ -189,13 +193,13 @@ bool KCompressionDevice::seek(qint64 pos)
+         d->result = KFilterBase::Ok;
+         d->filter->setInBuffer(0L, 0);
+         d->filter->reset();
+-        QIODevice::seek(pos);
++        d->deviceReadPos = 0;
+         return d->filter->device()->reset();
+     }
+ 
+     qint64 bytesToRead;
+-    if (ioIndex < pos) { // we can start from here
+-        bytesToRead = pos - ioIndex;
++    if (d->deviceReadPos < pos) { // we can start from here
++        bytesToRead = pos - d->deviceReadPos;
+     } else {
+         // we have to start from 0 ! Ugly and slow, but better than the previous
+         // solution (KTarGz was allocating everything into memory)
+@@ -210,7 +214,6 @@ bool KCompressionDevice::seek(qint64 pos)
+     d->bIgnoreData = true;
+     const bool result = (read(dummy.data(), bytesToRead) == bytesToRead);
+     d->bIgnoreData = false;
+-    QIODevice::seek(pos);
+     return result;
+ }
+ 
+@@ -303,6 +306,7 @@ qint64 KCompressionDevice::readData(char *data, qint64 maxlen)
+         filter->setOutBuffer(data, availOut);
+     }
+ 
++    d->deviceReadPos += dataReceived;
+     return dataReceived;
+ }
+ 
diff --git a/debian/patches/Fix-my-fix-for-KCompressionDevice-seek.patch b/debian/patches/Fix-my-fix-for-KCompressionDevice-seek.patch
new file mode 100644
index 0000000..38368cc
--- /dev/null
+++ b/debian/patches/Fix-my-fix-for-KCompressionDevice-seek.patch
@@ -0,0 +1,50 @@
+From: Albert Astals Cid <aacid at kde.org>
+Date: Sun, 5 Feb 2017 01:49:42 +0100
+Subject: Fix my fix for KCompressionDevice::seek
+
+Differential Revision: https://phabricator.kde.org/D4437
+---
+ src/kcompressiondevice.cpp | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/src/kcompressiondevice.cpp b/src/kcompressiondevice.cpp
+index 04466a6..2b70ae0 100644
+--- a/src/kcompressiondevice.cpp
++++ b/src/kcompressiondevice.cpp
+@@ -176,11 +176,8 @@ void KCompressionDevice::close()
+ 
+ bool KCompressionDevice::seek(qint64 pos)
+ {
+-    if (!QIODevice::seek(pos))
+-        return false;
+-
+     if (d->deviceReadPos == pos) {
+-        return true;
++        return QIODevice::seek(pos);
+     }
+ 
+     //qDebug() << "seek(" << pos << ") called, current pos=" << ioIndex;
+@@ -188,6 +185,9 @@ bool KCompressionDevice::seek(qint64 pos)
+     Q_ASSERT(d->filter->mode() == QIODevice::ReadOnly);
+ 
+     if (pos == 0) {
++        if (!QIODevice::seek(pos))
++            return false;
++
+         // We can forget about the cached data
+         d->bNeedHeader = !d->bSkipHeaders;
+         d->result = KFilterBase::Ok;
+@@ -200,6 +200,13 @@ bool KCompressionDevice::seek(qint64 pos)
+     qint64 bytesToRead;
+     if (d->deviceReadPos < pos) { // we can start from here
+         bytesToRead = pos - d->deviceReadPos;
++        // Since we're going to do a read() below
++        // we need to reset the internal QIODevice pos to the real position we are
++        // so that after read() we are indeed pointing to the pos seek
++        // asked us to be in
++        if (!QIODevice::seek(d->deviceReadPos)) {
++            return false;
++        }
+     } else {
+         // we have to start from 0 ! Ugly and slow, but better than the previous
+         // solution (KTarGz was allocating everything into memory)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..1a6e341
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+Fix-KCompressionDevice-to-work-with-Qt-5.7.patch
+Fix-my-fix-for-KCompressionDevice-seek.patch

-- 
karchive packaging



More information about the pkg-kde-commits mailing list