diff --git a/tools/cutehmi.daemon.3/src/cutehmi/daemon/CoreData.hpp b/tools/cutehmi.daemon.3/src/cutehmi/daemon/CoreData.hpp index c40d034a..19844183 100644 --- a/tools/cutehmi.daemon.3/src/cutehmi/daemon/CoreData.hpp +++ b/tools/cutehmi.daemon.3/src/cutehmi/daemon/CoreData.hpp @@ -1,45 +1,45 @@ -#ifndef H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_COREDATA_HPP -#define H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_COREDATA_HPP +#ifndef H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_COREDATA_HPP +#define H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_COREDATA_HPP #include #include namespace cutehmi { namespace daemon { struct CoreData { QCoreApplication * app; QCommandLineParser * cmd; QTranslator * qtTranslator; QTranslator * daemonTranslator; QString language; QStringList failedTranslationsFiles; QString translationsDir; QString daemonTranslationFilePrefix; QString daemonTranslationFile; struct Options { QStringList extension; QStringList component; QCommandLineOption app; QCommandLineOption basedir; QCommandLineOption init; QCommandLineOption minor; QCommandLineOption lang; QCommandLineOption pidfile; QCommandLineOption forks; } * opt; }; } } #endif //(c)C: Copyright © 2020, Michał Policht . All rights reserved. //(c)C: This file is a part of CuteHMI. //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see . diff --git a/tools/cutehmi.daemon.3/src/cutehmi/daemon/Daemon.hpp b/tools/cutehmi.daemon.3/src/cutehmi/daemon/Daemon.hpp index 6427236d..b5f45bdb 100644 --- a/tools/cutehmi.daemon.3/src/cutehmi/daemon/Daemon.hpp +++ b/tools/cutehmi.daemon.3/src/cutehmi/daemon/Daemon.hpp @@ -1,53 +1,53 @@ -#ifndef H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_DAEMON_HPP -#define H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_DAEMON_HPP +#ifndef H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_DAEMON_HPP +#define H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_DAEMON_HPP #include "CoreData.hpp" #include namespace cutehmi { namespace daemon { class _Daemon; class Daemon final { public: static constexpr int EXIT_AGAIN = 129; // 128 + SIGHUP (1). Daemon(CoreData * data, std::function & core); ~Daemon(); // Non-virtual destructor, but class is final. int exitCode() const; protected: void setExitCode(int exitCode); int exec(); CoreData * data() const; private: void _init(); void _exec(); void _destroy(); CoreData * m_data; std::function & m_core; int m_exitCode; _Daemon * _daemon; }; } } #endif //(c)C: Copyright © 2020, Michał Policht . All rights reserved. //(c)C: This file is a part of CuteHMI. //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see . diff --git a/tools/cutehmi.daemon.3/src/cutehmi/daemon/Daemon_unix.hpp b/tools/cutehmi.daemon.3/src/cutehmi/daemon/Daemon_unix.hpp index de6fa271..2e4445bb 100644 --- a/tools/cutehmi.daemon.3/src/cutehmi/daemon/Daemon_unix.hpp +++ b/tools/cutehmi.daemon.3/src/cutehmi/daemon/Daemon_unix.hpp @@ -1,65 +1,65 @@ -#ifndef H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_DAEMON_u_UNIX_HPP -#define H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_DAEMON_u_UNIX_HPP +#ifndef H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_DAEMON_u_UNIX_HPP +#define H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_DAEMON_u_UNIX_HPP #include #include #include namespace cutehmi { namespace daemon { class Daemon; /** * Unix-specific daemon helper. */ class _Daemon: public QObject { Q_OBJECT public: static int signalFd[2]; _Daemon(const QString & pidFile); void initializeSignalHandling(); void initializePidFile(); void destroyPidFile(); signals: void exitRequested(int exitCode); private slots: void handleSignal(); private: int createPidFile(); void lockPidFile(); void writePidFile(); void removePidFile(); private: QString m_pidFile; int m_pidFd; std::unique_ptr m_signalSocketNotifier; std::unique_ptr m_unhandledSignalsSocketNotifier; }; } } #endif //(c)C: Copyright © 2020, Michał Policht . All rights reserved. //(c)C: This file is a part of CuteHMI. //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see . diff --git a/tools/cutehmi.daemon.3/src/cutehmi/daemon/Exception.hpp b/tools/cutehmi.daemon.3/src/cutehmi/daemon/Exception.hpp index f3419e1e..68ea28cd 100644 --- a/tools/cutehmi.daemon.3/src/cutehmi/daemon/Exception.hpp +++ b/tools/cutehmi.daemon.3/src/cutehmi/daemon/Exception.hpp @@ -1,27 +1,27 @@ -#ifndef H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_EXCEPTION_HPP -#define H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_EXCEPTION_HPP +#ifndef H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_EXCEPTION_HPP +#define H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_EXCEPTION_HPP #include namespace cutehmi { namespace daemon { class Exception: public ExceptionMixin { typedef ExceptionMixin Parent; public: Exception(const QString & what); }; } } #endif //(c)C: Copyright © 2020, Michał Policht . All rights reserved. //(c)C: This file is a part of CuteHMI. //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see . diff --git a/tools/cutehmi.daemon.3/src/cutehmi/daemon/logging.hpp b/tools/cutehmi.daemon.3/src/cutehmi/daemon/logging.hpp index c16f7f1e..b42b6df3 100644 --- a/tools/cutehmi.daemon.3/src/cutehmi/daemon/logging.hpp +++ b/tools/cutehmi.daemon.3/src/cutehmi/daemon/logging.hpp @@ -1,26 +1,26 @@ -#ifndef H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_LOGGING_HPP -#define H_TOOLS_CUTEHMI_DAEMON_2_SRC_CUTEHMI_DAEMON_LOGGING_HPP +#ifndef H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_LOGGING_HPP +#define H_TOOLS_CUTEHMI_DAEMON_3_SRC_CUTEHMI_DAEMON_LOGGING_HPP #include Q_DECLARE_LOGGING_CATEGORY(cutehmi_daemon_loggingCategory) namespace cutehmi { namespace daemon { inline const QLoggingCategory & loggingCategory() { return cutehmi_daemon_loggingCategory(); } } } #endif //(c)C: Copyright © 2020, Michał Policht . All rights reserved. //(c)C: This file is a part of CuteHMI. //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see . diff --git a/tools/cutehmi.view.4/src/cutehmi/view/logging.hpp b/tools/cutehmi.view.4/src/cutehmi/view/logging.hpp index 95695f95..bf4633e4 100644 --- a/tools/cutehmi.view.4/src/cutehmi/view/logging.hpp +++ b/tools/cutehmi.view.4/src/cutehmi/view/logging.hpp @@ -1,26 +1,26 @@ -#ifndef H_TOOLS_CUTEHMI_VIEW_3_SRC_CUTEHMI_VIEW_LOGGING_HPP -#define H_TOOLS_CUTEHMI_VIEW_3_SRC_CUTEHMI_VIEW_LOGGING_HPP +#ifndef H_TOOLS_CUTEHMI_VIEW_4_SRC_CUTEHMI_VIEW_LOGGING_HPP +#define H_TOOLS_CUTEHMI_VIEW_4_SRC_CUTEHMI_VIEW_LOGGING_HPP #include Q_DECLARE_LOGGING_CATEGORY(cutehmi_view_loggingCategory) namespace cutehmi { namespace view { inline const QLoggingCategory & loggingCategory() { return cutehmi_view_loggingCategory(); } } } #endif //(c)C: Copyright © 2020, Michał Policht . All rights reserved. //(c)C: This file is a part of CuteHMI. //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see .