Git commit 509ad8a79949e1931e54f11c0f6cf59886c4f61d by Boudewijn Rempt.
Committed on 07/10/2020 at 08:49.
Pushed by rempt into branch 'master'.
Add logs to the bug report dialog
Remove the compiler label; it's not filled in. And add a text
edit field with the combined sysinfo, log and crash log files,
and place the contents on the clipboard for easy pasting.
It's a pity we cannot use the bugzilla REST api to automatically
add these files as an attachment.
>From now on, we can simply ask people to report bugs using the
dialog and add this information.
CCMAIL:kimageshop@kde.org
(cherry picked from commit 31b00a47a487ced1f44619cfeecd5494a8886b31)
M +42 -7 libs/widgetutils/xmlgui/kbugreport.cpp
https://invent.kde.org/graphics/krita/commit/509ad8a79949e1931e54f11c0f6cf5=
9886c4f61d
diff --git a/libs/widgetutils/xmlgui/kbugreport.cpp b/libs/widgetutils/xmlg=
ui/kbugreport.cpp
index 8faca7ece0..330adfb411 100644
--- a/libs/widgetutils/xmlgui/kbugreport.cpp
+++ b/libs/widgetutils/xmlgui/kbugreport.cpp
@@ -37,6 +37,9 @@
#include Please read this guide for re=
porting bugs first! To submit a bug report, click on the button be=
low. This will open a web browser "
"window on http=
s://bugs.kde.org where you will find "
- "a form to fill in. The information displayed abov=
e will be transferred to that server.
Please paste the Additional Information con= tents into the bug report!
" + ""); QLabel *label =3D new QLabel(text, this); label->setOpenExternalLinks(true); label->setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::LinksA= ccessibleByKeyboard); @@ -183,6 +182,42 @@ KBugReport::KBugReport(const KAboutData &aboutData, QW= idget *_parent) lay->addWidget(label); lay->addSpacing(10); = + tmpLabel =3D new QLabel(i18n("Additional Information. Please add this = to the bug report!"), this); + lay->addWidget(label); + + QByteArray additionalInformation; + QFile sysinfo(QStandardPaths::writableLocation(QStandardPaths::Generic= DataLocation) + "/krita-sysinfo.log"); + if (sysinfo.exists()) { + sysinfo.open(QFile::ReadOnly); + additionalInformation +=3D sysinfo.readAll(); + sysinfo.close(); + } + + additionalInformation +=3D "\n---------------------\n"; + + QFile log(QStandardPaths::writableLocation(QStandardPaths::GenericData= Location) + "/krita.log"); + if (log.exists()) { + log.open(QFile::ReadOnly); + additionalInformation +=3D log.readAll(); + log.close(); + } + + additionalInformation +=3D "\n---------------------\n"; + + QFile crashes(QStandardPaths::writableLocation(QStandardPaths::Generic= DataLocation) + "/krita-crash.log"); + if (crashes.exists()) { + crashes.open(QFile::ReadOnly); + additionalInformation +=3D crashes.readAll(); + crashes.close(); + } + + QTextEdit *buginfo =3D new QTextEdit(this); + buginfo->setText(QString::fromUtf8(additionalInformation)); + lay->addWidget(buginfo); + + QClipboard *clipboard =3D QGuiApplication::clipboard(); + clipboard->setText(QString::fromUtf8(additionalInformation)); + d->appcombo->setFocus(); = d->_k_updateUrl();