hydrogen 1.2.3
Reporter.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2008-2024 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
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
64 void addLine( QString s );
65
66 void waitForFinished();
67
68 static std::set<QProcess *> m_children;
69
70 public:
71
72 Reporter( QProcess *child );
73 ~Reporter();
74
76 static void report( void );
77
79 static void spawn( int argc, char *argv[] );
80
81 static void handleSignal( int nSignal );
82
83public slots:
84
85 void on_readyReadStandardError( void );
86
87 void on_readyReadStandardOutput( void );
88
89 void on_openLog( void );
90
91 void on_finished( int exitCode, QProcess::ExitStatus exitStatus );
92};
93
94#endif
Crash reporter class.
Definition Reporter.h:55
void on_openLog(void)
Definition Reporter.cpp:116
static QString m_sPrefix
Definition Reporter.h:61
static std::set< QProcess * > m_children
Definition Reporter.h:68
Reporter(QProcess *child)
Definition Reporter.cpp:61
void on_readyReadStandardError(void)
Definition Reporter.cpp:102
void on_readyReadStandardOutput(void)
Definition Reporter.cpp:109
QProcess * m_pChild
Definition Reporter.h:58
std::deque< QString > m_lines
Definition Reporter.h:59
void addLine(QString s)
Definition Reporter.cpp:35
void on_finished(int exitCode, QProcess::ExitStatus exitStatus)
Definition Reporter.cpp:122
static void report(void)
Report some crash details in a crashing child (mostly, the Logger 'crash context' string)
Definition Reporter.cpp:89
void waitForFinished()
Definition Reporter.cpp:80
static void handleSignal(int nSignal)
Definition Reporter.cpp:193
static void spawn(int argc, char *argv[])
Potentially spawn child process.
Definition Reporter.cpp:215
QString m_sContext
Definition Reporter.h:62