From owner-svn-ports-head@freebsd.org Fri Mar 8 21:18:44 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C03415295AA; Fri, 8 Mar 2019 21:18:44 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABA178C84A; Fri, 8 Mar 2019 21:18:43 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82918D20; Fri, 8 Mar 2019 21:18:43 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x28LIhm1032949; Fri, 8 Mar 2019 21:18:43 GMT (envelope-from tcberner@FreeBSD.org) Received: (from tcberner@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x28LIhbt032947; Fri, 8 Mar 2019 21:18:43 GMT (envelope-from tcberner@FreeBSD.org) Message-Id: <201903082118.x28LIhbt032947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tcberner set sender to tcberner@FreeBSD.org using -f From: "Tobias C. Berner" Date: Fri, 8 Mar 2019 21:18:43 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r495075 - in head/graphics/gwenview: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tcberner X-SVN-Commit-Paths: in head/graphics/gwenview: . files X-SVN-Commit-Revision: 495075 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABA178C84A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2019 21:18:44 -0000 Author: tcberner Date: Fri Mar 8 21:18:42 2019 New Revision: 495075 URL: https://svnweb.freebsd.org/changeset/ports/495075 Log: graphics/gwenview: prepare for exiv2-0.27 Import upstreams patch from: https://github.com/KDE/gwenview/commit/61543b42289fc986e580f2e3443719f3334f17b5.patch Added: head/graphics/gwenview/files/ head/graphics/gwenview/files/patch-git_61543b (contents, props changed) Modified: head/graphics/gwenview/Makefile Modified: head/graphics/gwenview/Makefile ============================================================================== --- head/graphics/gwenview/Makefile Fri Mar 8 21:16:20 2019 (r495074) +++ head/graphics/gwenview/Makefile Fri Mar 8 21:18:42 2019 (r495075) @@ -2,6 +2,7 @@ PORTNAME= gwenview DISTVERSION= ${KDE_APPLICATIONS_VERSION} +PORTREVISION= 1 CATEGORIES= graphics kde kde-applications MAINTAINER= kde@FreeBSD.org Added: head/graphics/gwenview/files/patch-git_61543b ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/gwenview/files/patch-git_61543b Fri Mar 8 21:18:42 2019 (r495075) @@ -0,0 +1,474 @@ +From 61543b42289fc986e580f2e3443719f3334f17b5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Sun, 30 Dec 2018 02:46:28 +0100 +Subject: [PATCH] Use forward declaration for Exiv2::Image, port to + std::unique_ptr + +Summary: +Instead of the Exiv2::Image::AutoPtr typedef just use a forward declaration +for Exiv2::Image, and use std::unique_ptr instead of std::auto_ptr. + +The forward declaration avoids pulling in Exiv2 declarations everywhere, +e.g. via document.h. + +Although it would be possible to use std::auto_ptr, unique_ptr is +preferable for two reasons: +- ownership transfer is explicit (std::move, release()/reset()) +- Exiv2 0.28 will use std::unique_ptr as well, i.e. the code is forward +compatible. + +Reviewers: #gwenview, cfeck, ngraham + +Reviewed By: #gwenview, ngraham + +Subscribers: lbeltrame, ngraham, asturmlechner, shubham + +Tags: #gwenview + +Differential Revision: https://phabricator.kde.org/D17872 +--- + lib/cms/cmsprofile.cpp | 3 +++ + lib/cms/cmsprofile.h | 8 +++++--- + lib/document/abstractdocumentimpl.cpp | 5 +++-- + lib/document/abstractdocumentimpl.h | 7 ++++++- + lib/document/document.cpp | 7 +++++-- + lib/document/document.h | 11 ++++++++--- + lib/document/document_p.h | 10 +++++++++- + lib/document/loadingdocumentimpl.cpp | 7 +++++-- + lib/exiv2imageloader.cpp | 13 ++++++------- + lib/exiv2imageloader.h | 11 ++++++++--- + lib/jpegcontent.cpp | 10 +++++----- + lib/timeutils.cpp | 8 +++++--- + tests/auto/cmsprofiletest.cpp | 4 ++-- + tests/auto/imagemetainfomodeltest.cpp | 9 +++++++-- + 14 files changed, 77 insertions(+), 36 deletions(-) + +diff --git a/lib/cms/cmsprofile.cpp b/lib/cms/cmsprofile.cpp +index 188b90a4..7d2b753e 100644 +--- lib/cms/cmsprofile.cpp ++++ lib/cms/cmsprofile.cpp +@@ -42,6 +42,9 @@ extern "C" { + // lcms + #include + ++// Exiv2 ++#include ++ + // X11 + #ifdef HAVE_X11 + #include +diff --git a/lib/cms/cmsprofile.h b/lib/cms/cmsprofile.h +index a2a38a87..06c7672d 100644 +--- lib/cms/cmsprofile.h ++++ lib/cms/cmsprofile.h +@@ -29,12 +29,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA + #include + #include + +-// Exiv2 +-#include +- + class QByteArray; + class QString; + ++namespace Exiv2 ++{ ++ class Image; ++} ++ + typedef void* cmsHPROFILE; + + namespace Gwenview +diff --git a/lib/document/abstractdocumentimpl.cpp b/lib/document/abstractdocumentimpl.cpp +index d841ae5f..d3d0002c 100644 +--- lib/document/abstractdocumentimpl.cpp ++++ lib/document/abstractdocumentimpl.cpp +@@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + // Self + #include "abstractdocumentimpl.h" + ++#include + // Qt + + // KDE +@@ -77,9 +78,9 @@ void AbstractDocumentImpl::setDocumentKind(MimeTypeUtils::Kind kind) + d->mDocument->setKind(kind); + } + +-void AbstractDocumentImpl::setDocumentExiv2Image(Exiv2::Image::AutoPtr image) ++void AbstractDocumentImpl::setDocumentExiv2Image(std::unique_ptr image) + { +- d->mDocument->setExiv2Image(image); ++ d->mDocument->setExiv2Image(std::move(image)); + } + + void AbstractDocumentImpl::setDocumentDownSampledImage(const QImage& image, int invertedZoom) +diff --git a/lib/document/abstractdocumentimpl.h b/lib/document/abstractdocumentimpl.h +index 1f427e60..86e6bfd2 100644 +--- lib/document/abstractdocumentimpl.h ++++ lib/document/abstractdocumentimpl.h +@@ -34,6 +34,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + class QImage; + class QRect; + ++namespace Exiv2 ++{ ++ class Image; ++} ++ + namespace Gwenview + { + +@@ -108,7 +113,7 @@ class AbstractDocumentImpl : public QObject + void setDocumentImageSize(const QSize& size); + void setDocumentKind(MimeTypeUtils::Kind); + void setDocumentFormat(const QByteArray& format); +- void setDocumentExiv2Image(Exiv2::Image::AutoPtr); ++ void setDocumentExiv2Image(std::unique_ptr); + void setDocumentDownSampledImage(const QImage&, int invertedZoom); + void setDocumentCmsProfile(Cms::Profile::Ptr profile); + void setDocumentErrorString(const QString&); +diff --git a/lib/document/document.cpp b/lib/document/document.cpp +index 18756700..afa9ed03 100644 +--- lib/document/document.cpp ++++ lib/document/document.cpp +@@ -31,6 +31,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + #include + #include + ++// Exiv2 ++#include ++ + // Local + #include "documentjob.h" + #include "emptydocumentimpl.h" +@@ -388,9 +391,9 @@ AbstractDocumentEditor* Document::editor() + return d->mImpl->editor(); + } + +-void Document::setExiv2Image(Exiv2::Image::AutoPtr image) ++void Document::setExiv2Image(std::unique_ptr image) + { +- d->mExiv2Image = image; ++ d->mExiv2Image = std::move(image); + d->mImageMetaInfoModel.setExiv2Image(d->mExiv2Image.get()); + emit metaInfoUpdated(); + } +diff --git a/lib/document/document.h b/lib/document/document.h +index c0bb454b..4b40a6e1 100644 +--- lib/document/document.h ++++ lib/document/document.h +@@ -22,8 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + #include + +-#include +-#include ++// STL ++#include + + // Qt + #include +@@ -43,6 +43,11 @@ class QUndoStack; + class KJob; + class QUrl; + ++namespace Exiv2 ++{ ++ class Image; ++} ++ + namespace Gwenview + { + +@@ -235,7 +240,7 @@ private Q_SLOTS: + void setKind(MimeTypeUtils::Kind); + void setFormat(const QByteArray&); + void setSize(const QSize&); +- void setExiv2Image(Exiv2::Image::AutoPtr); ++ void setExiv2Image(std::unique_ptr); + void setDownSampledImage(const QImage&, int invertedZoom); + void switchToImpl(AbstractDocumentImpl* impl); + void setErrorString(const QString&); +diff --git a/lib/document/document_p.h b/lib/document/document_p.h +index 78e0ac6e..4de25f15 100644 +--- lib/document/document_p.h ++++ lib/document/document_p.h +@@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA + #ifndef DOCUMENT_P_H + #define DOCUMENT_P_H + ++// STL ++#include ++ + // Local + #include + #include +@@ -34,6 +37,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA + #include + #include + ++namespace Exiv2 ++{ ++ class Image; ++} ++ + namespace Gwenview + { + +@@ -54,7 +62,7 @@ struct DocumentPrivate + QSize mSize; + QImage mImage; + QMap mDownSampledImageMap; +- Exiv2::Image::AutoPtr mExiv2Image; ++ std::unique_ptr mExiv2Image; + MimeTypeUtils::Kind mKind; + QByteArray mFormat; + ImageMetaInfoModel mImageMetaInfoModel; +diff --git a/lib/document/loadingdocumentimpl.cpp b/lib/document/loadingdocumentimpl.cpp +index 07675783..766a1831 100644 +--- lib/document/loadingdocumentimpl.cpp ++++ lib/document/loadingdocumentimpl.cpp +@@ -24,6 +24,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + // STL + #include + ++// Exiv2 ++#include ++ + // Qt + #include + #include +@@ -100,7 +103,7 @@ struct LoadingDocumentImplPrivate + QByteArray mData; + QByteArray mFormat; + QSize mImageSize; +- Exiv2::Image::AutoPtr mExiv2Image; ++ std::unique_ptr mExiv2Image; + std::unique_ptr mJpegContent; + QImage mImage; + Cms::Profile::Ptr mCmsProfile; +@@ -486,7 +489,7 @@ void LoadingDocumentImpl::slotMetaInfoLoaded() + + setDocumentFormat(d->mFormat); + setDocumentImageSize(d->mImageSize); +- setDocumentExiv2Image(d->mExiv2Image); ++ setDocumentExiv2Image(std::move(d->mExiv2Image)); + setDocumentCmsProfile(d->mCmsProfile); + + d->mMetaInfoLoaded = true; +diff --git a/lib/exiv2imageloader.cpp b/lib/exiv2imageloader.cpp +index f2830f81..f13dff7a 100644 +--- lib/exiv2imageloader.cpp ++++ lib/exiv2imageloader.cpp +@@ -29,8 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + // KDE + + // Exiv2 +-#include +-#include ++#include + + // Local + +@@ -39,7 +38,7 @@ namespace Gwenview + + struct Exiv2ImageLoaderPrivate + { +- Exiv2::Image::AutoPtr mImage; ++ std::unique_ptr mImage; + QString mErrorMessage; + }; + +@@ -57,7 +56,7 @@ bool Exiv2ImageLoader::load(const QString& filePath) + { + QByteArray filePathByteArray = QFile::encodeName(filePath); + try { +- d->mImage = Exiv2::ImageFactory::open(filePathByteArray.constData()); ++ d->mImage.reset(Exiv2::ImageFactory::open(filePathByteArray.constData()).release()); + d->mImage->readMetadata(); + } catch (const Exiv2::Error& error) { + d->mErrorMessage = QString::fromUtf8(error.what()); +@@ -69,7 +68,7 @@ bool Exiv2ImageLoader::load(const QString& filePath) + bool Exiv2ImageLoader::load(const QByteArray& data) + { + try { +- d->mImage = Exiv2::ImageFactory::open((unsigned char*)data.constData(), data.size()); ++ d->mImage.reset(Exiv2::ImageFactory::open((unsigned char*)data.constData(), data.size()).release()); + d->mImage->readMetadata(); + } catch (const Exiv2::Error& error) { + d->mErrorMessage = QString::fromUtf8(error.what()); +@@ -83,9 +82,9 @@ QString Exiv2ImageLoader::errorMessage() const + return d->mErrorMessage; + } + +-Exiv2::Image::AutoPtr Exiv2ImageLoader::popImage() ++std::unique_ptr Exiv2ImageLoader::popImage() + { +- return d->mImage; ++ return std::move(d->mImage); + } + + } // namespace +diff --git a/lib/exiv2imageloader.h b/lib/exiv2imageloader.h +index 57ef24d2..12a45b68 100644 +--- lib/exiv2imageloader.h ++++ lib/exiv2imageloader.h +@@ -23,13 +23,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + #include + ++// STL ++#include ++ + // Qt + + // KDE + + // Exiv2 +-#include +-#include ++namespace Exiv2 ++{ ++ class Image; ++} + + // Local + +@@ -54,7 +59,7 @@ class GWENVIEWLIB_EXPORT Exiv2ImageLoader + bool load(const QString&); + bool load(const QByteArray&); + QString errorMessage() const; +- Exiv2::Image::AutoPtr popImage(); ++ std::unique_ptr popImage(); + + private: + Exiv2ImageLoaderPrivate* const d; +diff --git a/lib/jpegcontent.cpp b/lib/jpegcontent.cpp +index bb810dd4..a8cf909f 100644 +--- lib/jpegcontent.cpp ++++ lib/jpegcontent.cpp +@@ -42,8 +42,7 @@ extern "C" { + #include + + // Exiv2 +-#include +-#include ++#include + + // Local + #include "jpegerrormanager.h" +@@ -216,12 +215,12 @@ bool JpegContent::load(const QString& path) + + bool JpegContent::loadFromData(const QByteArray& data) + { +- Exiv2::Image::AutoPtr image; ++ std::unique_ptr image; + Exiv2ImageLoader loader; + if (!loader.load(data)) { + qCritical() << "Could not load image with Exiv2, reported error:" << loader.errorMessage(); + } +- image = loader.popImage(); ++ image.reset(loader.popImage().release()); + + return loadFromData(data, image.get()); + } +@@ -603,7 +602,8 @@ bool JpegContent::save(QIODevice* device) + d->mPendingTransformation = false; + } + +- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((unsigned char*)d->mRawData.data(), d->mRawData.size()); ++ std::unique_ptr image; ++ image.reset(Exiv2::ImageFactory::open((unsigned char*)d->mRawData.data(), d->mRawData.size()).release()); + + // Store Exif info + image->setExifData(d->mExifData); +diff --git a/lib/timeutils.cpp b/lib/timeutils.cpp +index 9e8836a9..3c519098 100644 +--- lib/timeutils.cpp ++++ lib/timeutils.cpp +@@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA + // Self + #include "timeutils.h" + ++// STL ++#include ++ + // Qt + #include + #include +@@ -30,8 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA + #include + + // Exiv2 +-#include +-#include ++#include + + // Local + #include +@@ -92,7 +94,7 @@ struct CacheItem + if (!loader.load(path)) { + return false; + } +- Exiv2::Image::AutoPtr img = loader.popImage(); ++ std::unique_ptr img(loader.popImage().release()); + try { + Exiv2::ExifData exifData = img->exifData(); + if (exifData.empty()) { +diff --git a/tests/auto/cmsprofiletest.cpp b/tests/auto/cmsprofiletest.cpp +index 4efc441b..f4c7f9e5 100644 +--- tests/auto/cmsprofiletest.cpp ++++ tests/auto/cmsprofiletest.cpp +@@ -69,7 +69,7 @@ void CmsProfileTest::testLoadFromImageData_data() + void CmsProfileTest::testLoadFromExiv2Image() + { + QFETCH(QString, fileName); +- Exiv2::Image::AutoPtr image; ++ std::unique_ptr image; + { + QByteArray data; + QString path = pathForTestFile(fileName); +@@ -80,7 +80,7 @@ void CmsProfileTest::testLoadFromExiv2Image() + + Exiv2ImageLoader loader; + QVERIFY(loader.load(data)); +- image = loader.popImage(); ++ image.reset(loader.popImage().release()); + } + Cms::Profile::Ptr ptr = Cms::Profile::loadFromExiv2Image(image.get()); + QVERIFY(!ptr.isNull()); +diff --git a/tests/auto/imagemetainfomodeltest.cpp b/tests/auto/imagemetainfomodeltest.cpp +index e3ec8d30..5a286b00 100644 +--- tests/auto/imagemetainfomodeltest.cpp ++++ tests/auto/imagemetainfomodeltest.cpp +@@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + */ ++ ++// STL ++#include ++ + // Qt + + // KDE +@@ -28,7 +32,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + #include "../lib/imagemetainfomodel.h" + #include "testutils.h" + +-#include ++// Exiv2 ++#include + + #include "imagemetainfomodeltest.h" + +@@ -46,7 +51,7 @@ void ImageMetaInfoModelTest::testCatchExiv2Errors() + data = file.readAll(); + } + +- Exiv2::Image::AutoPtr image; ++ std::unique_ptr image; + { + Exiv2ImageLoader loader; + QVERIFY(loader.load(data));