summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-24 18:37:11 (GMT)
committerLiang Qi <liang.qi@qt.io>2016-11-24 18:37:11 (GMT)
commit410b6b529cc6ee9236ee29fcdff4a03ad8670fe9 (patch)
treed75f2ff444e4b174938a3e073f47c6d1d7c60cc7
parent83fe59a86cceb94695ac85211b4ededb08bc5949 (diff)
parent4704ecbf79053f2e1cde3c869b03c769be6ef207 (diff)
downloadqtsvg-410b6b529cc6ee9236ee29fcdff4a03ad8670fe9.tar.gz
Merge remote-tracking branch 'origin/5.6' into 5.75.7
Change-Id: Ibcca419da389fc7538ee050de7c59e8b400e1978
-rw-r--r--src/plugins/iconengines/svgiconengine/main.cpp4
-rw-r--r--src/plugins/iconengines/svgiconengine/qsvgiconengine-nocompress.json3
-rw-r--r--src/plugins/iconengines/svgiconengine/svgiconengine.pro1
-rw-r--r--src/plugins/imageformats/svg/main.cpp8
-rw-r--r--src/plugins/imageformats/svg/qsvgiohandler.cpp13
-rw-r--r--src/plugins/imageformats/svg/svg-nocompress.json4
-rw-r--r--src/plugins/imageformats/svg/svg.json2
-rw-r--r--sync.profile10
8 files changed, 32 insertions, 13 deletions
diff --git a/src/plugins/iconengines/svgiconengine/main.cpp b/src/plugins/iconengines/svgiconengine/main.cpp
index 8c3f8bb..cedeb7a 100644
--- a/src/plugins/iconengines/svgiconengine/main.cpp
+++ b/src/plugins/iconengines/svgiconengine/main.cpp
@@ -51,7 +51,11 @@ QT_BEGIN_NAMESPACE
class QSvgIconPlugin : public QIconEnginePlugin
{
Q_OBJECT
+#ifndef QT_NO_COMPRESS
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "qsvgiconengine.json")
+#else
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "qsvgiconengine-nocompress.json")
+#endif
public:
QIconEngine *create(const QString &filename = QString()) override;
diff --git a/src/plugins/iconengines/svgiconengine/qsvgiconengine-nocompress.json b/src/plugins/iconengines/svgiconengine/qsvgiconengine-nocompress.json
new file mode 100644
index 0000000..a3e1ac3
--- /dev/null
+++ b/src/plugins/iconengines/svgiconengine/qsvgiconengine-nocompress.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "svg" ]
+}
diff --git a/src/plugins/iconengines/svgiconengine/svgiconengine.pro b/src/plugins/iconengines/svgiconengine/svgiconengine.pro
index eb6847b..bfc739f 100644
--- a/src/plugins/iconengines/svgiconengine/svgiconengine.pro
+++ b/src/plugins/iconengines/svgiconengine/svgiconengine.pro
@@ -4,6 +4,7 @@ HEADERS += qsvgiconengine.h
SOURCES += main.cpp \
qsvgiconengine.cpp
OTHER_FILES += qsvgiconengine.json
+OTHER_FILES += qsvgiconengine-nocompress.json
QT += svg core-private gui-private
PLUGIN_TYPE = iconengines
diff --git a/src/plugins/imageformats/svg/main.cpp b/src/plugins/imageformats/svg/main.cpp
index e92f25a..f9fcfc3 100644
--- a/src/plugins/imageformats/svg/main.cpp
+++ b/src/plugins/imageformats/svg/main.cpp
@@ -53,7 +53,11 @@ QT_BEGIN_NAMESPACE
class QSvgPlugin : public QImageIOPlugin
{
Q_OBJECT
+#ifndef QT_NO_COMPRESS
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "svg.json")
+#else
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "svg-nocompress.json")
+#endif
public:
Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
@@ -62,7 +66,11 @@ public:
QImageIOPlugin::Capabilities QSvgPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
+#ifndef QT_NO_COMPRESS
if (format == "svg" || format == "svgz")
+#else
+ if (format == "svg")
+#endif
return Capabilities(CanRead);
if (!format.isEmpty())
return 0;
diff --git a/src/plugins/imageformats/svg/qsvgiohandler.cpp b/src/plugins/imageformats/svg/qsvgiohandler.cpp
index bb68fd9..88d37bc 100644
--- a/src/plugins/imageformats/svg/qsvgiohandler.cpp
+++ b/src/plugins/imageformats/svg/qsvgiohandler.cpp
@@ -88,8 +88,10 @@ bool QSvgIOHandlerPrivate::load(QIODevice *device)
const QByteArray &ba = buf->data();
res = r.load(QByteArray::fromRawData(ba.constData() + buf->pos(), ba.size() - buf->pos()));
buf->seek(ba.size());
+#ifndef QT_NO_COMPRESS
} else if (q->format() == "svgz") {
res = r.load(device->readAll());
+#endif
} else {
xmlReader.setDevice(device);
res = r.load(&xmlReader);
@@ -125,10 +127,13 @@ bool QSvgIOHandler::canRead() const
return true; // Will happen if we have been asked for the size
QByteArray buf = device()->peek(8);
+#ifndef QT_NO_COMPRESS
if (buf.startsWith("\x1f\x8b")) {
setFormat("svgz");
return true;
- } else if (buf.contains("<?xml") || buf.contains("<svg") || buf.contains("<!--")) {
+ } else
+#endif
+ if (buf.contains("<?xml") || buf.contains("<svg") || buf.contains("<!--")) {
setFormat("svg");
return true;
}
@@ -257,7 +262,11 @@ bool QSvgIOHandler::supportsOption(ImageOption option) const
bool QSvgIOHandler::canRead(QIODevice *device)
{
QByteArray buf = device->peek(8);
- return buf.startsWith("\x1f\x8b") || buf.contains("<?xml") || buf.contains("<svg") || buf.contains("<!--");
+ return
+#ifndef QT_NO_COMPRESS
+ buf.startsWith("\x1f\x8b") ||
+#endif
+ buf.contains("<?xml") || buf.contains("<svg") || buf.contains("<!--");
}
QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/svg/svg-nocompress.json b/src/plugins/imageformats/svg/svg-nocompress.json
new file mode 100644
index 0000000..3b5a653
--- /dev/null
+++ b/src/plugins/imageformats/svg/svg-nocompress.json
@@ -0,0 +1,4 @@
+{
+ "Keys": [ "svg" ],
+ "MimeTypes": [ "image/svg+xml" ]
+}
diff --git a/src/plugins/imageformats/svg/svg.json b/src/plugins/imageformats/svg/svg.json
index c8825d4..970914d 100644
--- a/src/plugins/imageformats/svg/svg.json
+++ b/src/plugins/imageformats/svg/svg.json
@@ -1,4 +1,4 @@
{
"Keys": [ "svg", "svgz" ],
- "MimeTypes": [ "image/svg+xml" ]
+ "MimeTypes": [ "image/svg+xml", "image/svg+xml-compressed" ]
}
diff --git a/sync.profile b/sync.profile
index e7d8f15..cd6c4bf 100644
--- a/sync.profile
+++ b/sync.profile
@@ -3,13 +3,3 @@
);
%moduleheaders = ( # restrict the module headers to those found in relative path
);
-# Module dependencies.
-# Every module that is required to build this module should have one entry.
-# Each of the module version specifiers can take one of the following values:
-# - A specific Git revision.
-# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch)
-# - an empty string to use the same branch under test (dependencies will become "refs/heads/master" if we are in the master branch)
-#
-%dependencies = (
- "qtbase" => "",
-);