Commit c3acbc46 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

CrashHandler: Use Qt5-style connects

The heavy lifting was done by clazy.

Change-Id: I236fca3e8741d0e8ff510045dc7e51dda076546a
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent f5560579
......@@ -49,11 +49,14 @@ public:
BacktraceCollector::BacktraceCollector(QObject *parent) :
QObject(parent), d(new BacktraceCollectorPrivate)
{
connect(&d->debugger, SIGNAL(finished(int,QProcess::ExitStatus)),
SLOT(onDebuggerFinished(int,QProcess::ExitStatus)));
connect(&d->debugger, SIGNAL(error(QProcess::ProcessError)),
SLOT(onDebuggerError(QProcess::ProcessError)));
connect(&d->debugger, SIGNAL(readyRead()), SLOT(onDebuggerOutputAvailable()));
connect(&d->debugger,
static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
this, &BacktraceCollector::onDebuggerFinished);
connect(&d->debugger,
static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
this, &BacktraceCollector::onDebuggerError);
connect(&d->debugger, &QIODevice::readyRead,
this, &BacktraceCollector::onDebuggerOutputAvailable);
d->debugger.setProcessChannelMode(QProcess::MergedChannels);
}
......
......@@ -45,12 +45,11 @@ signals:
void backtrace(const QString &backtrace);
void backtraceChunk(const QString &chunk);
private slots:
private:
void onDebuggerOutputAvailable();
void onDebuggerFinished(int exitCode, QProcess::ExitStatus exitStatus);
void onDebuggerError(QProcess::ProcessError err);
private:
QString createTemporaryCommandFile();
BacktraceCollectorPrivate *d;
......
......@@ -103,9 +103,11 @@ public:
CrashHandler::CrashHandler(pid_t pid, const QString &signalName, QObject *parent)
: QObject(parent), d(new CrashHandlerPrivate(pid, signalName, this))
{
connect(&d->backtraceCollector, SIGNAL(error(QString)), SLOT(onError(QString)));
connect(&d->backtraceCollector, SIGNAL(backtraceChunk(QString)), SLOT(onBacktraceChunk(QString)));
connect(&d->backtraceCollector, SIGNAL(backtrace(QString)), SLOT(onBacktraceFinished(QString)));
connect(&d->backtraceCollector, &BacktraceCollector::error, this, &CrashHandler::onError);
connect(&d->backtraceCollector, &BacktraceCollector::backtraceChunk,
this, &CrashHandler::onBacktraceChunk);
connect(&d->backtraceCollector, &BacktraceCollector::backtrace,
this, &CrashHandler::onBacktraceFinished);
d->dialog.appendDebugInfo(collectKernelVersionInfo());
d->dialog.appendDebugInfo(collectLinuxDistributionInfo());
......
......@@ -43,7 +43,6 @@ public:
void run();
public slots:
void onError(const QString &errorMessage);
void onBacktraceChunk(const QString &chunk);
void onBacktraceFinished(const QString &backtrace);
......
......@@ -59,10 +59,13 @@ CrashHandlerDialog::CrashHandlerDialog(CrashHandler *handler, const QString &sig
QIcon icon = style->standardIcon(QStyle::SP_MessageBoxCritical);
m_ui->iconLabel->setPixmap(icon.pixmap(iconSize, iconSize));
connect(m_ui->copyToClipBoardButton, SIGNAL(clicked()), this, SLOT(copyToClipboardClicked()));
connect(m_ui->reportBugButton, SIGNAL(clicked()), m_crashHandler, SLOT(openBugTracker()));
connect(m_ui->debugAppButton, SIGNAL(clicked()), m_crashHandler, SLOT(debugApplication()));
connect(m_ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));
connect(m_ui->copyToClipBoardButton, &QAbstractButton::clicked,
this, &CrashHandlerDialog::copyToClipboardClicked);
connect(m_ui->reportBugButton, &QAbstractButton::clicked,
m_crashHandler, &CrashHandler::openBugTracker);
connect(m_ui->debugAppButton, &QAbstractButton::clicked,
m_crashHandler, &CrashHandler::debugApplication);
connect(m_ui->closeButton, &QAbstractButton::clicked, this, &CrashHandlerDialog::close);
setApplicationInfo(signalName);
}
......
......@@ -52,11 +52,10 @@ public:
void disableDebugAppButton();
bool runDebuggerWhileBacktraceNotFinished();
private slots:
private:
void copyToClipboardClicked();
void close();
private:
CrashHandler *m_crashHandler;
Ui::CrashHandlerDialog *m_ui;
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment