Prevent empty segfault reports

This commit is contained in:
Florian Bruhin 2017-10-13 07:52:55 +02:00
parent 35d5038ab1
commit 2bf9a81451

View File

@ -32,7 +32,7 @@ import pkg_resources
from PyQt5.QtCore import pyqtSlot, Qt, QSize
from PyQt5.QtWidgets import (QDialog, QLabel, QTextEdit, QPushButton,
QVBoxLayout, QHBoxLayout, QCheckBox,
QDialogButtonBox, QApplication)
QDialogButtonBox, QApplication, QMessageBox)
import qutebrowser
from qutebrowser.utils import version, log, utils, objreg, usertypes
@ -515,6 +515,23 @@ class FatalCrashDialog(_CrashDialog):
except Exception:
self._crash_info.append(("History", traceback.format_exc()))
@pyqtSlot()
def on_report_clicked(self):
"""Prevent empty reports."""
if (not self._info.toPlainText().strip() and
not self._contact.toPlainText().strip() and
self._type == 'Segmentation fault' and
self._func == 'qt_mainloop'):
msgbox.msgbox(parent=self, title='Empty crash info',
text="Empty reports for fatal crashes are useless "
"and mean I'll spend time deleting reports I could "
"spend on developing qutebrowser instead.\n\nPlease "
"help making qutebrowser better by providing more "
"information, or don't report this.",
icon=QMessageBox.Critical)
else:
super().on_report_clicked()
class ReportDialog(_CrashDialog):