Trim leftover blank lines in nglapplication sources
This commit is contained in:
1 parent
a32481de09
commit
23cf641d36
10 files changed
+6
-50
No files matched your search
@@ -21,7 +21,6 @@ else()
|
|||||||
set(Qt6_Widgets "")
|
set(Qt6_Widgets "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
SET(nglapplication_SRCS
|
SET(nglapplication_SRCS
|
||||||
nglapplication.cpp
|
nglapplication.cpp
|
||||||
nglapplication.h
|
nglapplication.h
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "nglapplication.h"
|
#include "nglapplication.h"
|
||||||
#include "ngl_signal_handler.inc"
|
#include "ngl_signal_handler.inc"
|
||||||
|
|
||||||
|
|
||||||
NGLApplication::NGLApplication(int &argc, char **argv)
|
NGLApplication::NGLApplication(int &argc, char **argv)
|
||||||
: QApplication(argc, argv)
|
: QApplication(argc, argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
signal(SIGTERM, &signalHandler);
|
signal(SIGTERM, &signalHandler);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
installNativeEventFilter(new MyEventFilter);
|
installNativeEventFilter(new MyEventFilter);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool NGLApplication::notify(QObject *o, QEvent *e)
|
bool NGLApplication::notify(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
bool bRet = false;
|
bool bRet = false;
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "nglcoreapplication.h"
|
#include "nglcoreapplication.h"
|
||||||
|
|
||||||
#include "ngl_signal_handler.inc"
|
#include "ngl_signal_handler.inc"
|
||||||
|
|
||||||
|
|
||||||
NGLCoreApplication::NGLCoreApplication(int &argc, char **argv)
|
NGLCoreApplication::NGLCoreApplication(int &argc, char **argv)
|
||||||
: QCoreApplication(argc, argv)
|
: QCoreApplication(argc, argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
signal(SIGTERM, &signalHandler);
|
signal(SIGTERM, &signalHandler);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
installNativeEventFilter(new MyEventFilter);
|
installNativeEventFilter(new MyEventFilter);
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "nglguiapplication.h"
|
#include "nglguiapplication.h"
|
||||||
|
|
||||||
#include "ngl_signal_handler.inc"
|
#include "ngl_signal_handler.inc"
|
||||||
|
|
||||||
|
|
||||||
NGLGuiApplication::NGLGuiApplication(int &argc, char **argv)
|
NGLGuiApplication::NGLGuiApplication(int &argc, char **argv)
|
||||||
: QGuiApplication(argc, argv)
|
: QGuiApplication(argc, argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
signal(SIGTERM, &signalHandler);
|
signal(SIGTERM, &signalHandler);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
installNativeEventFilter(new MyEventFilter);
|
installNativeEventFilter(new MyEventFilter);
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtGui/QGuiApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "nglloggerhandler.h"
|
#include "nglloggerhandler.h"
|
||||||
#include "ngl_qt_msg_handler.inc"
|
#include "ngl_qt_msg_handler.inc"
|
||||||
|
|
||||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include <nglsettings/nglsettings_settings.h>
|
#include <nglsettings/nglsettings_settings.h>
|
||||||
#include <nglcoreapplication.h>
|
#include <nglcoreapplication.h>
|
||||||
@@ -22,13 +18,11 @@ static QByteArray username()
|
|||||||
|
|
||||||
static void setEnvVars()
|
static void setEnvVars()
|
||||||
{
|
{
|
||||||
|
|
||||||
const QString logPath = NGL::Settings::logPath();
|
const QString logPath = NGL::Settings::logPath();
|
||||||
qputenv("LOG4QT_LOGDIR", logPath.toLocal8Bit());
|
qputenv("LOG4QT_LOGDIR", logPath.toLocal8Bit());
|
||||||
qputenv("LOG4QT_USER", username());
|
qputenv("LOG4QT_USER", username());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LoggerHandler::createLogger(const QByteArray &baseName, const char *configFileName, bool quiet)
|
void LoggerHandler::createLogger(const QByteArray &baseName, const char *configFileName, bool quiet)
|
||||||
{
|
{
|
||||||
setEnvVars();
|
setEnvVars();
|
||||||
@@ -41,12 +35,10 @@ void LoggerHandler::createLogger(const QByteArray &baseName, const char *configF
|
|||||||
|
|
||||||
const QString logOutputName = m_loggerFilenamePostfix + m_loggerFilenamePrefix;
|
const QString logOutputName = m_loggerFilenamePostfix + m_loggerFilenamePrefix;
|
||||||
NGL::NGLLoggerBootstrap::createNGLRootLogger(QString::fromLatin1(configFileName), false, logOutputName, quiet);
|
NGL::NGLLoggerBootstrap::createNGLRootLogger(QString::fromLatin1(configFileName), false, logOutputName, quiet);
|
||||||
|
|
||||||
|
|
||||||
qInstallMessageHandler(&qtMsgHandler);
|
qInstallMessageHandler(&qtMsgHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LoggerHandler::createLogger(const QByteArray &baseName, int exerciseId, int additionalId, bool quiet)
|
void LoggerHandler::createLogger(const QByteArray &baseName, int exerciseId, int additionalId, bool quiet)
|
||||||
{
|
{
|
||||||
setEnvVars();
|
setEnvVars();
|
||||||
@@ -64,25 +56,20 @@ void LoggerHandler::createLogger(const QByteArray &baseName, int exerciseId, int
|
|||||||
m_baseLoggerName = baseName + QByteArray(".main");
|
m_baseLoggerName = baseName + QByteArray(".main");
|
||||||
|
|
||||||
const QString logOutputName = m_loggerFilenamePostfix + m_loggerFilenamePrefix;
|
const QString logOutputName = m_loggerFilenamePostfix + m_loggerFilenamePrefix;
|
||||||
NGL::NGLLoggerBootstrap::createNGLRootLogger(configFileName, false, logOutputName, quiet);
|
NGL::NGLLoggerBootstrap::createNGLRootLogger(configFileName, false, logOutputName, quiet);
|
||||||
|
|
||||||
|
|
||||||
qInstallMessageHandler(&qtMsgHandler);
|
qInstallMessageHandler(&qtMsgHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NGL::INGLLogger &LoggerHandler::baseLogger() const
|
NGL::INGLLogger &LoggerHandler::baseLogger() const
|
||||||
{
|
{
|
||||||
return NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger(m_baseLoggerName.data());
|
return NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger(m_baseLoggerName.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NGL::INGLLogger &LoggerHandler::logger(const char *loggerName) const
|
NGL::INGLLogger &LoggerHandler::logger(const char *loggerName) const
|
||||||
{
|
{
|
||||||
return NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger(loggerName);
|
return NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger(loggerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LoggerHandler *LoggerHandler::getLoggerHandler()
|
LoggerHandler *LoggerHandler::getLoggerHandler()
|
||||||
{
|
{
|
||||||
return dynamic_cast<LoggerHandler*>(QCoreApplication::instance());
|
return dynamic_cast<LoggerHandler*>(QCoreApplication::instance());
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtSingleApplication/QtSingleApplication>
|
#include <QtSingleApplication/QtSingleApplication>
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "nglsinglecoreapplication.h"
|
#include "nglsinglecoreapplication.h"
|
||||||
|
|
||||||
#include "ngl_signal_handler.inc"
|
#include "ngl_signal_handler.inc"
|
||||||
|
|
||||||
|
|
||||||
NGLSingleCoreApplication::NGLSingleCoreApplication(int &argc, char **argv)
|
NGLSingleCoreApplication::NGLSingleCoreApplication(int &argc, char **argv)
|
||||||
: QtSingleCoreApplication(argc, argv)
|
: QtSingleCoreApplication(argc, argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
signal(SIGTERM, &signalHandler);
|
signal(SIGTERM, &signalHandler);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
installNativeEventFilter(new MyEventFilter);
|
installNativeEventFilter(new MyEventFilter);
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtSingleApplication/QtSingleCoreApplication>
|
#include <QtSingleApplication/QtSingleCoreApplication>
|
||||||
|
|||||||
Reference in new issue
Block a user