--- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -614,6 +614,8 @@ ELSE(ENABLE_GPS) MESSAGE(STATUS "GPS: disabled.") ENDIF(ENABLE_GPS) +find_package(Qt5Compress REQUIRED) + IF(USE_QTOPENGL) # QtOpenGL module is deprecated. After merging the QOpenGLWidget branch, we don't use this module directly anymore, # but the QtMultimediaWidgets module requires it internally, so we still have to package it. --- a/plugins/Satellites/src/CMakeLists.txt +++ b/plugins/Satellites/src/CMakeLists.txt @@ -55,7 +55,7 @@ IF(ENABLE_TESTING) ENDIF(ENABLE_TESTING) ADD_LIBRARY(Satellites-static STATIC ${Satellites_SRCS} ${Satellites_RES_CXX} ${SatellitesDialog_UIS_H}) -TARGET_LINK_LIBRARIES(Satellites-static Qt5::Core Qt5::Network Qt5::Widgets) +TARGET_LINK_LIBRARIES(Satellites-static Qt5::Core Qt5::Network Qt5::Widgets Qt5::Compress) # The library target "Satellites-static" has a default OUTPUT_NAME of "Satellites-static", so change it. SET_TARGET_PROPERTIES(Satellites-static PROPERTIES OUTPUT_NAME "Satellites") IF(MSVC) --- a/plugins/Satellites/src/Satellites.cpp +++ b/plugins/Satellites/src/Satellites.cpp @@ -43,7 +43,7 @@ #include "StelUtils.hpp" #include "StelActionMgr.hpp" -#include "external/qtcompress/qzipreader.h" +#include "qzipreader.h" #include #include @@ -1639,12 +1639,12 @@ void Satellites::saveDownloadedUpdate(QNetworkReply* reply) QString archive = zip.fileName(); QByteArray data; - Stel::QZipReader reader(archive); - if (reader.status() != Stel::QZipReader::NoError) + QZipReader reader(archive); + if (reader.status() != QZipReader::NoError) qWarning() << "[Satellites] Unable to open as a ZIP archive"; else { - QList infoList = reader.fileInfoList(); + QList infoList = reader.fileInfoList(); for (const auto& info : qAsConst(infoList)) { // qWarning() << "[Satellites] Processing:" << info.filePath; --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -479,7 +479,7 @@ IF(ENABLE_SPOUT AND SPOUT_LIBRARY_DLL) CONFIGURE_FILE(${SPOUT_LIBRARY_DLL} ${CMAKE_CURRENT_BINARY_DIR} COPYONLY) ENDIF() -SET(STELMAIN_DEPS ${ZLIB_LIBRARIES} qtcompress_stel glues_stel qcustomplot_stel qxlsx_stel ${STELLARIUM_STATIC_PLUGINS_LIBRARIES} ${STELLARIUM_QT_LIBRARIES} ${SPOUT_LIBRARY}) +SET(STELMAIN_DEPS ${ZLIB_LIBRARIES} Qt5::Compress glues_stel qcustomplot_stel qxlsx_stel ${STELLARIUM_STATIC_PLUGINS_LIBRARIES} ${STELLARIUM_QT_LIBRARIES} ${SPOUT_LIBRARY}) IF(ENABLE_LIBGPS) SET(STELMAIN_DEPS ${STELMAIN_DEPS} ${GPS_LIBRARY}) ENDIF() --- a/src/core/modules/LandscapeMgr.cpp +++ b/src/core/modules/LandscapeMgr.cpp @@ -1331,8 +1331,8 @@ QString LandscapeMgr::installLandscapeFromArchive(QString sourceFilePath, const } QDir destinationDir (parentDestinationDir.absoluteFilePath("landscapes")); - Stel::QZipReader reader(sourceFilePath); - if (reader.status() != Stel::QZipReader::NoError) + QZipReader reader(sourceFilePath); + if (reader.status() != QZipReader::NoError) { qWarning() << "LandscapeMgr: Unable to open as a ZIP archive:" << QDir::toNativeSeparators(sourceFilePath); emit errorNotArchive(); @@ -1341,7 +1341,7 @@ QString LandscapeMgr::installLandscapeFromArchive(QString sourceFilePath, const //Detect top directory QString topDir, iniPath; - const QList infoList = reader.fileInfoList(); + const QList infoList = reader.fileInfoList(); for (const auto& info : infoList) { QFileInfo fileInfo(info.filePath); --- a/src/external/CMakeLists.txt +++ b/src/external/CMakeLists.txt @@ -70,6 +70,7 @@ target_include_directories(zlib_stel PUBLIC zlib) set_target_properties(zlib_stel PROPERTIES AUTOMOC 0) SET_TARGET_PROPERTIES(zlib_stel PROPERTIES FOLDER "src/external") +if(0) set(qtcompress_SRCS qtcompress/qzip.cpp qtcompress/qzipreader.h @@ -82,6 +83,7 @@ target_link_libraries(qtcompress_stel ${ZLIB_LIBRARIES} Qt5::Core) #turn off automoc, not needed here set_target_properties(qtcompress_stel PROPERTIES AUTOMOC 0) SET_TARGET_PROPERTIES(qtcompress_stel PROPERTIES FOLDER "src/external") +endif() # QCustomPlot should not be unbundled, because upstream uses GPL 3, and # Stellarium uses GPL 2. Author of QCustomPlot has agreed for GPL 2+ for this. @@ -180,7 +182,7 @@ SET(qxlsx_SRCS qxlsx/xlsxcelllocation.h ) add_library(qxlsx_stel STATIC EXCLUDE_FROM_ALL ${qxlsx_SRCS}) -target_link_libraries(qxlsx_stel Qt5::Core Qt5::Gui qtcompress_stel) +target_link_libraries(qxlsx_stel Qt5::Core Qt5::Gui Qt5::Compress) set_target_properties(qxlsx_stel PROPERTIES FOLDER "src/external") ################################# INDI ################################ --- a/src/external/qxlsx/xlsxzipreader.cpp +++ b/src/external/qxlsx/xlsxzipreader.cpp @@ -5,13 +5,13 @@ QT_BEGIN_NAMESPACE_XLSX ZipReader::ZipReader(const QString &filePath) : - m_reader(new Stel::QZipReader(filePath)) + m_reader(new QZipReader(filePath)) { init(); } ZipReader::ZipReader(QIODevice *device) : - m_reader(new Stel::QZipReader(device)) + m_reader(new QZipReader(device)) { init(); } @@ -23,8 +23,8 @@ ZipReader::~ZipReader() void ZipReader::init() { - QList allFiles = m_reader->fileInfoList(); - for (const Stel::QZipReader::FileInfo &fi : allFiles) { + QList allFiles = m_reader->fileInfoList(); + for (const QZipReader::FileInfo &fi : allFiles) { if (fi.isFile || (!fi.isDir && !fi.isFile && !fi.isSymLink)) m_filePaths.append(fi.filePath); } --- a/src/external/qxlsx/xlsxzipreader_p.h +++ b/src/external/qxlsx/xlsxzipreader_p.h @@ -8,7 +8,7 @@ #include #include "xlsxglobal.h" -#include "external/qtcompress/qzipreader.h" +#include "qzipreader.h" #if QT_VERSION >= 0x050600 #include @@ -31,7 +31,7 @@ public: private: Q_DISABLE_COPY(ZipReader) void init(); - QScopedPointer m_reader; + QScopedPointer m_reader; QStringList m_filePaths; }; --- a/src/external/qxlsx/xlsxzipwriter.cpp +++ b/src/external/qxlsx/xlsxzipwriter.cpp @@ -10,14 +10,14 @@ QT_BEGIN_NAMESPACE_XLSX ZipWriter::ZipWriter(const QString &filePath) { - m_writer = new Stel::QZipWriter(filePath, QIODevice::WriteOnly); - m_writer->setCompressionPolicy(Stel::QZipWriter::AutoCompress); + m_writer = new QZipWriter(filePath, QIODevice::WriteOnly); + m_writer->setCompressionPolicy(QZipWriter::AutoCompress); } ZipWriter::ZipWriter(QIODevice *device) { - m_writer = new Stel::QZipWriter(device); - m_writer->setCompressionPolicy(Stel::QZipWriter::AutoCompress); + m_writer = new QZipWriter(device); + m_writer->setCompressionPolicy(QZipWriter::AutoCompress); } ZipWriter::~ZipWriter() @@ -27,7 +27,7 @@ ZipWriter::~ZipWriter() bool ZipWriter::error() const { - return m_writer->status() != Stel::QZipWriter::NoError; + return m_writer->status() != QZipWriter::NoError; } void ZipWriter::addFile(const QString &filePath, QIODevice *device) --- a/src/external/qxlsx/xlsxzipwriter_p.h +++ b/src/external/qxlsx/xlsxzipwriter_p.h @@ -8,7 +8,7 @@ #include #include "xlsxglobal.h" -#include "external/qtcompress/qzipwriter.h" +#include "qzipwriter.h" class QZipWriter; @@ -27,7 +27,7 @@ public: void close(); private: - Stel::QZipWriter *m_writer; + QZipWriter *m_writer; }; QT_END_NAMESPACE_XLSX