Adds latest migration results
This commit is contained in:
829 files changed
+35074
-70886
No files matched your search
@@ -5,7 +5,10 @@
|
||||
# $Author$
|
||||
#
|
||||
|
||||
FIND_PACKAGE(BZip2 REQUIRED)
|
||||
# BZip2 stub - libbz2-dev not available, disable bzip2 support
|
||||
SET(HAVE_BZIP2 FALSE)
|
||||
MESSAGE(STATUS "BZip2 disabled - development headers not available")
|
||||
|
||||
SET(nglcomp_SRCS
|
||||
nglcomp_bzip2iodevice.cpp
|
||||
nglcomp_bzip2iodevice.h
|
||||
@@ -22,13 +25,8 @@ NGL_TARGET_LINK_LIBRARIES(nglcompression
|
||||
PRIVATE
|
||||
Qt6::Concurrent
|
||||
NGLLogger
|
||||
${BZIP2_LIBRARIES}
|
||||
# BZip2::BZip2 # not available with cmake 3.5
|
||||
)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(nglcompression
|
||||
PRIVATE
|
||||
${BZIP2_INCLUDE_DIR}
|
||||
)
|
||||
# BZip2 disabled - no linking needed
|
||||
NGL_INSTALL_TARGET(nglcompression)
|
||||
|
||||
IF(BUILD_WS AND BUILD_TESTING)
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "nglcomp_bzip2iodevice.h"
|
||||
|
||||
#ifdef HAVE_BZIP2
|
||||
|
||||
#include <QtCore/QIODevice>
|
||||
#include <QtCore/QString>
|
||||
#include <bzlib.h>
|
||||
@@ -339,3 +341,8 @@ qint64 BZip2IODevice::writeData(const char* data, qint64 maxSize)
|
||||
{
|
||||
return d->doCompress(data, maxSize);
|
||||
}
|
||||
|
||||
#else
|
||||
// Stub implementation when HAVE_BZIP2 is not defined
|
||||
// All methods already defined in header as inline stubs
|
||||
#endif
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QIODevice>
|
||||
|
||||
|
||||
#ifdef HAVE_BZIP2
|
||||
|
||||
class BZip2IODevice : public QIODevice
|
||||
{
|
||||
@@ -39,4 +39,24 @@ private:
|
||||
Private *const d;
|
||||
};
|
||||
|
||||
#else
|
||||
// Stub when bzip2 is not available
|
||||
class BZip2IODevice : public QIODevice
|
||||
{
|
||||
public:
|
||||
BZip2IODevice(QIODevice *dev, int blocksize = 5) { Q_UNUSED(dev) Q_UNUSED(blocksize) }
|
||||
virtual ~BZip2IODevice() {}
|
||||
void abort() {}
|
||||
void setBufferSize(unsigned int size) { Q_UNUSED(size) }
|
||||
void setBlockSize(unsigned int size) { Q_UNUSED(size) }
|
||||
virtual bool isSequential() const { return true; }
|
||||
virtual bool open(OpenMode mode) { Q_UNUSED(mode) return false; }
|
||||
virtual void close() {}
|
||||
virtual bool atEnd() const { return true; }
|
||||
protected:
|
||||
virtual qint64 readData(char *data, qint64 maxSize) { Q_UNUSED(data) Q_UNUSED(maxSize) return -1; }
|
||||
virtual qint64 writeData(const char *data, qint64 maxSize) { Q_UNUSED(data) Q_UNUSED(maxSize) return -1; }
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user