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>
This commit is contained in:
Marc Mutz 2023-03-31 13:38:07 +02:00
parent cd800da526
commit b85a9d0ee1
15 changed files with 14 additions and 27 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -15,7 +15,6 @@ qt_internal_add_test(tst_qzip
SOURCES
tst_qzip.cpp
LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::CorePrivate
TESTDATA ${test_data}
)

View File

@ -15,6 +15,6 @@ qt_internal_add_test(tst_qxmlstream
tst_qxmlstream.cpp
LIBRARIES
Qt::Network
Qt::GuiPrivate
Qt::CorePrivate
TESTDATA ${test_data}
)

View File

@ -12,7 +12,7 @@
#include <QXmlStreamReader>
#include <QBuffer>
#include <QStack>
#include <QtGui/private/qzipreader_p.h>
#include <private/qzipreader_p.h>
#include "qc14n.h"

View File

@ -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)