Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung - 44 Export-Header Include-Pfade korrigiert (_export.h) - 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h) - INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros - Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits) - FATAL_LOG Makro hinzugefügt - InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h) - FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h) - AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp) - SymbolAppearance Klasse vollständig definiert mit content() Methode - BuildingComponentFilter Klasse definiert mit Copy-Konstruktor - Ftc Factory: nullptr Return (abstract class) - AesFilter Klasse in aes.hpp hinzugefügt - Dtc Klasse in ppm.hpp mit participantChanged Signal - AesType Enum: alle 15 At* Werte definiert - AesEffectState_def: EsReceived hinzugefügt - DataModification Enum: eAdded/eModified/eRemoved - function_reply_object.h → core_types.h Include-Pfad (72 Dateien) - Enum-Class-Streaming Template-Operator in INGLLogger.h - ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen - ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge - QRegExp → QRegularExpression in tpm_js_parser.cpp - .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert - Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2785 files changed
+18754
-18316
No files matched your search
@@ -5,9 +5,6 @@ FIND_PACKAGE(Log4Qt)
|
||||
SET(NGLLogger_SRCS
|
||||
MurmurHash2.cpp
|
||||
MurmurHash2.h
|
||||
INGLLogger.h
|
||||
|
||||
NGLLogger_export.h
|
||||
NGLLoggerBootstrap.cpp
|
||||
NGLLoggerBootstrap.h
|
||||
NGLLogger.cpp
|
||||
@@ -20,11 +17,12 @@ SET(NGLLogger_HDRS
|
||||
|
||||
# Make sure NGLLogger.h compiles ..
|
||||
ADD_DEFINITIONS(-DBUILDING_NGLLOGGER)
|
||||
NGL_ADD_LIBRARY(ALL NGLLogger SHARED ${NGLLogger_SRCS} ${NGLLogger_HDRS})
|
||||
NGL_ADD_LIBRARY2(ALL NGLLogger SHARED ${NGLLogger_SRCS} ${NGLLogger_HDRS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(NGLLogger
|
||||
INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
# Export headers for other modules building in the same tree (e.g., TetraIF)
|
||||
|
||||
@@ -1,306 +0,0 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <QString>
|
||||
#include <QPointF>
|
||||
#include <QSize>
|
||||
#include <QRect>
|
||||
#include <QRectF>
|
||||
#include <QList>
|
||||
#include "NGLLogger_export.h"
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
|
||||
enum class LogLevel
|
||||
{
|
||||
Undefined = 0,
|
||||
Trace = 64,
|
||||
Debug = 96,
|
||||
Info = 128,
|
||||
Warning = 150,
|
||||
Error = 182,
|
||||
Fatal = 214,
|
||||
};
|
||||
|
||||
class LogStreamHelper
|
||||
{
|
||||
public:
|
||||
inline LogStreamHelper(INGLLogger &logger, LogLevel level, const char *const file, int line, const char *const function)
|
||||
: m_logger(logger)
|
||||
, m_level(level)
|
||||
, m_line(line)
|
||||
, m_file(file)
|
||||
, m_func(function)
|
||||
{}
|
||||
inline ~LogStreamHelper();
|
||||
|
||||
template<typename T>
|
||||
inline LogStreamHelper &operator<<(const T &val);
|
||||
|
||||
private:
|
||||
std::ostringstream m_buffer;
|
||||
NGL::INGLLogger &m_logger;
|
||||
const LogLevel m_level;
|
||||
const int m_line;
|
||||
const char *const m_file;
|
||||
const char *const m_func;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class INGLLogger
|
||||
{
|
||||
public:
|
||||
INGLLogger(const INGLLogger &) = delete;
|
||||
INGLLogger &operator=(const INGLLogger &) = delete;
|
||||
INGLLogger() = default;
|
||||
virtual ~INGLLogger() = default;
|
||||
|
||||
using String = std::string;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
virtual INGLLogger &getNGLLogger(const char *fullqualifiedname) = 0;
|
||||
virtual INGLLogger &getNGLLogger(const std::string &fullqualifiedname) = 0;
|
||||
|
||||
|
||||
|
||||
virtual bool isTraceEnabled() const = 0;
|
||||
virtual bool isDebugEnabled() const = 0;
|
||||
virtual bool isInfoEnabled() const = 0;
|
||||
virtual bool isWarningEnabled() const = 0;
|
||||
virtual bool isErrorEnabled() const = 0;
|
||||
virtual bool isFatalEnabled() const = 0;
|
||||
virtual bool isLevelEnabled(LogLevel level) const = 0;
|
||||
|
||||
|
||||
|
||||
virtual void log(LogLevel level, const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
|
||||
|
||||
|
||||
virtual void logTrace(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
|
||||
|
||||
virtual void logDebug(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
|
||||
|
||||
virtual void logInfo(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
|
||||
|
||||
virtual void logWarning(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
|
||||
|
||||
virtual void logError(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
|
||||
|
||||
virtual void logFatal(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
|
||||
|
||||
|
||||
virtual void logStartup(const char *file, int line, const char *function = nullptr) = 0;
|
||||
|
||||
virtual void logShutdown(const char *file, int line, const char *function = nullptr) = 0;
|
||||
|
||||
|
||||
virtual std::string getLoggerName() const = 0;
|
||||
|
||||
virtual void setNoSpace(bool bNoSpace) = 0;
|
||||
virtual bool noSpace() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
inline LogStreamHelper::~LogStreamHelper()
|
||||
{
|
||||
m_logger.log(m_level, m_buffer.str(), m_file, m_line, m_func);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline LogStreamHelper &LogStreamHelper::operator<<(const T &val)
|
||||
{
|
||||
m_buffer << val;
|
||||
if (!m_logger.noSpace())
|
||||
m_buffer << " ";
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &stream, const QByteArray &str)
|
||||
{
|
||||
stream << std::string(str.data(), str.size());
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &stream,
|
||||
const QPointF &value)
|
||||
{
|
||||
stream << "QPointF(" << QString::number(value.x(), 'f', 6).toStdString() << "#" << QString::number(value.y(), 'f', 6).toStdString() << ")";
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline std::ostream &operator<< (std::ostream &stream,
|
||||
const QPoint &value)
|
||||
{
|
||||
stream << "QPoint(" << value.x() << "#" << value.y() << ")";
|
||||
return stream;
|
||||
}
|
||||
|
||||
inline std::ostream &operator<< (std::ostream &stream,
|
||||
const QSize &value)
|
||||
{
|
||||
stream << "QSize(w=" << value.width() << ";h=" << value.height() << ")";
|
||||
return stream;
|
||||
}
|
||||
inline std::ostream &operator<< (std::ostream &stream,
|
||||
const QSizeF &value)
|
||||
{
|
||||
stream << "QSize(w="
|
||||
<< QString::number(value.width(), 'f', 6).toStdString() << ";h="
|
||||
<< QString::number(value.height(), 'f', 6).toStdString()
|
||||
<< ")";
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
inline std::ostream &operator<< (std::ostream &stream,
|
||||
const QRect &value)
|
||||
{
|
||||
stream << "QRect(center=" << value.center()
|
||||
<< " w=" << value.width()
|
||||
<< ";h=" << value.height()
|
||||
<< " bottomLeft=" << value.bottomLeft()
|
||||
<< " topRight=" << value.topRight()
|
||||
<< ")";
|
||||
return stream;
|
||||
}
|
||||
|
||||
inline std::ostream &operator<< (std::ostream &stream,
|
||||
const QRectF &value)
|
||||
{
|
||||
stream << "QRectF(center=" << value.center()
|
||||
<< " w=" << QString::number(value.width(), 'f', 3).toStdString()
|
||||
<< ";h=" << QString::number(value.height(), 'f', 3).toStdString()
|
||||
<< " bottomLeft=" << value.bottomLeft()
|
||||
<< " topRight=" << value.topRight()
|
||||
<< ")";
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline std::ostream &operator<< (std::ostream &stream,
|
||||
const QList<int> &value)
|
||||
{
|
||||
stream << "QList<int>(" << value.size() << "): ";
|
||||
for (int i : value)
|
||||
stream << i << ";";
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
inline std::ostream &operator<< (std::ostream &stream,
|
||||
const QList<QPointF> &value)
|
||||
{
|
||||
stream << "QList<QPointF>(" << value.size() << "): ";
|
||||
for (const QPointF &item : value)
|
||||
stream << item << ";";
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &stream, const QString &str)
|
||||
{
|
||||
return stream << str.toUtf8();
|
||||
}
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
|
||||
namespace NGLLoggerHelper
|
||||
{
|
||||
NGLLOGGER_EXPORT void hexDumpHelper(NGL::INGLLogger &logger,
|
||||
NGL::LogLevel level,
|
||||
const void *a_data,
|
||||
const unsigned int a_size);
|
||||
inline void hexDumpHelper(NGL::INGLLogger &logger,
|
||||
NGL::LogLevel level,
|
||||
const QByteArray &data)
|
||||
{
|
||||
return hexDumpHelper(logger, level, data.data(), data.size());
|
||||
}
|
||||
}
|
||||
|
||||
NGLLOGGER_EXPORT NGL::INGLLogger& getMemoryLogger();
|
||||
NGLLOGGER_EXPORT std::string getMemoryData();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define LOGFUNCTION Q_FUNC_INFO
|
||||
|
||||
|
||||
#define NOTICE_LOG(logger) \
|
||||
NGL::LogStreamHelper(logger, NGL::LogLevel::Info, __FILE__,__LINE__, Q_FUNC_INFO)
|
||||
|
||||
#ifdef LTS_DEBUG
|
||||
#define TRACE_LOG(logger) \
|
||||
for (bool log_level_enabled = (logger).isTraceEnabled(); log_level_enabled; log_level_enabled = false) \
|
||||
NGL::LogStreamHelper(logger, NGL::LogLevel::Trace, __FILE__,__LINE__, Q_FUNC_INFO)
|
||||
#else
|
||||
#define TRACE_LOG(logger) \
|
||||
for ( ; false; ) \
|
||||
NGL::LogStreamHelper(logger, NGL::LogLevel::Trace, __FILE__,__LINE__, Q_FUNC_INFO)
|
||||
#endif
|
||||
|
||||
#define DEBUG_LOG(logger) \
|
||||
for (bool log_level_enabled = (logger).isDebugEnabled(); log_level_enabled; log_level_enabled = false) \
|
||||
NGL::LogStreamHelper(logger, NGL::LogLevel::Debug, __FILE__,__LINE__, Q_FUNC_INFO)
|
||||
|
||||
#define INFO_LOG(logger) \
|
||||
for (bool log_level_enabled = (logger).isInfoEnabled(); log_level_enabled; log_level_enabled = false) \
|
||||
NGL::LogStreamHelper(logger, NGL::LogLevel::Info, __FILE__,__LINE__, Q_FUNC_INFO)
|
||||
|
||||
#define WARNING_LOG(logger) \
|
||||
for (bool log_level_enabled = (logger).isWarningEnabled(); log_level_enabled; log_level_enabled = false) \
|
||||
NGL::LogStreamHelper(logger, NGL::LogLevel::Warning, __FILE__,__LINE__, Q_FUNC_INFO)
|
||||
|
||||
#define ERROR_LOG(logger) \
|
||||
for (bool log_level_enabled = (logger).isErrorEnabled(); log_level_enabled; log_level_enabled = false) \
|
||||
NGL::LogStreamHelper(logger, NGL::LogLevel::Error, __FILE__,__LINE__, Q_FUNC_INFO)
|
||||
|
||||
#define FATAL_LOG(logger) \
|
||||
for (bool log_level_enabled = (logger).isFatalEnabled(); log_level_enabled; log_level_enabled = false) \
|
||||
NGL::LogStreamHelper(logger, NGL::LogLevel::Fatal, __FILE__,__LINE__, Q_FUNC_INFO)
|
||||
|
||||
#define STARTUP_LOG(logger) { (logger).logStartup(__FILE__, __LINE__, Q_FUNC_INFO); }
|
||||
#define SHUTDOWN_LOG(logger) { (logger).logShutdown(__FILE__, __LINE__, Q_FUNC_INFO); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define MEMORY_LOG() \
|
||||
for (bool log_level_enabled = (NGL::getMemoryLogger()).isInfoEnabled(); log_level_enabled; log_level_enabled = false) \
|
||||
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Info, __FILE__,__LINE__, Q_FUNC_INFO) << NGL::getMemoryData()
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#error Do not include me outside NGLLogger library - only use INGLLogger.h!
|
||||
#endif
|
||||
|
||||
#include "INGLLogger.h"
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#ifndef NGLLOGGERBOOTSTRAP_H
|
||||
#define NGLLOGGERBOOTSTRAP_H
|
||||
|
||||
#include "INGLLogger.h"
|
||||
#include "NGLLogger_export.h"
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "ngllogger_export.h"
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "INGLLogger.h"
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "NGLLoggerBootstrap.h"
|
||||
#include <QCoreApplication>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ SET(qtsapp_SRCS
|
||||
qtsingleapplication.h
|
||||
|
||||
)
|
||||
NGL_ADD_LIBRARY(WS qtsingleapplication SHARED ${qtsapp_SRCS})
|
||||
NGL_ADD_LIBRARY2(WS qtsingleapplication SHARED ${qtsapp_SRCS})
|
||||
NGL_INSTALL_TARGET(qtsingleapplication)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(qtsingleapplication
|
||||
PUBLIC
|
||||
@@ -36,7 +36,7 @@ SET(qtscoreapp_SRCS
|
||||
qtsinglecoreapplication.h
|
||||
qtsinglecoreapplication.cpp
|
||||
)
|
||||
NGL_ADD_LIBRARY(AAR SV qtsinglecoreapplication SHARED ${qtscoreapp_SRCS})
|
||||
NGL_ADD_LIBRARY2(AAR SV qtsinglecoreapplication SHARED ${qtscoreapp_SRCS})
|
||||
NGL_INSTALL_TARGET(qtsinglecoreapplication)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(qtsinglecoreapplication
|
||||
PUBLIC
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <WMS_Interface/wms_json_ds_export.h>
|
||||
#include "wms_json_ds_export.h"
|
||||
|
||||
class WMS_JSON_DS_EXPORT IBase
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ SET(nglapplication_SRCS
|
||||
ngl_qt_msg_handler.inc
|
||||
ngl_signal_handler.inc
|
||||
)
|
||||
NGL_ADD_LIBRARY(ALL nglapplication SHARED ${nglapplication_SRCS})
|
||||
NGL_ADD_LIBRARY2(ALL nglapplication SHARED ${nglapplication_SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(nglapplication
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -41,7 +41,7 @@ SET(nglsingleapplication_SRCS
|
||||
ngl_qt_msg_handler.inc
|
||||
ngl_signal_handler.inc
|
||||
)
|
||||
NGL_ADD_LIBRARY(WS nglsingleapplication SHARED ${nglsingleapplication_SRCS})
|
||||
NGL_ADD_LIBRARY2(WS nglsingleapplication SHARED ${nglsingleapplication_SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(nglsingleapplication
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -69,7 +69,7 @@ SET(nglcoreapplication_SRCS
|
||||
ngl_signal_handler.inc
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(ALL nglcoreapplication SHARED ${nglcoreapplication_SRCS})
|
||||
NGL_ADD_LIBRARY2(ALL nglcoreapplication SHARED ${nglcoreapplication_SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(nglcoreapplication
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -95,7 +95,7 @@ SET(nglsinglecoreapplication_SRCS
|
||||
ngl_signal_handler.inc
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV nglsinglecoreapplication SHARED ${nglsinglecoreapplication_SRCS})
|
||||
NGL_ADD_LIBRARY2(AAR SV nglsinglecoreapplication SHARED ${nglsinglecoreapplication_SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(nglsinglecoreapplication
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -122,7 +122,7 @@ SET(nglguiapplication_SRCS
|
||||
ngl_signal_handler.inc
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(ALL nglguiapplication SHARED ${nglguiapplication_SRCS})
|
||||
NGL_ADD_LIBRARY2(ALL nglguiapplication SHARED ${nglguiapplication_SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(nglguiapplication
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
@@ -15,7 +15,7 @@ SET(nglcomp_SRCS
|
||||
nglcomp_tarfilter.cpp
|
||||
nglcomp_tarfilter.h
|
||||
)
|
||||
NGL_ADD_LIBRARY(WS nglcompression SHARED ${nglcomp_SRCS})
|
||||
NGL_ADD_LIBRARY2(WS nglcompression SHARED ${nglcomp_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(nglcompression
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
|
||||
@@ -47,9 +47,8 @@ Compress::Compress(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_u2_memFiles()
|
||||
, m_aborted(0)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("nglcompress"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "c_tor";
|
||||
DEBUG_LOG() << "c_tor";
|
||||
|
||||
|
||||
|
||||
@@ -70,29 +69,29 @@ Compress::~Compress()
|
||||
qWarning() << "## COMPRESS DTOR!!!!";
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "~";
|
||||
DEBUG_LOG() << "~";
|
||||
|
||||
abort();
|
||||
m_future.waitForFinished();
|
||||
DEBUG_LOG(m_logger) << "~ finished";
|
||||
DEBUG_LOG() << "~ finished";
|
||||
}
|
||||
|
||||
void Compress::abort()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ABORT";
|
||||
DEBUG_LOG() << "ABORT";
|
||||
|
||||
m_aborted = 1;
|
||||
m_lastError = tr("Aborted");
|
||||
|
||||
if (m_currentTarFilter != nullptr)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "aborting tar";
|
||||
DEBUG_LOG() << "aborting tar";
|
||||
m_currentTarFilter->abort();
|
||||
}
|
||||
|
||||
if (m_currentBzipDevice != nullptr)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "aborting bzip";
|
||||
DEBUG_LOG() << "aborting bzip";
|
||||
m_currentBzipDevice->abort();
|
||||
}
|
||||
}
|
||||
@@ -103,7 +102,7 @@ void Compress::compress(QIODevice *out,
|
||||
const QVector<FileInformations> &memFiles,
|
||||
const QString &destRootDir)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "compress #2";
|
||||
DEBUG_LOG() << "compress #2";
|
||||
reset();
|
||||
setupFutureWatcher(QtConcurrent::run([this, out, filesRootDir, files, memFiles, destRootDir]() {
|
||||
return this->_compress(out, filesRootDir, files, memFiles, destRootDir);
|
||||
@@ -112,7 +111,7 @@ void Compress::compress(QIODevice *out,
|
||||
|
||||
void Compress::compress(QIODevice *out, const QString &sourceDir, const QString &destRootDir)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "compress #1 source dir: " << sourceDir << ", destRootDir: " << destRootDir;
|
||||
DEBUG_LOG() << "compress #1 source dir: " << sourceDir << ", destRootDir: " << destRootDir;
|
||||
reset();
|
||||
|
||||
QVector<Compress::FileInformations> inFiles = directoryFileList(sourceDir, true);
|
||||
@@ -125,10 +124,10 @@ void Compress::compress(QIODevice *out, const QString &sourceDir, const QString
|
||||
{
|
||||
fi.inputFileName = fi.inputFileName.mid(len);
|
||||
fi.bAbsInputPath = false;
|
||||
DEBUG_LOG(m_logger) << "fi: ifm = " << fi.inputFileName << ", abs = " << fi.bAbsInputPath;
|
||||
DEBUG_LOG() << "fi: ifm = " << fi.inputFileName << ", abs = " << fi.bAbsInputPath;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "FI list size: " << inFiles.count();
|
||||
DEBUG_LOG() << "FI list size: " << inFiles.count();
|
||||
|
||||
compress(out, sourceDir, inFiles, {}, destRootDir);
|
||||
}
|
||||
@@ -141,7 +140,7 @@ bool Compress::_compress(QIODevice *output,
|
||||
{
|
||||
std::shared_ptr<int> invalidatePointersOnScopeLeave(nullptr, [this](int *)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "invalidatePointersOnScopeLeave #1";
|
||||
DEBUG_LOG() << "invalidatePointersOnScopeLeave #1";
|
||||
m_currentTarFilter = nullptr;
|
||||
m_currentBzipDevice = nullptr;
|
||||
});
|
||||
@@ -151,7 +150,7 @@ bool Compress::_compress(QIODevice *output,
|
||||
if (!output || !output->isWritable())
|
||||
{
|
||||
m_lastError = tr("Device is not writeable");
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -162,7 +161,7 @@ bool Compress::_compress(QIODevice *output,
|
||||
const qint64 maxCount = files.count() + memFiles.count();
|
||||
qint64 count = 0;
|
||||
|
||||
DEBUG_LOG(m_logger) << "destRootDir = " << destRootDir << ", maxCount = " << maxCount << ", count = " << count;
|
||||
DEBUG_LOG() << "destRootDir = " << destRootDir << ", maxCount = " << maxCount << ", count = " << count;
|
||||
|
||||
BZip2IODevice bzip2(output, 9);
|
||||
m_currentBzipDevice = &bzip2;
|
||||
@@ -170,7 +169,7 @@ bool Compress::_compress(QIODevice *output,
|
||||
if (!bzip2.open(QIODevice::WriteOnly))
|
||||
{
|
||||
m_lastError = bzip2.errorString();
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -193,7 +192,7 @@ bool Compress::_compress(QIODevice *output,
|
||||
QString currentFileName;
|
||||
auto readCallback = [this, &maxCount, &count, ¤tFileSize, ¤tFileName, &bytesTotal](const qint64 iSize)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "readCallback: maxCount = " << maxCount << ", count = " << count
|
||||
DEBUG_LOG() << "readCallback: maxCount = " << maxCount << ", count = " << count
|
||||
<< ", currentFileSize = " << currentFileSize << ", currentFileName = " << currentFileName << ", iSize = " << iSize;
|
||||
emit compressInfoEx(maxCount, count, currentFileSize, (currentFileSize - iSize), currentFileName, bytesTotal);
|
||||
};
|
||||
@@ -205,10 +204,10 @@ bool Compress::_compress(QIODevice *output,
|
||||
QString curPath;
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "prepairing tar filter";
|
||||
DEBUG_LOG() << "prepairing tar filter";
|
||||
for (const QString &path : paths)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "path = " << path;
|
||||
DEBUG_LOG() << "path = " << path;
|
||||
if (m_aborted) return false;
|
||||
|
||||
if (curPath.isEmpty())
|
||||
@@ -216,14 +215,14 @@ bool Compress::_compress(QIODevice *output,
|
||||
else
|
||||
curPath += path + QLatin1Char('/');
|
||||
|
||||
DEBUG_LOG(m_logger) << "curPath = " << curPath << ", filesRootDir.isEmpty() = " << filesRootDir.isEmpty();
|
||||
DEBUG_LOG() << "curPath = " << curPath << ", filesRootDir.isEmpty() = " << filesRootDir.isEmpty();
|
||||
|
||||
if (filesRootDir.isEmpty())
|
||||
{
|
||||
if (!tf.addData(curPath, QByteArray(), true))
|
||||
{
|
||||
m_lastError = tf.lastError();
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -233,7 +232,7 @@ bool Compress::_compress(QIODevice *output,
|
||||
if (!tf.addFile(filesRootDir, curPath))
|
||||
{
|
||||
m_lastError = tf.lastError();
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -243,7 +242,7 @@ bool Compress::_compress(QIODevice *output,
|
||||
m_c_sizeInfo.realSize = 0;
|
||||
for (const FileInformations &file : std::as_const(files))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "file = " << file.inputFileName;
|
||||
DEBUG_LOG() << "file = " << file.inputFileName;
|
||||
emit compressInfo(maxCount, ++count, file.inputFileName);
|
||||
|
||||
if (m_aborted) return false;
|
||||
@@ -251,7 +250,7 @@ bool Compress::_compress(QIODevice *output,
|
||||
QString in = file.bAbsInputPath ? file.inputFileName : filesRootDir + QLatin1Char('/') + file.inputFileName;
|
||||
QString out = destRootDir + (file.outputFileName.isEmpty() ? file.inputFileName : file.outputFileName);
|
||||
|
||||
DEBUG_LOG(m_logger) << "in = " << in << ", out = " << out;
|
||||
DEBUG_LOG() << "in = " << in << ", out = " << out;
|
||||
|
||||
QFileInfo fi(in);
|
||||
|
||||
@@ -259,12 +258,12 @@ bool Compress::_compress(QIODevice *output,
|
||||
currentFileSize = fi.size();
|
||||
m_c_sizeInfo.realSize += currentFileSize;
|
||||
|
||||
DEBUG_LOG(m_logger) << "currentFileName = " << currentFileName << ", currentFileSize = " << currentFileSize << "m_c_sizeInfo.realSize" << m_c_sizeInfo.realSize;
|
||||
DEBUG_LOG() << "currentFileName = " << currentFileName << ", currentFileSize = " << currentFileSize << "m_c_sizeInfo.realSize" << m_c_sizeInfo.realSize;
|
||||
|
||||
if (!tf.addFile(in, out))
|
||||
{
|
||||
m_lastError = tf.lastError();
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -272,7 +271,7 @@ bool Compress::_compress(QIODevice *output,
|
||||
|
||||
for (const FileInformations &file : std::as_const(memFiles))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "(mem) file = " << file.inputFileName;
|
||||
DEBUG_LOG() << "(mem) file = " << file.inputFileName;
|
||||
emit compressInfo(maxCount, ++count, file.inputFileName);
|
||||
|
||||
if (m_aborted) return false;
|
||||
@@ -281,48 +280,48 @@ bool Compress::_compress(QIODevice *output,
|
||||
currentFileSize = file.fileData.size();
|
||||
m_c_sizeInfo.compressedSize += currentFileSize;
|
||||
|
||||
DEBUG_LOG(m_logger) << "(mem) currentFileName = " << currentFileName << ", currentFileSize = " << currentFileSize << "m_c_sizeInfo.realSize" << m_c_sizeInfo.realSize;
|
||||
DEBUG_LOG() << "(mem) currentFileName = " << currentFileName << ", currentFileSize = " << currentFileSize << "m_c_sizeInfo.realSize" << m_c_sizeInfo.realSize;
|
||||
|
||||
if (!tf.addData(file.inputFileName, file.fileData))
|
||||
{
|
||||
m_lastError = tf.lastError();
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "writing eos";
|
||||
DEBUG_LOG() << "writing eos";
|
||||
tf.writeEOS();
|
||||
|
||||
DEBUG_LOG(m_logger) << "closing bzip";
|
||||
DEBUG_LOG() << "closing bzip";
|
||||
bzip2.close();
|
||||
|
||||
m_c_sizeInfo.compressedSize = output->size();
|
||||
DEBUG_LOG(m_logger) << "m_c_sizeInfo.compressedSize = " << m_c_sizeInfo.compressedSize;
|
||||
DEBUG_LOG() << "m_c_sizeInfo.compressedSize = " << m_c_sizeInfo.compressedSize;
|
||||
|
||||
m_success = true;
|
||||
|
||||
DEBUG_LOG(m_logger) << "DONE!";
|
||||
DEBUG_LOG() << "DONE!";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Compress::uncompress(QIODevice *in, const QString &outDir)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "uncompress #1";
|
||||
DEBUG_LOG() << "uncompress #1";
|
||||
reset();
|
||||
setupFutureWatcher(QtConcurrent::run([this, in, outDir](){ return this->_uncompressDirectory(in, outDir); }));
|
||||
}
|
||||
|
||||
bool Compress::_uncompressDirectory(QIODevice *input, const QString &outDir)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "_uncompressDirectory";
|
||||
DEBUG_LOG() << "_uncompressDirectory";
|
||||
|
||||
std::shared_ptr<int> invalidatePointersOnScopeLeave(nullptr, [this](int *)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "invalidatePointersOnScopeLeave #2";
|
||||
DEBUG_LOG() << "invalidatePointersOnScopeLeave #2";
|
||||
m_currentTarFilter = nullptr;
|
||||
m_currentBzipDevice = nullptr;
|
||||
});
|
||||
@@ -332,7 +331,7 @@ bool Compress::_uncompressDirectory(QIODevice *input, const QString &outDir)
|
||||
if (!input || !input->isReadable())
|
||||
{
|
||||
m_lastError = tr("Device is not readable");
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -342,7 +341,7 @@ bool Compress::_uncompressDirectory(QIODevice *input, const QString &outDir)
|
||||
if (!bzip2.open(QIODevice::ReadOnly))
|
||||
{
|
||||
m_lastError = bzip2.errorString();
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -352,23 +351,23 @@ bool Compress::_uncompressDirectory(QIODevice *input, const QString &outDir)
|
||||
TarFilter::FileInformations tfi;
|
||||
QDir dir(outDir);
|
||||
|
||||
DEBUG_LOG(m_logger) << "dir = " << dir.path();
|
||||
DEBUG_LOG() << "dir = " << dir.path();
|
||||
|
||||
while (tf.getData(tfi))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "tfi.fileName = " << tfi.fileName;
|
||||
DEBUG_LOG() << "tfi.fileName = " << tfi.fileName;
|
||||
emit uncompressInfo(input->size(), input->pos(), tfi.fileName);
|
||||
if (m_aborted) return false;
|
||||
|
||||
QString path = outDir + QLatin1Char('/') + tfi.fileName;
|
||||
DEBUG_LOG(m_logger) << "path = " << path;
|
||||
DEBUG_LOG() << "path = " << path;
|
||||
if (tfi.fileType == TarFilter::directory)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "tfi.fileType == TarFilter::directory";
|
||||
DEBUG_LOG() << "tfi.fileType == TarFilter::directory";
|
||||
if (!dir.exists(path) && !dir.mkpath(path))
|
||||
{
|
||||
m_lastError = tr("Error creating directory %1").arg(outDir);
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -380,7 +379,7 @@ bool Compress::_uncompressDirectory(QIODevice *input, const QString &outDir)
|
||||
if (!dir.exists(pathName) && !dir.mkpath(pathName))
|
||||
{
|
||||
m_lastError = tr("Error creating directory %1").arg(pathName);
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -388,39 +387,39 @@ bool Compress::_uncompressDirectory(QIODevice *input, const QString &outDir)
|
||||
if (!f.open(QIODevice::WriteOnly))
|
||||
{
|
||||
m_lastError = tr("Error opening %1 for writing (%2)").arg(path, f.errorString());
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!tf.getData(&f))
|
||||
{
|
||||
m_lastError = tf.lastError();
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "uncompress done!";
|
||||
DEBUG_LOG() << "uncompress done!";
|
||||
m_success = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Compress::uncompress(QIODevice *in)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "uncompress #2!";
|
||||
DEBUG_LOG() << "uncompress #2!";
|
||||
reset();
|
||||
setupFutureWatcher(QtConcurrent::run([this, in](){ return this->_uncompressBuffer(in); }));
|
||||
}
|
||||
|
||||
bool Compress::_uncompressBuffer(QIODevice *input)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "uncompressBuffer";
|
||||
DEBUG_LOG() << "uncompressBuffer";
|
||||
|
||||
std::shared_ptr<int> invalidatePointersOnScopeLeave(nullptr, [this](int *)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "invalidatePointersOnScopeLeave #2";
|
||||
DEBUG_LOG() << "invalidatePointersOnScopeLeave #2";
|
||||
m_currentTarFilter = nullptr;
|
||||
m_currentBzipDevice = nullptr;
|
||||
});
|
||||
@@ -430,7 +429,7 @@ bool Compress::_uncompressBuffer(QIODevice *input)
|
||||
if (!input->isReadable())
|
||||
{
|
||||
m_lastError = tr("Device is not readable");
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -440,7 +439,7 @@ bool Compress::_uncompressBuffer(QIODevice *input)
|
||||
if (!bzip2.open(QIODevice::ReadOnly))
|
||||
{
|
||||
m_lastError = bzip2.errorString();
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -450,43 +449,43 @@ bool Compress::_uncompressBuffer(QIODevice *input)
|
||||
TarFilter::FileInformations tfi;
|
||||
while (tf.getData(tfi))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "tfi.fileName = " << tfi.fileName;
|
||||
DEBUG_LOG() << "tfi.fileName = " << tfi.fileName;
|
||||
emit uncompressInfo(input->size(), input->pos(), tfi.fileName);
|
||||
if (m_aborted) return false;
|
||||
|
||||
FileInformations fi;
|
||||
fi.outputFileName = tfi.fileName;
|
||||
|
||||
DEBUG_LOG(m_logger) << "fi.outputFileName = " << fi.outputFileName;
|
||||
DEBUG_LOG() << "fi.outputFileName = " << fi.outputFileName;
|
||||
|
||||
if (tfi.fileType == TarFilter::directory)
|
||||
{
|
||||
fi.outputFileName += QLatin1Char('/');
|
||||
DEBUG_LOG(m_logger) << "> fi.outputFileName = " << fi.outputFileName;
|
||||
DEBUG_LOG() << "> fi.outputFileName = " << fi.outputFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "stuff";
|
||||
DEBUG_LOG() << "stuff";
|
||||
|
||||
QBuffer buf(&fi.fileData);
|
||||
if (!buf.open(QIODevice::WriteOnly))
|
||||
{
|
||||
m_lastError = tr("Error opening buffer for writing (%1)").arg(buf.errorString());
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!tf.getData(&buf))
|
||||
{
|
||||
m_lastError = tf.lastError();
|
||||
ERROR_LOG(m_logger) << "compress failed: " << m_lastError;
|
||||
ERROR_LOG() << "compress failed: " << m_lastError;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
fi.bAbsInputPath = fi.outputFileName.startsWith(QLatin1Char('/'));
|
||||
DEBUG_LOG(m_logger) << "added fi.bAbsInputPath = " << fi.bAbsInputPath;
|
||||
DEBUG_LOG() << "added fi.bAbsInputPath = " << fi.bAbsInputPath;
|
||||
m_u2_memFiles += fi;
|
||||
}
|
||||
|
||||
@@ -497,8 +496,8 @@ bool Compress::_uncompressBuffer(QIODevice *input)
|
||||
bool Compress::success() const
|
||||
{
|
||||
|
||||
ERROR_LOG(m_logger) << "success? " << (m_future.isFinished() && !m_future.isCanceled() && m_success);
|
||||
ERROR_LOG(m_logger) << "success details: "
|
||||
ERROR_LOG() << "success? " << (m_future.isFinished() && !m_future.isCanceled() && m_success);
|
||||
ERROR_LOG() << "success details: "
|
||||
<< "success m_future.isFinished() = " << (m_future.isFinished())
|
||||
<< " !m_future.isCanceled() = " << !m_future.isCanceled()
|
||||
<< " m_success = " << m_success;
|
||||
@@ -507,22 +506,22 @@ bool Compress::success() const
|
||||
|
||||
bool Compress::waitForFinished()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "waitForFinished...";
|
||||
DEBUG_LOG() << "waitForFinished...";
|
||||
m_future.waitForFinished();
|
||||
DEBUG_LOG(m_logger) << "waitForFinished... done!";
|
||||
DEBUG_LOG() << "waitForFinished... done!";
|
||||
return success();
|
||||
}
|
||||
|
||||
QVector<Compress::FileInformations> Compress::directoryFileList(const QString &dir, bool recursive)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "directoryFileList";
|
||||
DEBUG_LOG() << "directoryFileList";
|
||||
|
||||
QVector<FileInformations> sl_absolute;
|
||||
QDir d(dir);
|
||||
|
||||
if (d.exists())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "exists";
|
||||
DEBUG_LOG() << "exists";
|
||||
const auto entries = d.entryList(QDir::Files);
|
||||
sl_absolute.reserve(sl_absolute.size() + entries.size());
|
||||
for (const QString &entry : entries)
|
||||
@@ -531,20 +530,20 @@ QVector<Compress::FileInformations> Compress::directoryFileList(const QString &d
|
||||
|
||||
if (recursive)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "recursive";
|
||||
DEBUG_LOG() << "recursive";
|
||||
const auto entries = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
sl_absolute.reserve(sl_absolute.size() + entries.size());
|
||||
for (const QString &s : entries)
|
||||
sl_absolute << directoryFileList(dir + QLatin1Char('/') + s, true);
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "done";
|
||||
DEBUG_LOG() << "done";
|
||||
return sl_absolute;
|
||||
}
|
||||
|
||||
void Compress::reset()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "reset";
|
||||
DEBUG_LOG() << "reset";
|
||||
m_u2_memFiles.clear();
|
||||
|
||||
m_lastError.clear();
|
||||
@@ -557,13 +556,13 @@ void Compress::reset()
|
||||
|
||||
void Compress::setupFutureWatcher(const QFuture<bool> &future)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "setupFutureWatcher";
|
||||
DEBUG_LOG() << "setupFutureWatcher";
|
||||
m_future = future;
|
||||
QFutureWatcher<bool> *fw = new QFutureWatcher<bool>(this);
|
||||
QObject::connect(fw, &QObject::destroyed, this, [this]() { DEBUG_LOG(m_logger) << "Future Watcher destroyed"; });
|
||||
QObject::connect(fw, &QObject::destroyed, this, [this]() { DEBUG_LOG() << "Future Watcher destroyed"; });
|
||||
QObject::connect(fw, &QFutureWatcher<bool>::finished, this, &Compress::finished);
|
||||
QObject::connect(fw, &QFutureWatcher<bool>::finished, fw, &QObject::deleteLater);
|
||||
QObject::connect(fw, &QFutureWatcher<bool>::finished, fw, [this]() { DEBUG_LOG(m_logger) << "Future Watcher about to be deleted"; });
|
||||
QObject::connect(fw, &QFutureWatcher<bool>::finished, fw, [this]() { DEBUG_LOG() << "Future Watcher about to be deleted"; });
|
||||
fw->setFuture(m_future);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "nglcomp_export.h"
|
||||
#include "nglcompression_export.h"
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
|
||||
@@ -133,7 +133,6 @@ private:
|
||||
|
||||
QFuture<bool> m_future;
|
||||
bool m_success { false };
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
Q_DECLARE_TYPEINFO(NGL::Compress::FileInformations, Q_MOVABLE_TYPE);
|
||||
|
||||
@@ -25,7 +25,7 @@ SET(ngldb_SRCS
|
||||
sql_query_janitor.h
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV HLA WS ngldb SHARED ${ngldb_SRCS})
|
||||
NGL_ADD_LIBRARY2(AAR SV HLA WS ngldb SHARED ${ngldb_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(ngldb
|
||||
PRIVATE
|
||||
NGLLogger
|
||||
|
||||
@@ -16,7 +16,7 @@ SET(nglsettings_HDRS
|
||||
nglsettings_settings.h
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(ALL nglsettings SHARED ${nglsettings_SRCS} ${nglsettings_HDRS})
|
||||
NGL_ADD_LIBRARY2(ALL nglsettings SHARED ${nglsettings_SRCS} ${nglsettings_HDRS})
|
||||
NGL_TARGET_LINK_LIBRARIES(nglsettings
|
||||
PRIVATE
|
||||
ngltools
|
||||
|
||||
@@ -18,7 +18,7 @@ SET(ngltools_SRCS
|
||||
ngltools_helpevent.h
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(ALL ngltools SHARED ${ngltools_SRCS})
|
||||
NGL_ADD_LIBRARY2(ALL ngltools SHARED ${ngltools_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(ngltools
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
|
||||
@@ -10,7 +10,7 @@ SET(my_SRCS
|
||||
ngltranslator_export.h
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(ALL ngltranslator SHARED ${my_SRCS})
|
||||
NGL_ADD_LIBRARY2(ALL ngltranslator SHARED ${my_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(ngltranslator
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
|
||||
@@ -42,7 +42,7 @@ else()
|
||||
endif()
|
||||
|
||||
# SV: logView
|
||||
NGL_ADD_LIBRARY(WS AAR SV nglwidgets SHARED ${nglwidgets_SRCS} ${oxygen_SRCS})
|
||||
NGL_ADD_LIBRARY2(WS AAR SV nglwidgets SHARED ${nglwidgets_SRCS} ${oxygen_SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(nglwidgets
|
||||
PRIVATE
|
||||
${POPPLER_QT6_INCLUDE_DIR}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
NGLMainWindow::NGLMainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, m_helpProcess(nullptr)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("NGLMainWindow"))
|
||||
, m_versionView(nullptr)
|
||||
, m_menuBar(new QMenuBar(this))
|
||||
{
|
||||
@@ -46,7 +45,7 @@ void NGLMainWindow::onHelpIndex()
|
||||
void NGLMainWindow::onInvokeHelp(const QString &helpContext)
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "onInvokeHelp " << helpContext ;
|
||||
DEBUG_LOG() << "onInvokeHelp " << helpContext ;
|
||||
|
||||
if (!m_helpProcess)
|
||||
{
|
||||
@@ -61,11 +60,11 @@ void NGLMainWindow::onInvokeHelp(const QString &helpContext)
|
||||
args << QLatin1String("-collectionFile")
|
||||
<< QCoreApplication::applicationDirPath() + QLatin1String("/../help/scms/") + fn
|
||||
<< QLatin1String("-enableRemoteControl");
|
||||
DEBUG_LOG(m_logger) << "Attempting to invoke help at URL: " << args.join(QLatin1String(" ")) ;
|
||||
DEBUG_LOG() << "Attempting to invoke help at URL: " << args.join(QLatin1String(" ")) ;
|
||||
m_helpProcess->start(QLibraryInfo::path(QLibraryInfo::BinariesPath) + QLatin1String("/assistant"), args);
|
||||
if (!m_helpProcess->waitForStarted())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not start help browser (error: "
|
||||
ERROR_LOG() << "Could not start help browser (error: "
|
||||
<< m_helpProcess->error()
|
||||
<< " )" ;
|
||||
delete m_helpProcess;
|
||||
@@ -85,7 +84,7 @@ void NGLMainWindow::onHelpFinished(int exitCode, QProcess::ExitStatus exitStatus
|
||||
{
|
||||
if (exitStatus != QProcess::NormalExit)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "help browser exited with status "
|
||||
WARNING_LOG() << "help browser exited with status "
|
||||
<< exitStatus << " code "
|
||||
<< exitCode << "!" ;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ private:
|
||||
QProcess *m_helpProcess;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QWidget *m_versionView;
|
||||
QMenuBar *m_menuBar;
|
||||
QMap<QString, QMenu *> m_menu;
|
||||
|
||||
@@ -19,7 +19,7 @@ SET(tcp_SRCS
|
||||
SET(tcp_HDRS
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(tcpserver AAR SV SHARED ${tcp_SRCS})
|
||||
NGL_ADD_LIBRARY2(tcpserver AAR SV SHARED ${tcp_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(tcpserver
|
||||
PRIVATE
|
||||
Qt6::Network
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "tcpserver_export.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "tcpserver_export.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "tcpserver_export.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "tcpserver_export.h"
|
||||
#include "sv_export.h"
|
||||
#include <QMap>
|
||||
#include <QPair>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "tcpserver_export.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
class CBI_Sendfile : public CommandInterface
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "commandinterface.h"
|
||||
#include "tcpserver_export.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
class QAbstractSocket;
|
||||
class QByteArray;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <QTcpServer>
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
class WorkerInstance;
|
||||
class CommandInterface;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <QPointer>
|
||||
#include <QObject>
|
||||
|
||||
#include "tcpserver_export.h"
|
||||
#include "sv_export.h"
|
||||
|
||||
class QAbstractSocket;
|
||||
class CommandInterface;
|
||||
|
||||
Reference in new issue
Block a user