From e96cea51da99629b33036e4b06738316a7ca4682 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Fri, 5 Jul 2019 17:12:18 +0200 Subject: Fix compilation with disabled deprecated APIs The QImageIOHandler::name() has been deprecated since 5.13, but its overrides weren't. Enabled compilation of the overrides only when the QImageIOHandler::name() is compiled. Task-number: QTBUG-76491 Change-Id: I8fea0032427d25bb0de01be8920c723fc21f6b7a Reviewed-by: Volker Hilsheimer Reviewed-by: Alex Blasche --- src/plugins/imageformats/gif/qgifhandler.cpp | 2 ++ src/plugins/imageformats/gif/qgifhandler_p.h | 2 ++ src/plugins/imageformats/ico/qicohandler.cpp | 3 ++- src/plugins/imageformats/ico/qicohandler.h | 2 ++ src/plugins/imageformats/jpeg/qjpeghandler.cpp | 2 ++ src/plugins/imageformats/jpeg/qjpeghandler_p.h | 2 ++ 6 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/plugins/imageformats') diff --git a/src/plugins/imageformats/gif/qgifhandler.cpp b/src/plugins/imageformats/gif/qgifhandler.cpp index 1aef1a24d2..a6029b691c 100644 --- a/src/plugins/imageformats/gif/qgifhandler.cpp +++ b/src/plugins/imageformats/gif/qgifhandler.cpp @@ -1215,9 +1215,11 @@ int QGifHandler::currentImageNumber() const return frameNumber; } +#if QT_DEPRECATED_SINCE(5, 13) QByteArray QGifHandler::name() const { return "gif"; } +#endif QT_END_NAMESPACE diff --git a/src/plugins/imageformats/gif/qgifhandler_p.h b/src/plugins/imageformats/gif/qgifhandler_p.h index b004ee610d..c6592043ce 100644 --- a/src/plugins/imageformats/gif/qgifhandler_p.h +++ b/src/plugins/imageformats/gif/qgifhandler_p.h @@ -73,7 +73,9 @@ public: bool read(QImage *image) override; bool write(const QImage &image) override; +#if QT_DEPRECATED_SINCE(5, 13) QByteArray name() const override; +#endif static bool canRead(QIODevice *device); diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp index 4908850cc5..c8e31dceac 100644 --- a/src/plugins/imageformats/ico/qicohandler.cpp +++ b/src/plugins/imageformats/ico/qicohandler.cpp @@ -818,6 +818,7 @@ bool QtIcoHandler::write(const QImage &image) return ICOReader::write(device, imgs); } +#if QT_DEPRECATED_SINCE(5, 13) /*! * Return the common identifier of the format. * For ICO format this will return "ico". @@ -826,7 +827,7 @@ QByteArray QtIcoHandler::name() const { return "ico"; } - +#endif /*! \reimp diff --git a/src/plugins/imageformats/ico/qicohandler.h b/src/plugins/imageformats/ico/qicohandler.h index 435f036113..328dfce47e 100644 --- a/src/plugins/imageformats/ico/qicohandler.h +++ b/src/plugins/imageformats/ico/qicohandler.h @@ -54,7 +54,9 @@ public: bool read(QImage *image) override; bool write(const QImage &image) override; +#if QT_DEPRECATED_SINCE(5, 13) QByteArray name() const override; +#endif int imageCount() const override; bool jumpToImage(int imageNumber) override; diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 54fe857908..aed2900356 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -1124,9 +1124,11 @@ void QJpegHandler::setOption(ImageOption option, const QVariant &value) } } +#if QT_DEPRECATED_SINCE(5, 13) QByteArray QJpegHandler::name() const { return "jpeg"; } +#endif QT_END_NAMESPACE diff --git a/src/plugins/imageformats/jpeg/qjpeghandler_p.h b/src/plugins/imageformats/jpeg/qjpeghandler_p.h index d832bf82f3..fafa930c11 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler_p.h +++ b/src/plugins/imageformats/jpeg/qjpeghandler_p.h @@ -68,7 +68,9 @@ public: bool read(QImage *image) override; bool write(const QImage &image) override; +#if QT_DEPRECATED_SINCE(5, 13) QByteArray name() const override; +#endif static bool canRead(QIODevice *device); -- cgit v1.2.3