Hello community, here is the log from the commit of package karchive for openSUSE:Factory checked in at 2014-10-07 15:59:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2014-09-12 17:04:40.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.karchive.new/karchive.changes 2014-10-07 16:00:12.000000000 +0200 @@ -1,0 +2,9 @@ +Sat Oct 4 17:59:51 UTC 2014 - hrvoje.senjan@gmail.com + +- Update to 5.3.0 + * Add convenience method KArchive::file() + * Compilation fixes for MSVC + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.3.0.php + +------------------------------------------------------------------- Old: ---- karchive-5.2.0.tar.xz New: ---- karchive-5.3.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ karchive.spec ++++++ --- /var/tmp/diff_new_pack.GsNT4w/_old 2014-10-07 16:00:13.000000000 +0200 +++ /var/tmp/diff_new_pack.GsNT4w/_new 2014-10-07 16:00:13.000000000 +0200 @@ -18,10 +18,10 @@ %define lname libKF5Archive5 Name: karchive -Version: 5.2.0 +Version: 5.3.0 Release: 0 BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 1.2.0 +BuildRequires: extra-cmake-modules >= 1.3.0 BuildRequires: fdupes BuildRequires: kf5-filesystem BuildRequires: pkgconfig(Qt5Core) >= 5.2.0 ++++++ karchive-5.2.0.tar.xz -> karchive-5.3.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.2.0/CMakeLists.txt new/karchive-5.3.0/CMakeLists.txt --- old/karchive-5.2.0/CMakeLists.txt 2014-09-08 01:23:20.000000000 +0200 +++ new/karchive-5.3.0/CMakeLists.txt 2014-10-03 19:53:24.000000000 +0200 @@ -2,7 +2,7 @@ project(KArchive) -find_package(ECM 1.2.0 REQUIRED NO_MODULE) +find_package(ECM 1.3.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) @@ -45,7 +45,7 @@ include(ECMSetupVersion) include(ECMGenerateHeaders) -set(KF5_VERSION "5.2.0") # handled by release scripts +set(KF5_VERSION "5.3.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.2.0/autotests/karchivetest.cpp new/karchive-5.3.0/autotests/karchivetest.cpp --- old/karchive-5.2.0/autotests/karchivetest.cpp 2014-09-08 01:23:20.000000000 +0200 +++ new/karchive-5.3.0/autotests/karchivetest.cpp 2014-10-03 19:53:24.000000000 +0200 @@ -168,10 +168,7 @@ { const KArchiveDirectory *dir = archive->directory(); - const KArchiveEntry *e = dir->entry("z/test3"); - QVERIFY(e); - QVERIFY(e->isFile()); - const KArchiveFile *f = static_cast<const KArchiveFile *>(e); + const KArchiveFile *f = dir->file("z/test3"); QByteArray arr(f->data()); QCOMPARE(arr.size(), 13); QCOMPARE(arr, QByteArray("Noch so einer")); @@ -190,18 +187,17 @@ QCOMPARE(QString::fromLatin1(contents.constData()), QString::fromLatin1(arr.constData())); delete dev; - e = dir->entry("mediumfile"); + const KArchiveEntry *e = dir->entry("mediumfile"); QVERIFY(e && e->isFile()); f = (KArchiveFile *)e; QCOMPARE(f->data().size(), SIZE1); - e = dir->entry("hugefile"); - QVERIFY(e && e->isFile()); - f = (KArchiveFile *)e; + f = dir->file("hugefile"); QCOMPARE(f->data().size(), 20000); e = dir->entry("aaaemptydir"); QVERIFY(e && e->isDirectory()); + QVERIFY(!dir->file("aaaemptydir")); e = dir->entry("my/dir/test3"); QVERIFY(e && e->isFile()); @@ -785,6 +781,9 @@ // Otherwise we just lose data. KZip zip(QDir::currentPath()); +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) // 523440a15f in QSaveFile makes it fail for existing directories, as one would expect. + QVERIFY(!zip.open(QIODevice::WriteOnly)); +#else QVERIFY(zip.open(QIODevice::WriteOnly)); writeTestFilesToArchive(&zip); @@ -793,6 +792,7 @@ QVERIFY(!zip.addLocalFile(QDir::currentPath(), "bogusdir")); QVERIFY(!zip.close()); +#endif } void KArchiveTest::testReadZipError() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.2.0/src/k7zip.cpp new/karchive-5.3.0/src/k7zip.cpp --- old/karchive-5.2.0/src/k7zip.cpp 2014-09-08 01:23:20.000000000 +0200 +++ new/karchive-5.3.0/src/k7zip.cpp 2014-10-03 19:53:24.000000000 +0200 @@ -31,6 +31,7 @@ #include "klimitediodevice_p.h" #include <time.h> // time() +#include <memory> #include "zlib.h" #ifndef QT_STAT_LNK @@ -43,8 +44,8 @@ #define BUFFER_SIZE 8*1024 -unsigned char k7zip_signature[6] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C}; -unsigned char XZ_HEADER_MAGIC[6] = { 0xFD, '7', 'z', 'X', 'Z', 0x00 }; +static const unsigned char k7zip_signature[6] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C}; +static const unsigned char XZ_HEADER_MAGIC[6] = { 0xFD, '7', 'z', 'X', 'Z', 0x00 }; #define GetUi16(p, offset) (((unsigned char)p[offset+0]) | (((unsigned char)p[1]) << 8)) @@ -724,7 +725,7 @@ return 0; } Folder::FolderInfo *info = new Folder::FolderInfo(); - unsigned char codecID[codecIdSize]; + std::unique_ptr<unsigned char[]> codecID(new unsigned char[codecIdSize]); for (int i = 0; i < codecIdSize; ++i) { codecID[i] = readByte(); } @@ -1505,15 +1506,15 @@ QVector<QByteArray> datas; for (int j = 0; j < (int)mainCoder->numInStreams; j++) { int size = packSizes[j + i]; - char encodedBuffer[size]; + std::unique_ptr<char[]> encodedBuffer(new char[size]); QIODevice *dev = q->device(); dev->seek(startPos); - quint64 n = dev->read(encodedBuffer, size); + quint64 n = dev->read(encodedBuffer.get(), size); if (n != (quint64)size) { qDebug() << "Failed read next size, should read " << size << ", read " << n; return inflatedData; } - QByteArray deflatedData(encodedBuffer, size); + QByteArray deflatedData(encodedBuffer.get(), size); datas.append(deflatedData); startPos += size; pos += size; @@ -1661,7 +1662,6 @@ ///////////////// Write //////////////////// -static int sizeItems = 0; void K7Zip::K7ZipPrivate::createItemsFromEntities(const KArchiveDirectory *dir, const QString &path, QByteArray &data) { QStringList l = dir->entries(); @@ -1682,7 +1682,6 @@ fileInfo->attributes = FILE_ATTRIBUTE_ARCHIVE; fileInfo->attributes |= FILE_ATTRIBUTE_UNIX_EXTENSION + ((entry->permissions() & 0xFFFF) << 16); fileInfo->size = fileEntry->size(); - sizeItems += fileInfo->size; QString symLink = fileEntry->symLinkTarget(); if (fileInfo->size > 0) { fileInfo->hasStream = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.2.0/src/karchive.cpp new/karchive-5.3.0/src/karchive.cpp --- old/karchive-5.2.0/src/karchive.cpp 2014-09-08 01:23:20.000000000 +0200 +++ new/karchive-5.3.0/src/karchive.cpp 2014-10-03 19:53:24.000000000 +0200 @@ -766,6 +766,15 @@ return d->entries.value(name); } +const KArchiveFile *KArchiveDirectory::file(const QString &name) const +{ + const KArchiveEntry *e = entry(name); + if (e && e->isFile()) { + return static_cast<const KArchiveFile *>(e); + } + return 0; +} + void KArchiveDirectory::addEntry(KArchiveEntry *entry) { if (entry->name().isEmpty()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/karchive-5.2.0/src/karchivedirectory.h new/karchive-5.3.0/src/karchivedirectory.h --- old/karchive-5.2.0/src/karchivedirectory.h 2014-09-08 01:23:20.000000000 +0200 +++ new/karchive-5.3.0/src/karchivedirectory.h 2014-10-03 19:53:24.000000000 +0200 @@ -31,6 +31,7 @@ #include <karchiveentry.h> class KArchiveDirectoryPrivate; +class KArchiveFile; /** * Represents a directory entry in a KArchive. * @short A directory in an archive. @@ -65,14 +66,28 @@ * @return the names of all entries in this directory (filenames, no path). */ QStringList entries() const; + /** - * Returns the entry with the given name. + * Returns the entry in the archive with the given name. + * The entry could be a file or a directory, use isFile() to find out which one it is. * @param name may be "test1", "mydir/test3", "mydir/mysubdir/test3", etc. - * @return a pointer to the entry in the directory. + * @return a pointer to the entry in the directory, or a null pointer if there is no such entry. */ const KArchiveEntry *entry(const QString &name) const; /** + * Returns the file entry in the archive with the given name. + * If the entry exists and is a file, a KArchiveFile is returned. + * Otherwise, a null pointer is returned. + * This is a convenience method for entry(), when we know the entry is expected to be a file. + * + * @param name may be "test1", "mydir/test3", "mydir/mysubdir/test3", etc. + * @return a pointer to the file entry in the directory, or a null pointer if there is no such file entry. + * @since 5.3 + */ + const KArchiveFile *file(const QString &name) const; + + /** * @internal * Adds a new entry to the directory. */ -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org