Clang-Tidy and Clazy fixes
This commit is contained in:
@@ -8,6 +8,7 @@ set(SOURCES
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
core/logging.h
|
||||
core/messagehandler.h
|
||||
core/messagereply.h
|
||||
core/workerpool.h
|
||||
|
||||
@@ -54,10 +54,10 @@ static QMap<QString, Level>* sClassLevels = nullptr;
|
||||
static QIODevice *sNullDevice = nullptr;
|
||||
|
||||
//const char* kDefaultLogLevels = "*:3";
|
||||
const char* kDefaultLogLevels = "GstEnginePipeline:2,*:3";
|
||||
const char *kDefaultLogLevels = "GstEnginePipeline:2,*:3";
|
||||
|
||||
static const char *kMessageHandlerMagic = "__logging_message__";
|
||||
static const int kMessageHandlerMagicLength = strlen(kMessageHandlerMagic);
|
||||
static const size_t kMessageHandlerMagicLength = strlen(kMessageHandlerMagic);
|
||||
static QtMessageHandler sOriginalMessageHandler = nullptr;
|
||||
|
||||
template <class T>
|
||||
@@ -280,7 +280,7 @@ QString CXXDemangle(const QString &mangled_function);
|
||||
QString CXXDemangle(const QString &mangled_function) {
|
||||
|
||||
int status = 0;
|
||||
char* demangled_function = abi::__cxa_demangle(mangled_function.toLatin1().constData(), nullptr, nullptr, &status);
|
||||
char *demangled_function = abi::__cxa_demangle(mangled_function.toLatin1().constData(), nullptr, nullptr, &status);
|
||||
if (status == 0) {
|
||||
QString ret = QString::fromLatin1(demangled_function);
|
||||
free(demangled_function);
|
||||
|
||||
@@ -41,6 +41,11 @@
|
||||
namespace logging {
|
||||
|
||||
class NullDevice : public QIODevice {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
NullDevice(QObject *parent = nullptr) : QIODevice(parent) {}
|
||||
|
||||
protected:
|
||||
qint64 readData(char*, qint64) override { return -1; }
|
||||
qint64 writeData(const char*, qint64 len) override { return len; }
|
||||
|
||||
@@ -164,8 +164,9 @@ WorkerPool<HandlerType>::WorkerPool(QObject *parent)
|
||||
worker_count_ = qBound(1, QThread::idealThreadCount() / 2, 4);
|
||||
local_server_name_ = qApp->applicationName().toLower();
|
||||
|
||||
if (local_server_name_.isEmpty())
|
||||
if (local_server_name_.isEmpty()) {
|
||||
local_server_name_ = "workerpool";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -90,12 +90,17 @@
|
||||
|
||||
class FileRefFactory {
|
||||
public:
|
||||
FileRefFactory() = default;
|
||||
virtual ~FileRefFactory() {}
|
||||
virtual TagLib::FileRef *GetFileRef(const QString &filename) = 0;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(FileRefFactory)
|
||||
};
|
||||
|
||||
class TagLibFileRefFactory : public FileRefFactory {
|
||||
public:
|
||||
TagLibFileRefFactory() = default;
|
||||
TagLib::FileRef *GetFileRef(const QString &filename) override {
|
||||
#ifdef Q_OS_WIN32
|
||||
return new TagLib::FileRef(filename.toStdWString().c_str());
|
||||
@@ -103,6 +108,8 @@ class TagLibFileRefFactory : public FileRefFactory {
|
||||
return new TagLib::FileRef(QFile::encodeName(filename).constData());
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
Q_DISABLE_COPY(TagLibFileRefFactory)
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.0)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
|
||||
|
||||
set(SOURCES main.cpp tagreaderworker.cpp)
|
||||
set(HEADERS tagreaderworker.h)
|
||||
|
||||
if(BUILD_WITH_QT6)
|
||||
qt6_wrap_cpp(MOC ${HEADERS})
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
class QIODevice;
|
||||
|
||||
class TagReaderWorker : public AbstractMessageHandler<spb::tagreader::Message> {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TagReaderWorker(QIODevice *socket, QObject *parent = nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user