|
1 |
| -/*************************************************************************** |
2 |
| - qgscrashreport.h - QgsCrashReport |
3 |
| -
|
4 |
| - --------------------- |
5 |
| - begin : 16.4.2017 |
6 |
| - copyright : (C) 2017 by Nathan Woodrow |
7 |
| - email : woodrow.nathan@gmail.com |
8 |
| - *************************************************************************** |
9 |
| - * * |
10 |
| - * This program is free software; you can redistribute it and/or modify * |
11 |
| - * it under the terms of the GNU General Public License as published by * |
12 |
| - * the Free Software Foundation; either version 2 of the License, or * |
13 |
| - * (at your option) any later version. * |
14 |
| - * * |
15 |
| - ***************************************************************************/ |
16 |
| -#ifndef QGSCRASHREPORT_H |
17 |
| -#define QGSCRASHREPORT_H |
18 |
| - |
19 |
| -#include "qgsstacktrace.h" |
20 |
| - |
21 |
| -#include <QObject> |
22 |
| -#include <QVector> |
23 |
| - |
24 |
| - |
25 |
| -/** |
26 |
| - * Include information to generate user friendly crash report for QGIS. |
27 |
| - */ |
28 |
| -class QgsCrashReport |
29 |
| -{ |
30 |
| - public: |
31 |
| - |
32 |
| - /** |
33 |
| - * Include information to generate user friendly crash report for QGIS. |
34 |
| - */ |
35 |
| - QgsCrashReport(); |
36 |
| - |
37 |
| - public: |
38 |
| - enum Flag |
39 |
| - { |
40 |
| - Stack = 1 << 0, |
41 |
| - Plugins = 1 << 1, |
42 |
| - ProjectDetails = 1 << 2, |
43 |
| - SystemInfo = 1 << 3, |
44 |
| - QgisInfo = 1 << 4, |
45 |
| - All = Stack | Plugins | ProjectDetails | SystemInfo | QgisInfo |
46 |
| - }; |
47 |
| - Q_DECLARE_FLAGS( Flags, Flag ) |
48 |
| - |
49 |
| - /** |
50 |
| - * Sets the stack trace for the crash report. |
51 |
| - * \param value A string list for each line in the stack trace. |
52 |
| - */ |
53 |
| - void setStackTrace( QgsStackTrace *value ) { mStackTrace = value; } |
54 |
| - |
55 |
| - /** |
56 |
| - * Returns the stack trace for this report. |
57 |
| - * \return A string list for each line in the stack trace. |
58 |
| - */ |
59 |
| - QgsStackTrace *StackTrace() const { return mStackTrace; } |
60 |
| - |
61 |
| - /** |
62 |
| - * Set the flags to mark which features are included in this crash report. |
63 |
| - * \param flags The flag for each feature. |
64 |
| - */ |
65 |
| - void setFlags( QgsCrashReport::Flags flags ); |
66 |
| - |
67 |
| - /** |
68 |
| - * Returns the include flags that have been set for this report. |
69 |
| - * \return The flags marking what details are included in this report. |
70 |
| - */ |
71 |
| - Flags flags() const { return mFlags; } |
72 |
| - |
73 |
| - const QString toMarkdown(); |
74 |
| - |
75 |
| - /** |
76 |
| - * Generate a string version of the report. |
77 |
| - * \return A formatted string including all the information from the report. |
78 |
| - */ |
79 |
| - const QString toHtml() const; |
80 |
| - |
81 |
| - /** |
82 |
| - * Generates a crash ID for the crash report. |
83 |
| - * \return |
84 |
| - */ |
85 |
| - const QString crashID() const; |
86 |
| - |
87 |
| - void exportToCrashFolder(); |
88 |
| - |
89 |
| - QString crashReportFolder(); |
90 |
| - |
91 |
| - void setVersionInfo( const QStringList &versionInfo ) { mVersionInfo = versionInfo; } |
92 |
| - |
93 |
| - private: |
94 |
| - Flags mFlags; |
95 |
| - QgsStackTrace *mStackTrace; |
96 |
| - QStringList mVersionInfo; |
97 |
| -}; |
98 |
| - |
99 |
| -Q_DECLARE_OPERATORS_FOR_FLAGS( QgsCrashReport::Flags ) |
100 |
| - |
101 |
| -#endif // QGSCRASHREPORT_H |
| 1 | +/*************************************************************************** |
| 2 | + qgscrashreport.h - QgsCrashReport |
| 3 | +
|
| 4 | + --------------------- |
| 5 | + begin : 16.4.2017 |
| 6 | + copyright : (C) 2017 by Nathan Woodrow |
| 7 | + email : woodrow.nathan@gmail.com |
| 8 | + *************************************************************************** |
| 9 | + * * |
| 10 | + * This program is free software; you can redistribute it and/or modify * |
| 11 | + * it under the terms of the GNU General Public License as published by * |
| 12 | + * the Free Software Foundation; either version 2 of the License, or * |
| 13 | + * (at your option) any later version. * |
| 14 | + * * |
| 15 | + ***************************************************************************/ |
| 16 | +#ifndef QGSCRASHREPORT_H |
| 17 | +#define QGSCRASHREPORT_H |
| 18 | + |
| 19 | +#include "qgsstacktrace.h" |
| 20 | + |
| 21 | +#include <QObject> |
| 22 | +#include <QVector> |
| 23 | + |
| 24 | + |
| 25 | +/** |
| 26 | + * Include information to generate user friendly crash report for QGIS. |
| 27 | + */ |
| 28 | +class QgsCrashReport |
| 29 | +{ |
| 30 | + public: |
| 31 | + |
| 32 | + /** |
| 33 | + * Include information to generate user friendly crash report for QGIS. |
| 34 | + */ |
| 35 | + QgsCrashReport(); |
| 36 | + |
| 37 | + public: |
| 38 | + enum Flag |
| 39 | + { |
| 40 | + Stack = 1 << 0, |
| 41 | + Plugins = 1 << 1, |
| 42 | + ProjectDetails = 1 << 2, |
| 43 | + SystemInfo = 1 << 3, |
| 44 | + QgisInfo = 1 << 4, |
| 45 | + All = Stack | Plugins | ProjectDetails | SystemInfo | QgisInfo |
| 46 | + }; |
| 47 | + Q_DECLARE_FLAGS( Flags, Flag ) |
| 48 | + |
| 49 | + /** |
| 50 | + * Sets the stack trace for the crash report. |
| 51 | + * \param value A string list for each line in the stack trace. |
| 52 | + */ |
| 53 | + void setStackTrace( QgsStackTrace *value ) { mStackTrace = value; } |
| 54 | + |
| 55 | + /** |
| 56 | + * Returns the stack trace for this report. |
| 57 | + * \return A string list for each line in the stack trace. |
| 58 | + */ |
| 59 | + QgsStackTrace *StackTrace() const { return mStackTrace; } |
| 60 | + |
| 61 | + /** |
| 62 | + * Set the flags to mark which features are included in this crash report. |
| 63 | + * \param flags The flag for each feature. |
| 64 | + */ |
| 65 | + void setFlags( QgsCrashReport::Flags flags ); |
| 66 | + |
| 67 | + /** |
| 68 | + * Returns the include flags that have been set for this report. |
| 69 | + * \return The flags marking what details are included in this report. |
| 70 | + */ |
| 71 | + Flags flags() const { return mFlags; } |
| 72 | + |
| 73 | + const QString toMarkdown(); |
| 74 | + |
| 75 | + /** |
| 76 | + * Generate a string version of the report. |
| 77 | + * \return A formatted string including all the information from the report. |
| 78 | + */ |
| 79 | + const QString toHtml() const; |
| 80 | + |
| 81 | + /** |
| 82 | + * Generates a crash ID for the crash report. |
| 83 | + * \return |
| 84 | + */ |
| 85 | + const QString crashID() const; |
| 86 | + |
| 87 | + void exportToCrashFolder(); |
| 88 | + |
| 89 | + QString crashReportFolder(); |
| 90 | + |
| 91 | + void setVersionInfo( const QStringList &versionInfo ) { mVersionInfo = versionInfo; } |
| 92 | + |
| 93 | + private: |
| 94 | + Flags mFlags; |
| 95 | + QgsStackTrace *mStackTrace; |
| 96 | + QStringList mVersionInfo; |
| 97 | +}; |
| 98 | + |
| 99 | +Q_DECLARE_OPERATORS_FOR_FLAGS( QgsCrashReport::Flags ) |
| 100 | + |
| 101 | +#endif // QGSCRASHREPORT_H |
0 commit comments