File tree 2 files changed +22
-12
lines changed
2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,27 @@ static const int maxSimultaneousProcesses = 100;
30
30
typedef unsigned long long mark_t ;
31
31
static const mark_t maxMark = ULONG_MAX;
32
32
33
+ LoggingQProcess::LoggingQProcess (const QString filename)
34
+ : QProcess(), log()
35
+ {
36
+ if (CommandLineParser::instance ()->contains (" debug-rules" )) {
37
+ logging = true ;
38
+ QString name = filename;
39
+ name.replace (' /' , ' _' );
40
+ name.prepend (" gitlog-" );
41
+ log .setFileName (name);
42
+ log .open (QIODevice::WriteOnly);
43
+ } else {
44
+ logging = false ;
45
+ }
46
+
47
+ // Trigger a crictical error if any error in the process happens
48
+ connect (this , &QProcess::errorOccurred, this ,
49
+ [this ](QProcess::ProcessError error) {
50
+ qCritical () << " Error happened in fast import process, error code: '" << error <<" '" ;
51
+ });
52
+ };
53
+
33
54
class FastImportRepository : public Repository
34
55
{
35
56
public:
Original file line number Diff line number Diff line change @@ -31,18 +31,7 @@ class LoggingQProcess : public QProcess
31
31
QFile log;
32
32
bool logging;
33
33
public:
34
- LoggingQProcess (const QString filename) : QProcess(), log() {
35
- if (CommandLineParser::instance ()->contains (" debug-rules" )) {
36
- logging = true ;
37
- QString name = filename;
38
- name.replace (' /' , ' _' );
39
- name.prepend (" gitlog-" );
40
- log .setFileName (name);
41
- log .open (QIODevice::WriteOnly);
42
- } else {
43
- logging = false ;
44
- }
45
- };
34
+ LoggingQProcess (const QString filename);
46
35
~LoggingQProcess () {
47
36
if (logging) {
48
37
log .close ();
You can’t perform that action at this time.
0 commit comments