Hello community, here is the log from the commit of package karchive for openSUSE:Factory checked in at 2015-06-23 12:05:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/karchive (Old) and /work/SRC/openSUSE:Factory/.karchive.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "karchive" Changes: -------- --- /work/SRC/openSUSE:Factory/karchive/karchive.changes 2015-05-11 19:48:12.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.karchive.new/karchive.changes 2015-06-23 12:05:59.000000000 +0200 @@ -1,0 +2,7 @@ +Sun Jun 7 19:07:10 UTC 2015 - [email protected] + +- Update to 5.11.0 + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.11.0.php + +------------------------------------------------------------------- Old: ---- karchive-5.10.0.tar.xz New: ---- karchive-5.11.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ karchive.spec ++++++ --- /var/tmp/diff_new_pack.nUff8V/_old 2015-06-23 12:06:00.000000000 +0200 +++ /var/tmp/diff_new_pack.nUff8V/_new 2015-06-23 12:06:00.000000000 +0200 @@ -17,9 +17,9 @@ %define lname libKF5Archive5 -%define _tar_path 5.10 +%define _tar_path 5.11 Name: karchive -Version: 5.10.0 +Version: 5.11.0 Release: 0 BuildRequires: cmake >= 2.8.12 BuildRequires: extra-cmake-modules >= %{_tar_path} ++++++ karchive-5.10.0.tar.xz -> karchive-5.11.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/CMakeLists.txt new/karchive-5.11.0/CMakeLists.txt --- old/karchive-5.10.0/CMakeLists.txt 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/CMakeLists.txt 2015-06-06 11:22:22.000000000 +0200 @@ -2,7 +2,11 @@ project(KArchive) -find_package(ECM 5.10.0 REQUIRED NO_MODULE) +include(FeatureSummary) +find_package(ECM 5.11.0 NO_MODULE) +set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") +feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) + set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) @@ -10,7 +14,7 @@ include(KDEFrameworkCompilerSettings) include(KDECMakeSettings) -include(FeatureSummary) + include(GenerateExportHeader) set(REQUIRED_QT_VERSION 5.2.0) @@ -45,7 +49,7 @@ include(ECMSetupVersion) include(ECMGenerateHeaders) -set(KF5_VERSION "5.10.0") # handled by release scripts +set(KF5_VERSION "5.11.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KARCHIVE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/autotests/karchivetest.cpp new/karchive-5.11.0/autotests/karchivetest.cpp --- old/karchive-5.10.0/autotests/karchivetest.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/autotests/karchivetest.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -437,6 +437,15 @@ { QFETCH(QString, fileName); + QFileInfo localFileData("test3"); + + const QString systemUserName = getCurrentUserName(); + const QString systemGroupName = getCurrentGroupName(); + const QString owner = localFileData.owner(); + const QString group = localFileData.group(); + const QString emptyTime = QDateTime().toString("dd.MM.yyyy hh:mm:ss"); + const QDateTime creationTime = QFileInfo(fileName).created(); + // 1.6-1.7 ms per interaction, 2908428 instruction loads // After the "no tempfile when writing fix" this went down // to 0.9-1.0 ms, 1689059 instruction loads. @@ -452,38 +461,31 @@ QVERIFY(dir != 0); const QStringList listing = recursiveListEntries(dir, "", WithUserGroup | WithTime); - QFileInfo localFileData("test3"); - #ifndef Q_OS_WIN QCOMPARE(listing.count(), 15); #else QCOMPARE(listing.count(), 14); #endif - QString owner = localFileData.owner().isEmpty() ? getCurrentUserName() : localFileData.owner(); - QString group = localFileData.group().isEmpty() ? getCurrentGroupName() : localFileData.group(); - QString emptyTime = QDateTime().toString("dd.MM.yyyy hh:mm:ss"); - const QDateTime creationTime = QFileInfo(fileName).created(); - compareEntryWithTimestamp(listing[0], QString("mode=40755 user= group= path=aaaemptydir type=dir"), creationTime); - QCOMPARE(listing[1], QString("mode=40777 user=%1 group=%2 path=dir type=dir time=%3").arg(owner).arg(group).arg(emptyTime)); - QCOMPARE(listing[2], QString("mode=40777 user=%1 group=%2 path=dir/subdir type=dir time=%3").arg(owner).arg(group).arg(emptyTime)); + QCOMPARE(listing[1], QString("mode=40777 user=%1 group=%2 path=dir type=dir time=%3").arg(systemUserName).arg(systemGroupName).arg(emptyTime)); + QCOMPARE(listing[2], QString("mode=40777 user=%1 group=%2 path=dir/subdir type=dir time=%3").arg(systemUserName).arg(systemGroupName).arg(emptyTime)); compareEntryWithTimestamp(listing[3], QString("mode=100644 user= group= path=dir/subdir/mediumfile2 type=file size=100"), creationTime); compareEntryWithTimestamp(listing[4], QString("mode=100644 user=weis group=users path=empty type=file size=0"), creationTime); compareEntryWithTimestamp(listing[5], QString("mode=100644 user= group= path=hugefile type=file size=20000"), creationTime); compareEntryWithTimestamp(listing[6], QString("mode=100644 user= group= path=mediumfile type=file size=100"), creationTime); - QCOMPARE(listing[7], QString("mode=40777 user=%1 group=%2 path=my type=dir time=").arg(owner).arg(group)); - QCOMPARE(listing[8], QString("mode=40777 user=%1 group=%2 path=my/dir type=dir time=").arg(owner).arg(group)); + QCOMPARE(listing[7], QString("mode=40777 user=%1 group=%2 path=my type=dir time=").arg(systemUserName).arg(systemGroupName)); + QCOMPARE(listing[8], QString("mode=40777 user=%1 group=%2 path=my/dir type=dir time=").arg(systemUserName).arg(systemGroupName)); compareEntryWithTimestamp(listing[9], QString("mode=100644 user=dfaure group=hackers path=my/dir/test3 type=file size=28"), creationTime); compareEntryWithTimestamp(listing[10], QString("mode=100440 user=weis group=users path=test1 type=file size=5"), creationTime); compareEntryWithTimestamp(listing[11], QString("mode=100644 user=weis group=users path=test2 type=file size=8"), creationTime); - QCOMPARE(listing[12], QString("mode=40777 user=%1 group=%2 path=z type=dir time=").arg(owner).arg(group)); + QCOMPARE(listing[12], QString("mode=40777 user=%1 group=%2 path=z type=dir time=").arg(systemUserName).arg(systemGroupName)); - // This one was added with addLocalFile, so ignore mode/user/group. + // This one was added with addLocalFile, so ignore mode. QString str = listing[13]; - str.replace(QRegExp("mode.*path"), "path"); + str.replace(QRegExp("mode.*user"), "user"); - compareEntryWithTimestamp(str, QString("path=z/test3 type=file size=13"), creationTime); + compareEntryWithTimestamp(str, QString("user=%1 group=%2 path=z/test3 type=file size=13").arg(owner).arg(group), creationTime); #ifndef Q_OS_WIN str = listing[14]; @@ -1148,8 +1150,6 @@ QVERIFY(dir != 0); const QStringList listing = recursiveListEntries(dir, "", 0); - QFileInfo localFileData("test3"); - #ifndef Q_OS_WIN QCOMPARE(listing.count(), 15); #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/k7zip.cpp new/karchive-5.11.0/src/k7zip.cpp --- old/karchive-5.10.0/src/k7zip.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/k7zip.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -225,7 +225,8 @@ , size(0) , crc(0) , crcDefined(false) - {} + { + } QString path; bool attribDefined; @@ -264,7 +265,8 @@ Folder() : unpackCRCDefined(false) , unpackCRC(0) - {} + { + } quint64 getUnpackSize() const { @@ -385,15 +387,15 @@ { public: K7ZipPrivate(K7Zip *parent) - : q(parent), - packPos(0), - numPackStreams(0), - buffer(0), - pos(0), - end(0), - headerSize(0), - countSize(0), - m_currentFile(0) + : q(parent) + , packPos(0) + , numPackStreams(0) + , buffer(0) + , pos(0) + , end(0) + , headerSize(0) + , countSize(0) + , m_currentFile(0) { } @@ -507,12 +509,14 @@ }; K7Zip::K7Zip(const QString &fileName) - : KArchive(fileName), d(new K7ZipPrivate(this)) + : KArchive(fileName) + , d(new K7ZipPrivate(this)) { } K7Zip::K7Zip(QIODevice *dev) - : KArchive(dev), d(new K7ZipPrivate(this)) + : KArchive(dev) + , d(new K7ZipPrivate(this)) { Q_ASSERT(dev); } @@ -678,8 +682,8 @@ } void K7Zip::K7ZipPrivate::readHashDigests(int numItems, - QVector<bool> &digestsDefined, - QVector<quint32> &digests) + QVector<bool> &digestsDefined, + QVector<quint32> &digests) { if (!buffer) { return; @@ -1229,7 +1233,10 @@ quint32 range; quint32 code; - RangeDecoder() : pos(0) {} + RangeDecoder() + : pos(0) + { + } unsigned char readByte() { @@ -1332,7 +1339,7 @@ }; template <int numMoveBits> -class CBitDecoder: public CBitModel<numMoveBits> +class CBitDecoder : public CBitModel<numMoveBits> { public: quint32 decode(RangeDecoder *decoder) @@ -1868,7 +1875,7 @@ quint64 id = info->methodID; size_t idSize; - for (idSize = 1; idSize < sizeof(id); idSize++) { + for (idSize = 1; idSize < sizeof (id); idSize++) { if ((id >> (8 * idSize)) == 0) { break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kar.cpp new/karchive-5.11.0/src/kar.cpp --- old/karchive-5.10.0/src/kar.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kar.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -1,4 +1,3 @@ - /* This file is part of the KDE libraries Copyright (C) 2002 Laurence Anderson <[email protected]> @@ -33,16 +32,20 @@ class KAr::KArPrivate { public: - KArPrivate() {} + KArPrivate() + { + } }; KAr::KAr(const QString &filename) - : KArchive(filename), d(new KArPrivate) + : KArchive(filename) + , d(new KArPrivate) { } KAr::KAr(QIODevice *dev) - : KArchive(dev), d(new KArPrivate) + : KArchive(dev) + , d(new KArPrivate) { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/karchive.cpp new/karchive-5.11.0/src/karchive.cpp --- old/karchive-5.10.0/src/karchive.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/karchive.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -172,7 +172,8 @@ closeSucceeded = d->saveFile->commit(); delete d->saveFile; d->saveFile = 0; - } if (d->deviceOwned) { + } + if (d->deviceOwned) { delete d->dev; // we created it ourselves in open() } @@ -458,8 +459,8 @@ //qDebug() << "found parent " << parent->name() << " adding " << dirname << " to ensure " << path; // Found -> add the missing piece KArchiveDirectory *e = new KArchiveDirectory(this, dirname, d->rootDir->permissions(), - d->rootDir->date(), d->rootDir->user(), - d->rootDir->group(), QString()); + d->rootDir->date(), d->rootDir->user(), + d->rootDir->group(), QString()); parent->addEntry(e); return e; // now a directory to <path> exists } @@ -527,15 +528,16 @@ public: KArchiveEntryPrivate(KArchive *_archive, const QString &_name, int _access, const QDateTime &_date, const QString &_user, const QString &_group, - const QString &_symlink) : - name(_name), - date(_date), - access(_access), - user(_user), - group(_group), - symlink(_symlink), - archive(_archive) - {} + const QString &_symlink) + : name(_name) + , date(_date) + , access(_access) + , user(_user) + , group(_group) + , symlink(_symlink) + , archive(_archive) + { + } QString name; QDateTime date; mode_t access; @@ -547,8 +549,8 @@ KArchiveEntry::KArchiveEntry(KArchive *t, const QString &name, int access, const QDateTime &date, const QString &user, const QString &group, const - QString &symlink) : - d(new KArchiveEntryPrivate(t, name, access, date, user, group, symlink)) + QString &symlink) + : d(new KArchiveEntryPrivate(t, name, access, date, user, group, symlink)) { } @@ -609,10 +611,11 @@ class KArchiveFilePrivate { public: - KArchiveFilePrivate(qint64 _pos, qint64 _size) : - pos(_pos), - size(_size) - {} + KArchiveFilePrivate(qint64 _pos, qint64 _size) + : pos(_pos) + , size(_size) + { + } qint64 pos; qint64 size; }; @@ -621,8 +624,8 @@ const QString &user, const QString &group, const QString &symlink, qint64 pos, qint64 size) - : KArchiveEntry(t, name, access, date, user, group, symlink), - d(new KArchiveFilePrivate(pos, size)) + : KArchiveEntry(t, name, access, date, user, group, symlink) + , d(new KArchiveFilePrivate(pos, size)) { } @@ -718,8 +721,8 @@ const QDateTime &date, const QString &user, const QString &group, const QString &symlink) - : KArchiveEntry(t, name, access, date, user, group, symlink), - d(new KArchiveDirectoryPrivate) + : KArchiveEntry(t, name, access, date, user, group, symlink) + , d(new KArchiveDirectoryPrivate) { } @@ -878,7 +881,7 @@ qSort(fileList.begin(), fileList.end(), sortByPosition); // sort on d->pos, so we have a linear access for (QList<const KArchiveFile *>::const_iterator it = fileList.constBegin(), end = fileList.constEnd(); - it != end; ++it) { + it != end; ++it) { const KArchiveFile *f = *it; qint64 pos = f->position(); if (!f->copyTo(fileToDir[pos])) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/karchive_p.h new/karchive-5.11.0/src/karchive_p.h --- old/karchive-5.10.0/src/karchive_p.h 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/karchive_p.h 2015-06-06 11:22:22.000000000 +0200 @@ -28,13 +28,14 @@ { public: KArchivePrivate() - : rootDir(0), - saveFile(0), - dev(0), - fileName(), - mode(QIODevice::NotOpen), - deviceOwned(false) - {} + : rootDir(0) + , saveFile(0) + , dev(0) + , fileName() + , mode(QIODevice::NotOpen) + , deviceOwned(false) + { + } ~KArchivePrivate() { delete saveFile; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kbzip2filter.cpp new/karchive-5.11.0/src/kbzip2filter.cpp --- old/karchive-5.10.0/src/kbzip2filter.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kbzip2filter.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -50,7 +50,7 @@ Private() : isInitialized(false) { - memset(&zStream, 0, sizeof(zStream)); + memset(&zStream, 0, sizeof (zStream)); mode = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kcompressiondevice.cpp new/karchive-5.11.0/src/kcompressiondevice.cpp --- old/karchive-5.10.0/src/kcompressiondevice.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kcompressiondevice.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -42,10 +42,14 @@ class KCompressionDevice::Private { public: - Private() : bNeedHeader(true), bSkipHeaders(false), - bOpenedUnderlyingDevice(false), - bIgnoreData(false), - type(KCompressionDevice::None) {} + Private() + : bNeedHeader(true) + , bSkipHeaders(false) + , bOpenedUnderlyingDevice(false) + , bIgnoreData(false) + , type(KCompressionDevice::None) + { + } bool bNeedHeader; bool bSkipHeaders; bool bOpenedUnderlyingDevice; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kcompressiondevice.h new/karchive-5.11.0/src/kcompressiondevice.h --- old/karchive-5.10.0/src/kcompressiondevice.h 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kcompressiondevice.h 2015-06-06 11:22:22.000000000 +0200 @@ -35,7 +35,12 @@ class KARCHIVE_EXPORT KCompressionDevice : public QIODevice { public: - enum CompressionType { GZip, BZip2, Xz, None }; + enum CompressionType { + GZip, + BZip2, + Xz, + None + }; /** * Constructs a KCompressionDevice for a given CompressionType (e.g. GZip, BZip2 etc.). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kfilterbase.h new/karchive-5.11.0/src/kfilterbase.h --- old/karchive-5.10.0/src/kfilterbase.h 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kfilterbase.h 2015-06-06 11:22:22.000000000 +0200 @@ -79,7 +79,11 @@ virtual int outBufferAvailable() const = 0; /** \internal */ - enum Result { Ok, End, Error }; + enum Result { + Ok, + End, + Error + }; /** \internal */ virtual Result uncompress() = 0; /** \internal */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kfilterdev.cpp new/karchive-5.11.0/src/kfilterdev.cpp --- old/karchive-5.10.0/src/kfilterdev.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kfilterdev.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -58,14 +58,14 @@ } #if HAVE_BZIP2_SUPPORT if (mimeType == QLatin1String("application/x-bzip") - || mimeType == QLatin1String("application/x-bzip2") // old name, kept for compatibility + || mimeType == QLatin1String("application/x-bzip2") // old name, kept for compatibility ) { return KCompressionDevice::BZip2; } #endif #if HAVE_XZ_SUPPORT if (mimeType == QLatin1String("application/x-lzma") // legacy name, still used - || mimeType == QLatin1String("application/x-xz") // current naming + || mimeType == QLatin1String("application/x-xz") // current naming ) { return KCompressionDevice::Xz; } @@ -97,4 +97,3 @@ //qDebug() << "no compression found for" << mimeType; return KCompressionDevice::None; } - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kgzipfilter.cpp new/karchive-5.11.0/src/kgzipfilter.cpp --- old/karchive-5.10.0/src/kgzipfilter.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kgzipfilter.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -38,7 +38,12 @@ { public: Private() - : headerWritten(false), footerWritten(false), compressed(false), mode(0), crc(0), isInitialized(false) + : headerWritten(false) + , footerWritten(false) + , compressed(false) + , mode(0) + , crc(0) + , isInitialized(false) { zStream.zalloc = (alloc_func)0; zStream.zfree = (free_func)0; @@ -210,7 +215,8 @@ qDebug() << "ORIG_NAME=" << (char *)p; #endif while ((i > 0) && (*p)) { - i--; p++; + i--; + p++; } if (--i <= 0) { return false; @@ -219,7 +225,8 @@ } if ((flags & COMMENT) != 0) { // skip comment while ((i > 0) && (*p)) { - i--; p++; + i--; + p++; } if (--i <= 0) { return false; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/klimitediodevice.cpp new/karchive-5.11.0/src/klimitediodevice.cpp --- old/karchive-5.10.0/src/klimitediodevice.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/klimitediodevice.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -19,7 +19,9 @@ #include "klimitediodevice_p.h" KLimitedIODevice::KLimitedIODevice(QIODevice *dev, qint64 start, qint64 length) - : m_dev(dev), m_start(start), m_length(length) + : m_dev(dev) + , m_start(start) + , m_length(length) { //qDebug() << "start=" << start << "length=" << length; open(QIODevice::ReadOnly); //krazy:exclude=syscalls diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/klimitediodevice_p.h new/karchive-5.11.0/src/klimitediodevice_p.h --- old/karchive-5.10.0/src/klimitediodevice_p.h 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/klimitediodevice_p.h 2015-06-06 11:22:22.000000000 +0200 @@ -39,7 +39,9 @@ * @param length the length of the data to read (in bytes) */ KLimitedIODevice(QIODevice *dev, qint64 start, qint64 length); - virtual ~KLimitedIODevice() {} + virtual ~KLimitedIODevice() + { + } bool isSequential() const Q_DECL_OVERRIDE; @@ -49,8 +51,7 @@ qint64 size() const Q_DECL_OVERRIDE; qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE; - qint64 writeData(const char *, qint64) Q_DECL_OVERRIDE - { + qint64 writeData(const char *, qint64) Q_DECL_OVERRIDE { return -1; // unsupported } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/knonefilter.cpp new/karchive-5.11.0/src/knonefilter.cpp --- old/karchive-5.10.0/src/knonefilter.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/knonefilter.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -28,7 +28,11 @@ { public: Private() - : mode(0), avail_out(0), avail_in(0), next_in(NULL), next_out(NULL) + : mode(0) + , avail_out(0) + , avail_in(0) + , next_in(NULL) + , next_out(NULL) { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/krcc.cpp new/karchive-5.11.0/src/krcc.cpp --- old/karchive-5.10.0/src/krcc.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/krcc.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -32,8 +32,10 @@ class KRcc::KRccPrivate { public: - KRccPrivate() {} - void createEntries(const QDir &dir, KArchiveDirectory *parentDir, KRcc* q); + KRccPrivate() + { + } + void createEntries(const QDir &dir, KArchiveDirectory *parentDir, KRcc *q); QString m_prefix; // '/' + uuid }; @@ -45,19 +47,20 @@ { public: KRccFileEntry(KArchive *archive, const QString &name, int access, const QDateTime &date, - const QString &user, const QString &group, qint64 size, const QString &resourcePath) - : KArchiveFile(archive, name, access, date, user, group, QString(), 0, size), - m_resourcePath(resourcePath) - {} + const QString &user, const QString &group, qint64 size, const QString &resourcePath) + : KArchiveFile(archive, name, access, date, user, group, QString(), 0, size) + , m_resourcePath(resourcePath) + { + } QByteArray data() const Q_DECL_OVERRIDE { - QFile f(m_resourcePath); - if (f.open(QIODevice::ReadOnly)) { - return f.readAll(); - } - qWarning() << "Couldn't open" << m_resourcePath; - return QByteArray(); + QFile f(m_resourcePath); + if (f.open(QIODevice::ReadOnly)) { + return f.readAll(); + } + qWarning() << "Couldn't open" << m_resourcePath; + return QByteArray(); } QIODevice *createDevice() const Q_DECL_OVERRIDE { @@ -67,9 +70,9 @@ QString m_resourcePath; }; - KRcc::KRcc(const QString &filename) - : KArchive(filename), d(new KRccPrivate) + : KArchive(filename) + , d(new KRccPrivate) { } @@ -82,7 +85,7 @@ } bool KRcc::doPrepareWriting(const QString &, const QString &, const QString &, - qint64, mode_t, const QDateTime &, const QDateTime &, const QDateTime &) + qint64, mode_t, const QDateTime &, const QDateTime &, const QDateTime &) { return false; } @@ -93,13 +96,13 @@ } bool KRcc::doWriteDir(const QString &, const QString &, const QString &, - mode_t, const QDateTime &, const QDateTime &, const QDateTime &) + mode_t, const QDateTime &, const QDateTime &, const QDateTime &) { return false; } bool KRcc::doWriteSymLink(const QString &, const QString &, const QString &, - const QString &, mode_t, const QDateTime &, const QDateTime &, const QDateTime &) + const QString &, mode_t, const QDateTime &, const QDateTime &, const QDateTime &) { return false; } @@ -127,18 +130,18 @@ return true; } -void KRcc::KRccPrivate::createEntries(const QDir &dir, KArchiveDirectory *parentDir, KRcc* q) +void KRcc::KRccPrivate::createEntries(const QDir &dir, KArchiveDirectory *parentDir, KRcc *q) { - Q_FOREACH(const QString &fileName, dir.entryList()) { + Q_FOREACH (const QString &fileName, dir.entryList()) { const QString entryPath = dir.path() + QLatin1Char('/') + fileName; const QFileInfo info(entryPath); if (info.isFile()) { KArchiveEntry *entry = new KRccFileEntry(q, fileName, 0444, info.lastModified(), - parentDir->user(), parentDir->group(), info.size(), entryPath); + parentDir->user(), parentDir->group(), info.size(), entryPath); parentDir->addEntry(entry); } else { KArchiveDirectory *entry = new KArchiveDirectory(q, fileName, 0555, info.lastModified(), - parentDir->user(), parentDir->group(), /*symlink*/ QString()); + parentDir->user(), parentDir->group(), /*symlink*/ QString()); parentDir->addEntry(entry); createEntries(QDir(entryPath), entry, q); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/ktar.cpp new/karchive-5.11.0/src/ktar.cpp --- old/karchive-5.10.0/src/ktar.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/ktar.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -47,9 +47,9 @@ { public: KTarPrivate(KTar *parent) - : q(parent), - tarEnd(0), - tmpFile(0) + : q(parent) + , tarEnd(0) + , tmpFile(0) { } @@ -72,13 +72,15 @@ }; KTar::KTar(const QString &fileName, const QString &_mimetype) - : KArchive(fileName), d(new KTarPrivate(this)) + : KArchive(fileName) + , d(new KTarPrivate(this)) { d->mimetype = _mimetype; } KTar::KTar(QIODevice *dev) - : KArchive(dev), d(new KTarPrivate(this)) + : KArchive(dev) + , d(new KTarPrivate(this)) { } @@ -206,8 +208,8 @@ // because the other digits are filled with all sorts of different chars by different tars ... // Some tars right-justify the checksum so it could start in one of three places - we have to check each. if (strncmp(buffer + 148 + 6 - s.length(), s.data(), s.length()) - && strncmp(buffer + 148 + 7 - s.length(), s.data(), s.length()) - && strncmp(buffer + 148 + 8 - s.length(), s.data(), s.length())) { + && strncmp(buffer + 148 + 7 - s.length(), s.data(), s.length()) + && strncmp(buffer + 148 + 8 - s.length(), s.data(), s.length())) { /*qWarning() << "KTar: invalid TAR file. Header is:" << QByteArray( buffer+257, 5 ) << "instead of ustar. Reading from wrong pos in file?" << "checksum=" << QByteArray( buffer + 148 + 6 - s.length(), s.length() );*/ @@ -270,8 +272,12 @@ QByteArray longlink; readLonglink(buffer, longlink); switch (typeflag) { - case 'L': name = QFile::decodeName(longlink); break; - case 'K': symlink = QFile::decodeName(longlink); break; + case 'L': + name = QFile::decodeName(longlink); + break; + case 'K': + symlink = QFile::decodeName(longlink); + break; }/*end switch*/ } else { break; @@ -362,7 +368,7 @@ } // read dir information - char buffer[ 0x200 ]; + char buffer[0x200]; bool ende = false; do { QString name; @@ -390,7 +396,7 @@ QString nm = (pos == -1) ? name : name.mid(pos + 1); // read access - buffer[ 0x6b ] = 0; + buffer[0x6b] = 0; char *dummy; const char *p = buffer + 0x64; while (*p == ' ') { @@ -403,7 +409,7 @@ QString group = QString::fromLocal8Bit(buffer + 0x129); // read time - buffer[ 0x93 ] = 0; + buffer[0x93] = 0; p = buffer + 0x88; while (*p == ' ') { ++p; @@ -411,7 +417,7 @@ uint time = (int)strtol(p, &dummy, 8); // read type flag - char typeflag = buffer[ 0x9c ]; + char typeflag = buffer[0x9c]; // '0' for files, '1' hard link, '2' symlink, '5' for directory // (and 'L' for longlink fileNames, 'K' for longlink symlink targets) // 'D' for GNU tar extension DUMPDIR, 'x' for Extended header referring @@ -514,7 +520,7 @@ bool forced = false; if (QLatin1String(application_gzip) == mimetype || QLatin1String(application_bzip) == mimetype || - QLatin1String(application_lzma) == mimetype || QLatin1String(application_xz) == mimetype) { + QLatin1String(application_lzma) == mimetype || QLatin1String(application_xz) == mimetype) { forced = true; } @@ -573,7 +579,7 @@ d->tarEnd = device()->pos() + (rest ? 0x200 - rest : 0); // Record our new end of archive } if (rest) { - char buffer[ 0x201 ]; + char buffer[0x201]; for (uint i = 0; i < 0x200; ++i) { buffer[i] = 0; } @@ -613,8 +619,8 @@ // mode (as in stpos()) assert(strlen(mode) == 6); memcpy(buffer + 0x64, mode, 6); - buffer[ 0x6a ] = ' '; - buffer[ 0x6b ] = '\0'; + buffer[0x6a] = ' '; + buffer[0x6b] = '\0'; // dummy uid strcpy(buffer + 0x6c, " 765 "); // 501 in decimal @@ -625,33 +631,33 @@ QByteArray s = QByteArray::number(size, 8); // octal s = s.rightJustified(11, '0'); memcpy(buffer + 0x7c, s.data(), 11); - buffer[ 0x87 ] = ' '; // space-terminate (no null after) + buffer[0x87] = ' '; // space-terminate (no null after) // modification time const QDateTime modificationTime = mtime.isValid() ? mtime : QDateTime::currentDateTime(); s = QByteArray::number(static_cast<qulonglong>(modificationTime.toMSecsSinceEpoch() / 1000), 8); // octal s = s.rightJustified(11, '0'); memcpy(buffer + 0x88, s.data(), 11); - buffer[ 0x93 ] = ' '; // space-terminate (no null after) -- well current tar writes a null byte + buffer[0x93] = ' '; // space-terminate (no null after) -- well current tar writes a null byte // spaces, replaced by the check sum later - buffer[ 0x94 ] = 0x20; - buffer[ 0x95 ] = 0x20; - buffer[ 0x96 ] = 0x20; - buffer[ 0x97 ] = 0x20; - buffer[ 0x98 ] = 0x20; - buffer[ 0x99 ] = 0x20; + buffer[0x94] = 0x20; + buffer[0x95] = 0x20; + buffer[0x96] = 0x20; + buffer[0x97] = 0x20; + buffer[0x98] = 0x20; + buffer[0x99] = 0x20; /* From the tar sources : Fill in the checksum field. It's formatted differently from the other fields: it has [6] digits, a null, then a space -- rather than digits, a space, then a null. */ - buffer[ 0x9a ] = '\0'; - buffer[ 0x9b ] = ' '; + buffer[0x9a] = '\0'; + buffer[0x9b] = ' '; // type flag (dir, file, link) - buffer[ 0x9c ] = typeflag; + buffer[0x9c] = typeflag; // magic + version strcpy(buffer + 0x101, "ustar"); @@ -727,7 +733,7 @@ } */ - char buffer[ 0x201 ]; + char buffer[0x201]; memset(buffer, 0, 0x200); if ((mode() & QIODevice::ReadWrite) == QIODevice::ReadWrite) { device()->seek(d->tarEnd); // Go to end of archive as might have moved with a read @@ -783,7 +789,7 @@ return true; // already there } - char buffer[ 0x201 ]; + char buffer[0x201]; memset(buffer, 0, 0x200); if ((mode() & QIODevice::ReadWrite) == QIODevice::ReadWrite) { device()->seek(d->tarEnd); // Go to end of archive as might have moved with a read @@ -836,7 +842,7 @@ // In some tar files we can find dir/./file => call cleanPath QString fileName(QDir::cleanPath(name)); - char buffer[ 0x201 ]; + char buffer[0x201]; memset(buffer, 0, 0x200); if ((mode() & QIODevice::ReadWrite) == QIODevice::ReadWrite) { device()->seek(d->tarEnd); // Go to end of archive as might have moved with a read diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kxzfilter.cpp new/karchive-5.11.0/src/kxzfilter.cpp --- old/karchive-5.10.0/src/kxzfilter.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kxzfilter.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -39,7 +39,7 @@ Private() : isInitialized(false) { - memset(&zStream, 0, sizeof(zStream)); + memset(&zStream, 0, sizeof (zStream)); mode = 0; } @@ -101,7 +101,7 @@ props[i] = properties[i]; } - result = lzma_properties_decode(&d->filters[0], NULL, props, sizeof(props)); + result = lzma_properties_decode(&d->filters[0], NULL, props, sizeof (props)); if (result != LZMA_OK) { qWarning() << "lzma_properties_decode returned" << result; return false; @@ -118,7 +118,7 @@ unsigned char props[1]; props[0] = properties[0]; - result = lzma_properties_decode(&d->filters[0], NULL, props, sizeof(props)); + result = lzma_properties_decode(&d->filters[0], NULL, props, sizeof (props)); if (result != LZMA_OK) { qWarning() << "lzma_properties_decode returned" << result; return false; @@ -129,10 +129,11 @@ d->filters[0].id = LZMA_FILTER_X86; d->filters[0].options = NULL; - unsigned char props[5] = {0x5d, 0x00, 0x00, 0x08, 0x00}; + unsigned char props[5] = { 0x5d, 0x00, 0x00, 0x08, 0x00 } + ; d->filters[1].id = LZMA_FILTER_LZMA1; d->filters[1].options = NULL; - result = lzma_properties_decode(&d->filters[1], NULL, props, sizeof(props)); + result = lzma_properties_decode(&d->filters[1], NULL, props, sizeof (props)); if (result != LZMA_OK) { qWarning() << "lzma_properties_decode1 returned" << result; return false; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kzip.cpp new/karchive-5.11.0/src/kzip.cpp --- old/karchive-5.10.0/src/kzip.cpp 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kzip.cpp 2015-06-06 11:22:22.000000000 +0200 @@ -82,7 +82,8 @@ // == parsing routines for zip headers /** all relevant information about parsing file information */ -struct ParseFileInfo { +struct ParseFileInfo +{ // file related info mode_t perm; // permissions of this file // TODO: use quint32 instead of a uint? @@ -100,8 +101,13 @@ bool newinfounix_seen; // true if Info-ZIP Unix New extra field has // been parsed - ParseFileInfo() : perm(0100644), uid(-1), gid(-1), extralen(0), - exttimestamp_seen(false), newinfounix_seen(false) + ParseFileInfo() + : perm(0100644) + , uid(-1) + , gid(-1) + , extralen(0) + , exttimestamp_seen(false) + , newinfounix_seen(false) { ctime = mtime = atime = time(0); } @@ -285,7 +291,8 @@ break; #endif default: - /* ignore everything else */; + /* ignore everything else */ + ; }/*end switch*/ buffer += fieldsize; @@ -305,7 +312,7 @@ * @param dev device that is read from * @return true if a local or central header begin is or could be reached */ -static bool handlePossibleHeaderBegin(const char* buffer, QIODevice *dev) +static bool handlePossibleHeaderBegin(const char *buffer, QIODevice *dev) { // we have to detect three magic tokens here: // PK34 for the next local header in case there is no data descriptor @@ -384,13 +391,14 @@ { public: KZipPrivate() - : m_crc(0), - m_currentFile(0), - m_currentDev(0), - m_compression(8), - m_extraField(KZip::NoExtraField), - m_offset(0) - {} + : m_crc(0) + , m_currentFile(0) + , m_currentDev(0) + , m_compression(8) + , m_extraField(KZip::NoExtraField) + , m_offset(0) + { + } unsigned long m_crc; // checksum KZipFileEntry *m_currentFile; // file currently being written @@ -406,12 +414,14 @@ }; KZip::KZip(const QString &fileName) - : KArchive(fileName), d(new KZipPrivate) + : KArchive(fileName) + , d(new KZipPrivate) { } KZip::KZip(QIODevice *dev) - : KArchive(dev), d(new KZipPrivate) + : KArchive(dev) + , d(new KZipPrivate) { } @@ -543,8 +553,8 @@ bool foundSignature = false; // check if this could be a symbolic link if (compression_mode == NoCompression - && uncomp_size <= max_path_len - && uncomp_size > 0) { + && uncomp_size <= max_path_len + && uncomp_size > 0) { // read content and store it // If it's not a symlink, then we'll just discard the data for now. pfi.guessed_symlink = dev->read(uncomp_size); @@ -583,7 +593,7 @@ return false; } - if (buffer[0] != 'P' || !handlePossibleHeaderBegin(buffer+1, dev)) { + if (buffer[0] != 'P' || !handlePossibleHeaderBegin(buffer + 1, dev)) { // assume data descriptor without signature dev->seek(dev->pos() + 8); // skip rest of the 'data_descriptor' } @@ -811,7 +821,7 @@ //write all central dir file entries // to be written at the end of the file... - char buffer[ 22 ]; // first used for 12, then for 22 at the end + char buffer[22]; // first used for 12, then for 22 at the end uLong crc = crc32(0L, Z_NULL, 0); qint64 centraldiroffset = device()->pos(); @@ -863,7 +873,7 @@ const int extra_field_len = (d->m_extraField == ModificationTime) ? 9 : 0; const int bufferSize = extra_field_len + path.length() + 46; - char *buffer = new char[ bufferSize ]; + char *buffer = new char[bufferSize]; memset(buffer, 0, 46); // zero is a nice default for most header fields @@ -875,45 +885,45 @@ // I do not know why memcpy is not working here //memcpy(buffer, head, sizeof(head)); - memmove(buffer, head, sizeof(head)); + memmove(buffer, head, sizeof (head)); - buffer[ 10 ] = char(it.value()->encoding()); // compression method - buffer[ 11 ] = char(it.value()->encoding() >> 8); + buffer[10] = char(it.value()->encoding()); // compression method + buffer[11] = char(it.value()->encoding() >> 8); - transformToMsDos(it.value()->date(), &buffer[ 12 ]); + transformToMsDos(it.value()->date(), &buffer[12]); uLong mycrc = it.value()->crc32(); - buffer[ 16 ] = char(mycrc); // crc checksum - buffer[ 17 ] = char(mycrc >> 8); - buffer[ 18 ] = char(mycrc >> 16); - buffer[ 19 ] = char(mycrc >> 24); + buffer[16] = char(mycrc); // crc checksum + buffer[17] = char(mycrc >> 8); + buffer[18] = char(mycrc >> 16); + buffer[19] = char(mycrc >> 24); int mysize1 = it.value()->compressedSize(); - buffer[ 20 ] = char(mysize1); // compressed file size - buffer[ 21 ] = char(mysize1 >> 8); - buffer[ 22 ] = char(mysize1 >> 16); - buffer[ 23 ] = char(mysize1 >> 24); + buffer[20] = char(mysize1); // compressed file size + buffer[21] = char(mysize1 >> 8); + buffer[22] = char(mysize1 >> 16); + buffer[23] = char(mysize1 >> 24); int mysize = it.value()->size(); - buffer[ 24 ] = char(mysize); // uncompressed file size - buffer[ 25 ] = char(mysize >> 8); - buffer[ 26 ] = char(mysize >> 16); - buffer[ 27 ] = char(mysize >> 24); + buffer[24] = char(mysize); // uncompressed file size + buffer[25] = char(mysize >> 8); + buffer[26] = char(mysize >> 16); + buffer[27] = char(mysize >> 24); - buffer[ 28 ] = char(path.length()); // fileName length - buffer[ 29 ] = char(path.length() >> 8); + buffer[28] = char(path.length()); // fileName length + buffer[29] = char(path.length() >> 8); - buffer[ 30 ] = char(extra_field_len); - buffer[ 31 ] = char(extra_field_len >> 8); + buffer[30] = char(extra_field_len); + buffer[31] = char(extra_field_len >> 8); - buffer[ 40 ] = char(it.value()->permissions()); - buffer[ 41 ] = char(it.value()->permissions() >> 8); + buffer[40] = char(it.value()->permissions()); + buffer[41] = char(it.value()->permissions() >> 8); int myhst = it.value()->headerStart(); - buffer[ 42 ] = char(myhst); //relative offset of local header - buffer[ 43 ] = char(myhst >> 8); - buffer[ 44 ] = char(myhst >> 16); - buffer[ 45 ] = char(myhst >> 24); + buffer[42] = char(myhst); //relative offset of local header + buffer[43] = char(myhst >> 8); + buffer[44] = char(myhst >> 16); + buffer[45] = char(myhst >> 24); // file name strncpy(buffer + 46, path.constData(), path.length()); @@ -949,42 +959,42 @@ //qDebug() << "closearchive: device()->pos(): " << device()->pos(); //write end of central dir record. - buffer[ 0 ] = 'P'; //end of central dir signature - buffer[ 1 ] = 'K'; - buffer[ 2 ] = 5; - buffer[ 3 ] = 6; + buffer[0] = 'P'; //end of central dir signature + buffer[1] = 'K'; + buffer[2] = 5; + buffer[3] = 6; - buffer[ 4 ] = 0; // number of this disk - buffer[ 5 ] = 0; + buffer[4] = 0; // number of this disk + buffer[5] = 0; - buffer[ 6 ] = 0; // number of disk with start of central dir - buffer[ 7 ] = 0; + buffer[6] = 0; // number of disk with start of central dir + buffer[7] = 0; int count = d->m_fileList.count(); //qDebug() << "number of files (count): " << count; - buffer[ 8 ] = char(count); // total number of entries in central dir of - buffer[ 9 ] = char(count >> 8); // this disk + buffer[8] = char(count); // total number of entries in central dir of + buffer[9] = char(count >> 8); // this disk - buffer[ 10 ] = buffer[ 8 ]; // total number of entries in the central dir - buffer[ 11 ] = buffer[ 9 ]; + buffer[10] = buffer[8]; // total number of entries in the central dir + buffer[11] = buffer[9]; int cdsize = centraldirendoffset - centraldiroffset; - buffer[ 12 ] = char(cdsize); // size of the central dir - buffer[ 13 ] = char(cdsize >> 8); - buffer[ 14 ] = char(cdsize >> 16); - buffer[ 15 ] = char(cdsize >> 24); + buffer[12] = char(cdsize); // size of the central dir + buffer[13] = char(cdsize >> 8); + buffer[14] = char(cdsize >> 16); + buffer[15] = char(cdsize >> 24); //qDebug() << "end : centraldiroffset: " << centraldiroffset; //qDebug() << "end : centraldirsize: " << cdsize; - buffer[ 16 ] = char(centraldiroffset); // central dir offset - buffer[ 17 ] = char(centraldiroffset >> 8); - buffer[ 18 ] = char(centraldiroffset >> 16); - buffer[ 19 ] = char(centraldiroffset >> 24); + buffer[16] = char(centraldiroffset); // central dir offset + buffer[17] = char(centraldiroffset >> 8); + buffer[18] = char(centraldiroffset >> 16); + buffer[19] = char(centraldiroffset >> 24); - buffer[ 20 ] = 0; //zipfile comment length - buffer[ 21 ] = 0; + buffer[20] = 0; //zipfile comment length + buffer[21] = 0; if (device()->write(buffer, 22) != 22) { return false; @@ -1086,44 +1096,44 @@ QByteArray encodedName = QFile::encodeName(name); int bufferSize = extra_field_len + encodedName.length() + 30; //qDebug() << "bufferSize=" << bufferSize; - char *buffer = new char[ bufferSize ]; + char *buffer = new char[bufferSize]; - buffer[ 0 ] = 'P'; //local file header signature - buffer[ 1 ] = 'K'; - buffer[ 2 ] = 3; - buffer[ 3 ] = 4; + buffer[0] = 'P'; //local file header signature + buffer[1] = 'K'; + buffer[2] = 3; + buffer[3] = 4; - buffer[ 4 ] = 0x14; // version needed to extract - buffer[ 5 ] = 0; + buffer[4] = 0x14; // version needed to extract + buffer[5] = 0; - buffer[ 6 ] = 0; // general purpose bit flag - buffer[ 7 ] = 0; + buffer[6] = 0; // general purpose bit flag + buffer[7] = 0; - buffer[ 8 ] = char(e->encoding()); // compression method - buffer[ 9 ] = char(e->encoding() >> 8); + buffer[8] = char(e->encoding()); // compression method + buffer[9] = char(e->encoding() >> 8); - transformToMsDos(e->date(), &buffer[ 10 ]); + transformToMsDos(e->date(), &buffer[10]); - buffer[ 14 ] = 'C'; //dummy crc - buffer[ 15 ] = 'R'; - buffer[ 16 ] = 'C'; - buffer[ 17 ] = 'q'; + buffer[14] = 'C'; //dummy crc + buffer[15] = 'R'; + buffer[16] = 'C'; + buffer[17] = 'q'; - buffer[ 18 ] = 'C'; //compressed file size - buffer[ 19 ] = 'S'; - buffer[ 20 ] = 'I'; - buffer[ 21 ] = 'Z'; + buffer[18] = 'C'; //compressed file size + buffer[19] = 'S'; + buffer[20] = 'I'; + buffer[21] = 'Z'; - buffer[ 22 ] = 'U'; //uncompressed file size - buffer[ 23 ] = 'S'; - buffer[ 24 ] = 'I'; - buffer[ 25 ] = 'Z'; + buffer[22] = 'U'; //uncompressed file size + buffer[23] = 'S'; + buffer[24] = 'I'; + buffer[25] = 'Z'; - buffer[ 26 ] = (uchar)(encodedName.length()); //fileName length - buffer[ 27 ] = (uchar)(encodedName.length() >> 8); + buffer[26] = (uchar)(encodedName.length()); //fileName length + buffer[27] = (uchar)(encodedName.length() >> 8); - buffer[ 28 ] = (uchar)(extra_field_len); // extra field length - buffer[ 29 ] = (uchar)(extra_field_len >> 8); + buffer[28] = (uchar)(extra_field_len); // extra field length + buffer[29] = (uchar)(extra_field_len >> 8); // file name strncpy(buffer + 30, encodedName.constData(), encodedName.length()); @@ -1304,11 +1314,12 @@ { public: KZipFileEntryPrivate() - : crc(0), - compressedSize(0), - headerStart(0), - encoding(0) - {} + : crc(0) + , compressedSize(0) + , headerStart(0) + , encoding(0) + { + } unsigned long crc; qint64 compressedSize; qint64 headerStart; @@ -1320,8 +1331,8 @@ const QString &user, const QString &group, const QString &symlink, const QString &path, qint64 start, qint64 uncompressedSize, int encoding, qint64 compressedSize) - : KArchiveFile(zip, name, access, date, user, group, symlink, start, uncompressedSize), - d(new KZipFileEntryPrivate) + : KArchiveFile(zip, name, access, date, user, group, symlink, start, uncompressedSize) + , d(new KZipFileEntryPrivate) { d->path = path; d->encoding = encoding; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.10.0/src/kzip.h new/karchive-5.11.0/src/kzip.h --- old/karchive-5.10.0/src/kzip.h 2015-05-01 17:10:29.000000000 +0200 +++ new/karchive-5.11.0/src/kzip.h 2015-06-06 11:22:22.000000000 +0200 @@ -73,10 +73,11 @@ /** * Describes the contents of the "extra field" for a given file in the Zip archive. */ - enum ExtraField { NoExtraField = 0, ///< No extra field - ModificationTime = 1, ///< Modification time ("extended timestamp" header) - DefaultExtraField = 1 - }; + enum ExtraField { + NoExtraField = 0, ///< No extra field + ModificationTime = 1, ///< Modification time ("extended timestamp" header) + DefaultExtraField = 1 // alias of ModificationTime + }; /** * Call this before writeFile or prepareWriting, to define what the next @@ -96,9 +97,10 @@ /** * Describes the compression type for a given file in the Zip archive. */ - enum Compression { NoCompression = 0, ///< Uncompressed. - DeflateCompression = 1 ///< Deflate compression method. - }; + enum Compression { + NoCompression = 0, ///< Uncompressed. + DeflateCompression = 1 ///< Deflate compression method. + }; /** * Call this before writeFile or prepareWriting, to define whether the next
