summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-03-31 13:38:07 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-04-26 12:01:05 +0200
commitb85a9d0ee16e3bdc817eb1e8a8f85026e631b401 (patch)
treebc0b8e05d2d2aee8bd2a96fdccbf7424ca304f2e
parentcd800da526aaf0369f9cf4780db065026ddad7dd (diff)
Move QZipReader/Writer from QtGui to QtCore
These classes depend only on Core, not Gui. This allows dropping the dependency of tst_qxmlstream and tst_qzip on QtGui, and prevents a tst_qxmlstream FTBFS when building with QT_NO_TEXTODFWRITER. Symbols move from QtGui to QtCore, but the classes are private API, so not under BC constraints. The classes are not used outside qtbase, so no other in-tree users need porting. Task-number: QTBUG-3897 Change-Id: Ifa148f43ec139d7f9ac1f3893e2fcf4640e3c60c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/CMakeLists.txt1
-rw-r--r--src/corelib/io/qzip.cpp (renamed from src/gui/text/qzip.cpp)7
-rw-r--r--src/corelib/io/qzipreader_p.h (renamed from src/gui/text/qzipreader_p.h)8
-rw-r--r--src/corelib/io/qzipwriter_p.h (renamed from src/gui/text/qzipwriter_p.h)8
-rw-r--r--src/gui/CMakeLists.txt3
-rw-r--r--src/gui/text/qtextodfwriter.cpp3
-rw-r--r--tests/auto/corelib/io/CMakeLists.txt3
-rw-r--r--tests/auto/corelib/io/qzip/.gitignore (renamed from tests/auto/gui/text/qzip/.gitignore)0
-rw-r--r--tests/auto/corelib/io/qzip/CMakeLists.txt (renamed from tests/auto/gui/text/qzip/CMakeLists.txt)3
-rw-r--r--tests/auto/corelib/io/qzip/testdata/symlink.zip (renamed from tests/auto/gui/text/qzip/testdata/symlink.zip)bin289 -> 289 bytes
-rw-r--r--tests/auto/corelib/io/qzip/testdata/test.zip (renamed from tests/auto/gui/text/qzip/testdata/test.zip)bin286 -> 286 bytes
-rw-r--r--tests/auto/corelib/io/qzip/tst_qzip.cpp (renamed from tests/auto/gui/text/qzip/tst_qzip.cpp)0
-rw-r--r--tests/auto/corelib/serialization/qxmlstream/CMakeLists.txt2
-rw-r--r--tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp2
-rw-r--r--tests/auto/gui/text/CMakeLists.txt1
15 files changed, 14 insertions, 27 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index a1cb450627..489647d1a4 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -145,6 +145,7 @@ qt_internal_add_module(Core
io/qurlidna.cpp
io/qurlquery.cpp io/qurlquery.h
io/qurlrecode.cpp
+ io/qzipreader_p.h io/qzipwriter_p.h io/qzip.cpp
kernel/qabstracteventdispatcher.cpp kernel/qabstracteventdispatcher.h kernel/qabstracteventdispatcher_p.h
kernel/qabstractnativeeventfilter.cpp kernel/qabstractnativeeventfilter.h
kernel/qapplicationstatic.h
diff --git a/src/gui/text/qzip.cpp b/src/corelib/io/qzip.cpp
index 7fd96363df..d4976691c9 100644
--- a/src/gui/text/qzip.cpp
+++ b/src/corelib/io/qzip.cpp
@@ -1,12 +1,9 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#include <qglobal.h>
-
-#ifndef QT_NO_TEXTODFWRITER
-
#include "qzipreader_p.h"
#include "qzipwriter_p.h"
+
#include <qdatetime.h>
#include <qendian.h>
#include <qdebug.h>
@@ -1348,5 +1345,3 @@ void QZipWriter::close()
}
QT_END_NAMESPACE
-
-#endif // QT_NO_TEXTODFWRITER
diff --git a/src/gui/text/qzipreader_p.h b/src/corelib/io/qzipreader_p.h
index 2e8d6bc951..e6ddd0dc99 100644
--- a/src/gui/text/qzipreader_p.h
+++ b/src/corelib/io/qzipreader_p.h
@@ -4,10 +4,7 @@
#ifndef QZIPREADER_H
#define QZIPREADER_H
-#include <QtGui/private/qtguiglobal_p.h>
-#include <QtCore/qglobal.h>
-
-#ifndef QT_NO_TEXTODFWRITER
+#include <QtCore/private/qglobal_p.h>
//
// W A R N I N G
@@ -28,7 +25,7 @@ QT_BEGIN_NAMESPACE
class QZipReaderPrivate;
-class Q_GUI_EXPORT QZipReader
+class Q_CORE_EXPORT QZipReader
{
public:
explicit QZipReader(const QString &fileName, QIODevice::OpenMode mode = QIODevice::ReadOnly );
@@ -87,5 +84,4 @@ Q_DECLARE_TYPEINFO(QZipReader::Status, Q_PRIMITIVE_TYPE);
QT_END_NAMESPACE
-#endif // QT_NO_TEXTODFWRITER
#endif // QZIPREADER_H
diff --git a/src/gui/text/qzipwriter_p.h b/src/corelib/io/qzipwriter_p.h
index 6c1ef5d848..770e6118b6 100644
--- a/src/gui/text/qzipwriter_p.h
+++ b/src/corelib/io/qzipwriter_p.h
@@ -3,9 +3,7 @@
#ifndef QZIPWRITER_H
#define QZIPWRITER_H
-#include <QtGui/private/qtguiglobal_p.h>
-
-#ifndef QT_NO_TEXTODFWRITER
+#include <QtCore/private/qglobal_p.h>
//
// W A R N I N G
@@ -25,8 +23,7 @@ QT_BEGIN_NAMESPACE
class QZipWriterPrivate;
-
-class Q_GUI_EXPORT QZipWriter
+class Q_CORE_EXPORT QZipWriter
{
public:
explicit QZipWriter(const QString &fileName, QIODevice::OpenMode mode = (QIODevice::WriteOnly | QIODevice::Truncate) );
@@ -77,5 +74,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_TEXTODFWRITER
#endif // QZIPWRITER_H
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index a8ddd7f93c..714a7ee058 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -646,9 +646,6 @@ qt_internal_extend_target(Gui CONDITION QT_FEATURE_harfbuzz AND UIKIT
qt_internal_extend_target(Gui CONDITION QT_FEATURE_textodfwriter
SOURCES
text/qtextodfwriter.cpp text/qtextodfwriter_p.h
- text/qzip.cpp
- text/qzipreader_p.h
- text/qzipwriter_p.h
)
qt_internal_extend_target(Gui CONDITION QT_FEATURE_textmarkdownreader
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index 546859037c..b50771c12f 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -18,9 +18,10 @@
#include "qtexttable.h"
#include "qtextcursor.h"
#include "qtextimagehandler_p.h"
-#include "qzipwriter_p.h"
#include <QDebug>
+#include <QtCore/private/qzipwriter_p.h>
+
QT_BEGIN_NAMESPACE
diff --git a/tests/auto/corelib/io/CMakeLists.txt b/tests/auto/corelib/io/CMakeLists.txt
index 4100ce17d5..22eb2148f8 100644
--- a/tests/auto/corelib/io/CMakeLists.txt
+++ b/tests/auto/corelib/io/CMakeLists.txt
@@ -64,3 +64,6 @@ endif()
if(QT_FEATURE_settings AND TARGET Qt::Gui)
add_subdirectory(qsettings)
endif()
+if(QT_FEATURE_private_tests)
+ add_subdirectory(qzip)
+endif()
diff --git a/tests/auto/gui/text/qzip/.gitignore b/tests/auto/corelib/io/qzip/.gitignore
index 2d7dfbe70c..2d7dfbe70c 100644
--- a/tests/auto/gui/text/qzip/.gitignore
+++ b/tests/auto/corelib/io/qzip/.gitignore
diff --git a/tests/auto/gui/text/qzip/CMakeLists.txt b/tests/auto/corelib/io/qzip/CMakeLists.txt
index 73bf0fda7f..615e635584 100644
--- a/tests/auto/gui/text/qzip/CMakeLists.txt
+++ b/tests/auto/corelib/io/qzip/CMakeLists.txt
@@ -15,7 +15,6 @@ qt_internal_add_test(tst_qzip
SOURCES
tst_qzip.cpp
LIBRARIES
- Qt::Gui
- Qt::GuiPrivate
+ Qt::CorePrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/gui/text/qzip/testdata/symlink.zip b/tests/auto/corelib/io/qzip/testdata/symlink.zip
index 027f96477a..027f96477a 100644
--- a/tests/auto/gui/text/qzip/testdata/symlink.zip
+++ b/tests/auto/corelib/io/qzip/testdata/symlink.zip
Binary files differ
diff --git a/tests/auto/gui/text/qzip/testdata/test.zip b/tests/auto/corelib/io/qzip/testdata/test.zip
index a57ba4e2a9..a57ba4e2a9 100644
--- a/tests/auto/gui/text/qzip/testdata/test.zip
+++ b/tests/auto/corelib/io/qzip/testdata/test.zip
Binary files differ
diff --git a/tests/auto/gui/text/qzip/tst_qzip.cpp b/tests/auto/corelib/io/qzip/tst_qzip.cpp
index 3e2dc39983..3e2dc39983 100644
--- a/tests/auto/gui/text/qzip/tst_qzip.cpp
+++ b/tests/auto/corelib/io/qzip/tst_qzip.cpp
diff --git a/tests/auto/corelib/serialization/qxmlstream/CMakeLists.txt b/tests/auto/corelib/serialization/qxmlstream/CMakeLists.txt
index 3304097d4b..e7dd05944e 100644
--- a/tests/auto/corelib/serialization/qxmlstream/CMakeLists.txt
+++ b/tests/auto/corelib/serialization/qxmlstream/CMakeLists.txt
@@ -15,6 +15,6 @@ qt_internal_add_test(tst_qxmlstream
tst_qxmlstream.cpp
LIBRARIES
Qt::Network
- Qt::GuiPrivate
+ Qt::CorePrivate
TESTDATA ${test_data}
)
diff --git a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp
index ea538ca79d..5e8533abef 100644
--- a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp
@@ -12,7 +12,7 @@
#include <QXmlStreamReader>
#include <QBuffer>
#include <QStack>
-#include <QtGui/private/qzipreader_p.h>
+#include <private/qzipreader_p.h>
#include "qc14n.h"
diff --git a/tests/auto/gui/text/CMakeLists.txt b/tests/auto/gui/text/CMakeLists.txt
index 2ba0a96774..bad13de7dc 100644
--- a/tests/auto/gui/text/CMakeLists.txt
+++ b/tests/auto/gui/text/CMakeLists.txt
@@ -26,7 +26,6 @@ endif()
if(QT_FEATURE_private_tests)
add_subdirectory(qfontcache)
add_subdirectory(qtextlayout)
- add_subdirectory(qzip)
add_subdirectory(qtextodfwriter)
endif()
if(TARGET Qt::Xml)