hydrogen 1.2.6
Reporter.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2008-2025 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
4 *
5 * http://www.hydrogen-music.org
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY, without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see https://www.gnu.org/licenses
19 *
20 */
21
22#ifndef REPORTER_H
23#define REPORTER_H
24
25#include <QtGui>
26#include <QtWidgets>
27#include <deque>
28#include <cassert>
29#include <memory>
30#include <iostream>
31#include <set>
32
33
53
54class Reporter : public QObject
55{
56 Q_OBJECT
57
58 QProcess *m_pChild;
59 std::deque< QString > m_lines;
60
61 static QString m_sPrefix;
62 QString m_sContext;
63 static QString m_sLogFile;
64
65 void addLine( QString s );
66
67 void waitForFinished();
68
69 static std::set<QProcess *> m_children;
70
71 public:
72
73 Reporter( QProcess *child );
74 ~Reporter();
75
77 static void report( void );
78
80 static void spawn( int argc, char *argv[] );
81
82 static void handleSignal( int nSignal );
83
84public slots:
85
86 void on_readyReadStandardError( void );
87
88 void on_readyReadStandardOutput( void );
89
90 void on_openLog( void );
91
92 void on_finished( int exitCode, QProcess::ExitStatus exitStatus );
93};
94
95#endif
void on_openLog(void)
Definition Reporter.cpp:125
static QString m_sPrefix
Definition Reporter.h:61
static std::set< QProcess * > m_children
Definition Reporter.h:69
Reporter(QProcess *child)
Definition Reporter.cpp:66
void on_readyReadStandardError(void)
Definition Reporter.cpp:111
void on_readyReadStandardOutput(void)
Definition Reporter.cpp:118
QProcess * m_pChild
Definition Reporter.h:58
static QString m_sLogFile
Definition Reporter.h:63
std::deque< QString > m_lines
Definition Reporter.h:59
void addLine(QString s)
Definition Reporter.cpp:40
void on_finished(int exitCode, QProcess::ExitStatus exitStatus)
Definition Reporter.cpp:131
static void report(void)
Report some crash details in a crashing child (mostly, the Logger 'crash context' string)
Definition Reporter.cpp:98
void waitForFinished()
Definition Reporter.cpp:89
static void handleSignal(int nSignal)
Definition Reporter.cpp:203
static void spawn(int argc, char *argv[])
Potentially spawn child process.
Definition Reporter.cpp:225
QString m_sContext
Definition Reporter.h:62