forked from radareorg/iaito
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBugReporting.cpp
More file actions
45 lines (42 loc) · 1.77 KB
/
BugReporting.cpp
File metadata and controls
45 lines (42 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "BugReporting.h"
#include "Iaito.h"
#include <QUrl>
#include <QJsonObject>
#include "IaitoConfig.h"
#include <QDesktopServices>
void openIssue()
{
QString url, osInfo, format, arch, type;
//Pull in info needed for git issue
osInfo = QSysInfo::productType() + " " +
(QSysInfo::productVersion() == "unknown"
? ""
: QSysInfo::productVersion());
QJsonDocument docu = Core()->getFileInfo();
QJsonObject coreObj = docu.object()["core"].toObject();
QJsonObject binObj = docu.object()["bin"].toObject();
if (!binObj.QJsonObject::isEmpty()) {
format = coreObj["format"].toString();
arch = binObj["arch"].toString();
if (!binObj["type"].isUndefined()) {
type = coreObj["type"].toString();
} else {
type = "N/A";
}
} else {
format = coreObj["format"].toString();
arch = "N/A";
type = "N/A";
}
url =
"https://github.com/radareorg/iaito/issues/new?&body=**Environment information**\n* Operating System: "
+ osInfo + "\n* Iaito version: " + IAITO_VERSION_FULL +
"\n* File format: " + format + "\n * Arch: " + arch + "\n * Type: " + type +
"\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\n"
"Steps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n"
"4. See error\n\n**Expected behavior**\n"
"A clear and concise description of what you expected to happen.\n\n"
"**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n"
"**Additional context**\nAdd any other context about the problem here.";
QDesktopServices::openUrl(QUrl(url, QUrl::TolerantMode));
}