mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-15 22:59:57 +00:00
system source, some code improvements
This commit is contained in:
@ -50,7 +50,7 @@ void AWBugReporter::doConnect()
|
||||
|
||||
|
||||
QString AWBugReporter::generateText(const QString &_description, const QString &_reproduce,
|
||||
const QString &_expected, const QString &_logs) const
|
||||
const QString &_expected, const QString &_logs)
|
||||
{
|
||||
// do not log _logs here, it may have quite large size
|
||||
qCDebug(LOG_AW) << "Generate text with description" << _description << "steps" << _reproduce
|
||||
@ -72,7 +72,7 @@ void AWBugReporter::sendBugReport(const QString &_title, const QString &_body)
|
||||
{
|
||||
qCDebug(LOG_AW) << "Send bug report with title" << _title << "and body" << _body;
|
||||
|
||||
QNetworkAccessManager *manager = new QNetworkAccessManager(nullptr);
|
||||
auto *manager = new QNetworkAccessManager(nullptr);
|
||||
connect(manager, SIGNAL(finished(QNetworkReply *)), this,
|
||||
SLOT(issueReplyRecieved(QNetworkReply *)));
|
||||
|
||||
@ -100,7 +100,7 @@ void AWBugReporter::issueReplyRecieved(QNetworkReply *_reply)
|
||||
return emit(replyReceived(0, ""));
|
||||
}
|
||||
|
||||
QJsonParseError error;
|
||||
QJsonParseError error{};
|
||||
QJsonDocument jsonDoc = QJsonDocument::fromJson(_reply->readAll(), &error);
|
||||
if (error.error != QJsonParseError::NoError) {
|
||||
qCWarning(LOG_AW) << "Parse error" << error.errorString();
|
||||
@ -124,7 +124,7 @@ void AWBugReporter::showInformation(const int _number, const QString &_url)
|
||||
// cache url first
|
||||
m_lastBugUrl = _url;
|
||||
|
||||
QMessageBox *msgBox = new QMessageBox(nullptr);
|
||||
auto *msgBox = new QMessageBox(nullptr);
|
||||
msgBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
msgBox->setModal(false);
|
||||
msgBox->setWindowTitle(i18n("Issue created"));
|
||||
@ -138,7 +138,7 @@ void AWBugReporter::showInformation(const int _number, const QString &_url)
|
||||
|
||||
void AWBugReporter::userReplyOnBugReport(QAbstractButton *_button)
|
||||
{
|
||||
QMessageBox::ButtonRole ret = static_cast<QMessageBox *>(sender())->buttonRole(_button);
|
||||
QMessageBox::ButtonRole ret = dynamic_cast<QMessageBox *>(sender())->buttonRole(_button);
|
||||
qCInfo(LOG_AW) << "User select" << ret;
|
||||
|
||||
switch (ret) {
|
||||
|
Reference in New Issue
Block a user