Qnx: Code cosmetics

Some Qt 5 connects, auto, namespaces, ...

Change-Id: I3e206d95715f988473c9b7c3d01658e6d4d925ae
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-01-23 10:37:02 +01:00
parent 621c834023
commit 1f0594050f
7 changed files with 95 additions and 70 deletions

View File

@@ -46,36 +46,42 @@
#include <utils/portlist.h>
#include <utils/qtcassert.h>
using namespace Qnx;
using namespace Qnx::Internal;
using namespace ProjectExplorer;
namespace Qnx {
namespace Internal {
QnxAttachDebugSupport::QnxAttachDebugSupport(QObject *parent)
: QObject(parent)
, m_kit(0)
, m_runControl(0)
, m_pdebugPort(-1)
{
m_runner = new ProjectExplorer::DeviceApplicationRunner(this);
m_portsGatherer = new ProjectExplorer::DeviceUsedPortsGatherer(this);
m_runner = new DeviceApplicationRunner(this);
m_portsGatherer = new DeviceUsedPortsGatherer(this);
connect(m_portsGatherer, SIGNAL(portListReady()), this, SLOT(launchPDebug()));
connect(m_portsGatherer, SIGNAL(error(QString)), this, SLOT(handleError(QString)));
connect(m_runner, SIGNAL(remoteProcessStarted()), this, SLOT(attachToProcess()));
connect(m_runner, SIGNAL(reportError(QString)), this, SLOT(handleError(QString)));
connect(m_runner, SIGNAL(reportProgress(QString)), this, SLOT(handleProgressReport(QString)));
connect(m_runner, SIGNAL(remoteStdout(QByteArray)), this, SLOT(handleRemoteOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteStderr(QByteArray)), this, SLOT(handleRemoteOutput(QByteArray)));
connect(m_portsGatherer, &DeviceUsedPortsGatherer::portListReady,
this, &QnxAttachDebugSupport::launchPDebug);
connect(m_portsGatherer, &DeviceUsedPortsGatherer::error,
this, &QnxAttachDebugSupport::handleError);
connect(m_runner, &DeviceApplicationRunner::remoteProcessStarted,
this, &QnxAttachDebugSupport::attachToProcess);
connect(m_runner, &DeviceApplicationRunner::reportError,
this, &QnxAttachDebugSupport::handleError);
connect(m_runner, &DeviceApplicationRunner::reportProgress,
this, &QnxAttachDebugSupport::handleProgressReport);
connect(m_runner, &DeviceApplicationRunner::remoteStdout,
this, &QnxAttachDebugSupport::handleRemoteOutput);
connect(m_runner, &DeviceApplicationRunner::remoteStderr,
this, &QnxAttachDebugSupport::handleRemoteOutput);
}
void QnxAttachDebugSupport::showProcessesDialog()
{
auto kitChooser = new ProjectExplorer::KitChooser;
kitChooser->setKitMatcher([](const ProjectExplorer::Kit *k){
return k->isValid() && ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k) == Core::Id(Constants::QNX_QNX_OS_TYPE);
auto kitChooser = new KitChooser;
kitChooser->setKitMatcher([](const Kit *k){
return k->isValid() && DeviceTypeKitInformation::deviceTypeId(k) == Core::Id(Constants::QNX_QNX_OS_TYPE);
});
QnxAttachDebugDialog dlg(kitChooser, 0);
dlg.addAcceptButton(ProjectExplorer::DeviceProcessesDialog::tr("&Attach to Process"));
dlg.addAcceptButton(DeviceProcessesDialog::tr("&Attach to Process"));
dlg.showAllDevices();
if (dlg.exec() == QDialog::Rejected)
return;
@@ -84,7 +90,7 @@ void QnxAttachDebugSupport::showProcessesDialog()
if (!m_kit)
return;
m_device = ProjectExplorer::DeviceKitInformation::device(m_kit);
m_device = DeviceKitInformation::device(m_kit);
QTC_ASSERT(m_device, return);
m_process = dlg.currentProcess();
@@ -134,7 +140,7 @@ void QnxAttachDebugSupport::attachToProcess()
}
connect(runControl, &Debugger::DebuggerRunControl::stateChanged,
this, &QnxAttachDebugSupport::handleDebuggerStateChanged);
ProjectExplorer::ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE);
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE);
}
void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state)
@@ -165,3 +171,6 @@ void QnxAttachDebugSupport::stopPDebug()
{
m_runner->stop();
}
} // namespace Internal
} // namespace Qnx