Qnx: Code cosmetics

Qt 5 connects, namespaces, ...

Change-Id: I887f75627e4ff53f6c5bde20456b809d8f2ad463
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-03-15 09:26:34 +01:00
parent 817db22fb9
commit 76a8e89ec7
13 changed files with 136 additions and 107 deletions

View File

@@ -28,8 +28,8 @@
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
#include <utils/fancylineedit.h> #include <utils/fancylineedit.h>
using namespace Qnx; namespace Qnx {
using namespace Qnx::Internal; namespace Internal {
PathChooserDelegate::PathChooserDelegate(QObject *parent) PathChooserDelegate::PathChooserDelegate(QObject *parent)
: QStyledItemDelegate(parent) : QStyledItemDelegate(parent)
@@ -58,7 +58,7 @@ QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionVi
editor->setAutoFillBackground(true); // To hide the text beneath the editor widget editor->setAutoFillBackground(true); // To hide the text beneath the editor widget
editor->lineEdit()->setMinimumWidth(0); editor->lineEdit()->setMinimumWidth(0);
connect(editor, SIGNAL(browsingFinished()), this, SLOT(emitCommitData())); connect(editor, &Utils::PathChooser::browsingFinished, this, &PathChooserDelegate::emitCommitData);
return editor; return editor;
} }
@@ -101,3 +101,6 @@ void PathChooserDelegate::emitCommitData()
{ {
emit commitData(qobject_cast<QWidget*>(sender())); emit commitData(qobject_cast<QWidget*>(sender()));
} }
} // namespace Internal
} // namespace Qnx

View File

@@ -36,8 +36,8 @@
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace RemoteLinux; using namespace RemoteLinux;
using namespace Qnx; namespace Qnx {
using namespace Qnx::Internal; namespace Internal {
QnxAbstractRunSupport::QnxAbstractRunSupport(QnxRunConfiguration *runConfig, QObject *parent) QnxAbstractRunSupport::QnxAbstractRunSupport(QnxRunConfiguration *runConfig, QObject *parent)
: QObject(parent) : QObject(parent)
@@ -47,8 +47,10 @@ QnxAbstractRunSupport::QnxAbstractRunSupport(QnxRunConfiguration *runConfig, QOb
m_runner = new DeviceApplicationRunner(this); m_runner = new DeviceApplicationRunner(this);
m_portsGatherer = new DeviceUsedPortsGatherer(this); m_portsGatherer = new DeviceUsedPortsGatherer(this);
connect(m_portsGatherer, SIGNAL(error(QString)), SLOT(handleError(QString))); connect(m_portsGatherer, &DeviceUsedPortsGatherer::error,
connect(m_portsGatherer, SIGNAL(portListReady()), SLOT(handlePortListReady())); this, &QnxAbstractRunSupport::handleError);
connect(m_portsGatherer, &DeviceUsedPortsGatherer::portListReady,
this, &QnxAbstractRunSupport::handlePortListReady);
} }
void QnxAbstractRunSupport::handleAdapterSetupRequested() void QnxAbstractRunSupport::handleAdapterSetupRequested()
@@ -124,3 +126,6 @@ bool QnxAbstractRunSupport::setPort(int &port)
} }
return true; return true;
} }
} // namespace Internal
} // namespace Qnx

View File

@@ -32,7 +32,6 @@
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
const QLatin1String QNXConfigDataKey("QNXConfiguration."); const QLatin1String QNXConfigDataKey("QNXConfiguration.");
const QLatin1String QNXConfigCountKey("QNXConfiguration.Count"); const QLatin1String QNXConfigCountKey("QNXConfiguration.Count");
const QLatin1String QNXConfigsFileVersionKey("Version"); const QLatin1String QNXConfigsFileVersionKey("Version");
@@ -52,8 +51,8 @@ QnxConfigurationManager::QnxConfigurationManager(QObject *parent)
m_writer = new Utils::PersistentSettingsWriter(qnxConfigSettingsFileName(), m_writer = new Utils::PersistentSettingsWriter(qnxConfigSettingsFileName(),
QLatin1String("QnxConfigurations")); QLatin1String("QnxConfigurations"));
restoreConfigurations(); restoreConfigurations();
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()), connect(Core::ICore::instance(), &Core::ICore::saveSettingsRequested,
this, SLOT(saveConfigs())); this, &QnxConfigurationManager::saveConfigs);
} }
QnxConfigurationManager *QnxConfigurationManager::instance() QnxConfigurationManager *QnxConfigurationManager::instance()

View File

@@ -44,8 +44,8 @@
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace RemoteLinux; using namespace RemoteLinux;
using namespace Qnx; namespace Qnx {
using namespace Qnx::Internal; namespace Internal {
QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::DebuggerRunControl *runControl) QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::DebuggerRunControl *runControl)
: QnxAbstractRunSupport(runConfig, runControl) : QnxAbstractRunSupport(runConfig, runControl)
@@ -57,12 +57,12 @@ QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::Debug
, m_useQmlDebugger(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useQmlDebugger()) , m_useQmlDebugger(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useQmlDebugger())
{ {
const DeviceApplicationRunner *runner = appRunner(); const DeviceApplicationRunner *runner = appRunner();
connect(runner, SIGNAL(reportError(QString)), SLOT(handleError(QString))); connect(runner, &DeviceApplicationRunner::reportError, this, &QnxDebugSupport::handleError);
connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted())); connect(runner, &DeviceApplicationRunner::remoteProcessStarted, this, &QnxDebugSupport::handleRemoteProcessStarted);
connect(runner, SIGNAL(finished(bool)), SLOT(handleRemoteProcessFinished(bool))); connect(runner, &DeviceApplicationRunner::finished, this, &QnxDebugSupport::handleRemoteProcessFinished);
connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); connect(runner, &DeviceApplicationRunner::reportProgress, this, &QnxDebugSupport::handleProgressReport);
connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); connect(runner, &DeviceApplicationRunner::remoteStdout, this, &QnxDebugSupport::handleRemoteOutput);
connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); connect(runner, &DeviceApplicationRunner::remoteStderr, this, &QnxDebugSupport::handleRemoteOutput);
connect(m_runControl, &Debugger::DebuggerRunControl::requestRemoteSetup, connect(m_runControl, &Debugger::DebuggerRunControl::requestRemoteSetup,
this, &QnxDebugSupport::handleAdapterSetupRequested); this, &QnxDebugSupport::handleAdapterSetupRequested);
@@ -72,10 +72,10 @@ QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::Debug
QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>(); QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>();
m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this); m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this);
connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(handleApplicationOutput(QString,Utils::OutputFormat))); connect(m_slog2Info, &Slog2InfoRunner::output, this, &QnxDebugSupport::handleApplicationOutput);
connect(runner, SIGNAL(remoteProcessStarted()), m_slog2Info, SLOT(start())); connect(runner, &DeviceApplicationRunner::remoteProcessStarted, m_slog2Info, &Slog2InfoRunner::start);
if (qnxDevice->qnxVersion() > 0x060500) if (qnxDevice->qnxVersion() > 0x060500)
connect(m_slog2Info, SIGNAL(commandMissing()), this, SLOT(printMissingWarning())); connect(m_slog2Info, &Slog2InfoRunner::commandMissing, this, &QnxDebugSupport::printMissingWarning);
} }
void QnxDebugSupport::handleAdapterSetupRequested() void QnxDebugSupport::handleAdapterSetupRequested()
@@ -210,3 +210,6 @@ void QnxDebugSupport::handleApplicationOutput(const QString &msg, Utils::OutputF
if (m_runControl) if (m_runControl)
m_runControl->showMessage(msg, Debugger::AppOutput); m_runControl->showMessage(msg, Debugger::AppOutput);
} }
} // namespace Internal
} // namespace Qnx

View File

@@ -38,11 +38,13 @@
#include <QMessageBox> #include <QMessageBox>
using namespace QtSupport; using namespace QtSupport;
using namespace ProjectExplorer;
using namespace RemoteLinux;
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
QnxDeployQtLibrariesDialog::QnxDeployQtLibrariesDialog(const ProjectExplorer::IDevice::ConstPtr &device, QnxDeployQtLibrariesDialog::QnxDeployQtLibrariesDialog(const IDevice::ConstPtr &device,
QWidget *parent) : QWidget *parent) :
QDialog(parent), QDialog(parent),
m_ui(new Ui::QnxDeployQtLibrariesDialog), m_ui(new Ui::QnxDeployQtLibrariesDialog),
@@ -67,27 +69,31 @@ QnxDeployQtLibrariesDialog::QnxDeployQtLibrariesDialog(const ProjectExplorer::ID
m_uploadService = new RemoteLinux::GenericDirectUploadService(this); m_uploadService = new RemoteLinux::GenericDirectUploadService(this);
m_uploadService->setDevice(m_device); m_uploadService->setDevice(m_device);
connect(m_uploadService, SIGNAL(progressMessage(QString)), this, SLOT(updateProgress(QString))); connect(m_uploadService, &AbstractRemoteLinuxDeployService::progressMessage,
connect(m_uploadService, SIGNAL(progressMessage(QString)), this, &QnxDeployQtLibrariesDialog::updateProgress);
m_ui->deployLogWindow, SLOT(appendPlainText(QString))); connect(m_uploadService, &AbstractRemoteLinuxDeployService::progressMessage,
connect(m_uploadService, SIGNAL(errorMessage(QString)), m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText);
m_ui->deployLogWindow, SLOT(appendPlainText(QString))); connect(m_uploadService, &AbstractRemoteLinuxDeployService::errorMessage,
connect(m_uploadService, SIGNAL(warningMessage(QString)), m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText);
m_ui->deployLogWindow, SLOT(appendPlainText(QString))); connect(m_uploadService, &AbstractRemoteLinuxDeployService::warningMessage,
connect(m_uploadService, SIGNAL(stdOutData(QString)), m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText);
m_ui->deployLogWindow, SLOT(appendPlainText(QString))); connect(m_uploadService, &AbstractRemoteLinuxDeployService::stdOutData,
connect(m_uploadService, SIGNAL(stdErrData(QString)), m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText);
m_ui->deployLogWindow, SLOT(appendPlainText(QString))); connect(m_uploadService, &AbstractRemoteLinuxDeployService::stdErrData,
connect(m_uploadService, SIGNAL(finished()), this, SLOT(handleUploadFinished())); m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText);
connect(m_uploadService, &AbstractRemoteLinuxDeployService::finished,
this, &QnxDeployQtLibrariesDialog::handleUploadFinished);
m_processRunner = new QSsh::SshRemoteProcessRunner(this); m_processRunner = new QSsh::SshRemoteProcessRunner(this);
connect(m_processRunner, SIGNAL(connectionError()), connect(m_processRunner, &QSsh::SshRemoteProcessRunner::connectionError,
this, SLOT(handleRemoteProcessError())); this, &QnxDeployQtLibrariesDialog::handleRemoteProcessError);
connect(m_processRunner, SIGNAL(processClosed(int)), connect(m_processRunner, &QSsh::SshRemoteProcessRunner::processClosed,
this, SLOT(handleRemoteProcessCompleted())); this, &QnxDeployQtLibrariesDialog::handleRemoteProcessCompleted);
connect(m_ui->deployButton, SIGNAL(clicked()), this, SLOT(deployLibraries())); connect(m_ui->deployButton, &QAbstractButton::clicked,
connect(m_ui->closeButton, SIGNAL(clicked()), this, SLOT(close())); this, &QnxDeployQtLibrariesDialog::deployLibraries);
connect(m_ui->closeButton, &QAbstractButton::clicked,
this, &QWidget::close);
} }
QnxDeployQtLibrariesDialog::~QnxDeployQtLibrariesDialog() QnxDeployQtLibrariesDialog::~QnxDeployQtLibrariesDialog()
@@ -147,7 +153,7 @@ void QnxDeployQtLibrariesDialog::startUpload()
m_state = Uploading; m_state = Uploading;
QList<ProjectExplorer::DeployableFile> filesToUpload = gatherFiles(); QList<DeployableFile> filesToUpload = gatherFiles();
m_ui->deployProgress->setRange(0, filesToUpload.count()); m_ui->deployProgress->setRange(0, filesToUpload.count());
@@ -214,9 +220,9 @@ void QnxDeployQtLibrariesDialog::handleRemoteProcessCompleted()
} }
} }
QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles() QList<DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles()
{ {
QList<ProjectExplorer::DeployableFile> result; QList<DeployableFile> result;
const int qtVersionId = const int qtVersionId =
m_ui->qtLibraryCombo->itemData(m_ui->qtLibraryCombo->currentIndex()).toInt(); m_ui->qtLibraryCombo->itemData(m_ui->qtLibraryCombo->currentIndex()).toInt();
@@ -243,10 +249,10 @@ QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles()
return result; return result;
} }
QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles( QList<DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles(
const QString &dirPath, const QString &baseDirPath, const QStringList &nameFilters) const QString &dirPath, const QString &baseDirPath, const QStringList &nameFilters)
{ {
QList<ProjectExplorer::DeployableFile> result; QList<DeployableFile> result;
if (dirPath.isEmpty()) if (dirPath.isEmpty())
return result; return result;
@@ -270,7 +276,7 @@ QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles(
remoteDir = fullRemoteDirectory() + QLatin1Char('/') + remoteDir = fullRemoteDirectory() + QLatin1Char('/') +
baseDir.relativeFilePath(dirPath); baseDir.relativeFilePath(dirPath);
} }
result.append(ProjectExplorer::DeployableFile(fileInfo.absoluteFilePath(), remoteDir)); result.append(DeployableFile(fileInfo.absoluteFilePath(), remoteDir));
} }
} }

View File

@@ -133,8 +133,8 @@ void QnxDeviceConfiguration::updateVersionNumber() const
{ {
QEventLoop eventLoop; QEventLoop eventLoop;
SshDeviceProcess versionNumberProcess(sharedFromThis()); SshDeviceProcess versionNumberProcess(sharedFromThis());
QObject::connect(&versionNumberProcess, SIGNAL(finished()), &eventLoop, SLOT(quit())); QObject::connect(&versionNumberProcess, &SshDeviceProcess::finished, &eventLoop, &QEventLoop::quit);
QObject::connect(&versionNumberProcess, SIGNAL(error(QProcess::ProcessError)), &eventLoop, SLOT(quit())); QObject::connect(&versionNumberProcess, &DeviceProcess::error, &eventLoop, &QEventLoop::quit);
StandardRunnable r; StandardRunnable r;
r.executable = QLatin1String("uname"); r.executable = QLatin1String("uname");

View File

@@ -29,8 +29,8 @@
#include <ssh/sshremoteprocessrunner.h> #include <ssh/sshremoteprocessrunner.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
using namespace Qnx; namespace Qnx {
using namespace Qnx::Internal; namespace Internal {
QnxDeviceTester::QnxDeviceTester(QObject *parent) QnxDeviceTester::QnxDeviceTester(QObject *parent)
: ProjectExplorer::DeviceTester(parent) : ProjectExplorer::DeviceTester(parent)
@@ -39,14 +39,18 @@ QnxDeviceTester::QnxDeviceTester(QObject *parent)
, m_currentCommandIndex(-1) , m_currentCommandIndex(-1)
{ {
m_genericTester = new RemoteLinux::GenericLinuxDeviceTester(this); m_genericTester = new RemoteLinux::GenericLinuxDeviceTester(this);
connect(m_genericTester, SIGNAL(progressMessage(QString)), SIGNAL(progressMessage(QString))); connect(m_genericTester, &DeviceTester::progressMessage,
connect(m_genericTester, SIGNAL(errorMessage(QString)), SIGNAL(errorMessage(QString))); this, &DeviceTester::progressMessage);
connect(m_genericTester, SIGNAL(finished(ProjectExplorer::DeviceTester::TestResult)), connect(m_genericTester, &DeviceTester::errorMessage,
SLOT(handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult))); this, &DeviceTester::errorMessage);
connect(m_genericTester, &DeviceTester::finished,
this, &QnxDeviceTester::handleGenericTestFinished);
m_processRunner = new QSsh::SshRemoteProcessRunner(this); m_processRunner = new QSsh::SshRemoteProcessRunner(this);
connect(m_processRunner, SIGNAL(connectionError()), SLOT(handleConnectionError())); connect(m_processRunner, &QSsh::SshRemoteProcessRunner::connectionError,
connect(m_processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int))); this, &QnxDeviceTester::handleConnectionError);
connect(m_processRunner, &QSsh::SshRemoteProcessRunner::processClosed,
this, &QnxDeviceTester::handleProcessFinished);
m_commandsToTest << QLatin1String("awk") m_commandsToTest << QLatin1String("awk")
<< QLatin1String("grep") << QLatin1String("grep")
@@ -168,3 +172,6 @@ QStringList QnxDeviceTester::versionSpecificCommandsToTest(int versionNumber) co
return result; return result;
} }
} // namespace Internal
} // namespace Qnx

View File

@@ -86,7 +86,7 @@ void QnxPlugin::extensionsInitialized()
m_attachToQnxApplication = new QAction(this); m_attachToQnxApplication = new QAction(this);
m_attachToQnxApplication->setText(tr("Attach to remote QNX application...")); m_attachToQnxApplication->setText(tr("Attach to remote QNX application..."));
connect(m_attachToQnxApplication, SIGNAL(triggered()), debugSupport, SLOT(showProcessesDialog())); connect(m_attachToQnxApplication, &QAction::triggered, debugSupport, &QnxAttachDebugSupport::showProcessesDialog);
Core::ActionContainer *mstart = Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING); Core::ActionContainer *mstart = Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING);
mstart->appendGroup(Constants::QNX_DEBUGGING_GROUP); mstart->appendGroup(Constants::QNX_DEBUGGING_GROUP);
@@ -95,7 +95,7 @@ void QnxPlugin::extensionsInitialized()
Core::Command *cmd = Core::ActionManager::registerAction(m_attachToQnxApplication, "Debugger.AttachToQnxApplication"); Core::Command *cmd = Core::ActionManager::registerAction(m_attachToQnxApplication, "Debugger.AttachToQnxApplication");
mstart->addAction(cmd, Constants::QNX_DEBUGGING_GROUP); mstart->addAction(cmd, Constants::QNX_DEBUGGING_GROUP);
connect(KitManager::instance(), SIGNAL(kitsChanged()), this, SLOT(updateDebuggerActions())); connect(KitManager::instance(), &KitManager::kitsChanged, this, &QnxPlugin::updateDebuggerActions);
} }
ExtensionSystem::IPlugin::ShutdownFlag QnxPlugin::aboutToShutdown() ExtensionSystem::IPlugin::ShutdownFlag QnxPlugin::aboutToShutdown()

View File

@@ -32,29 +32,33 @@
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
using namespace Qnx; using namespace ProjectExplorer;
using namespace Qnx::Internal;
using namespace RemoteLinux; using namespace RemoteLinux;
using namespace Utils;
QnxRunControl::QnxRunControl(ProjectExplorer::RunConfiguration *runConfig) namespace Qnx {
namespace Internal {
QnxRunControl::QnxRunControl(RunConfiguration *runConfig)
: RemoteLinuxRunControl(runConfig) : RemoteLinuxRunControl(runConfig)
, m_slog2Info(0) , m_slog2Info(0)
{ {
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit()); IDevice::ConstPtr dev = DeviceKitInformation::device(runConfig->target()->kit());
QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>(); QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>();
QnxRunConfiguration *qnxRunConfig = qobject_cast<QnxRunConfiguration *>(runConfig); QnxRunConfiguration *qnxRunConfig = qobject_cast<QnxRunConfiguration *>(runConfig);
QTC_CHECK(qnxRunConfig); QTC_CHECK(qnxRunConfig);
const QString applicationId = Utils::FileName::fromString(qnxRunConfig->remoteExecutableFilePath()).fileName(); const QString applicationId = FileName::fromString(qnxRunConfig->remoteExecutableFilePath()).fileName();
m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this); m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this);
connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(appendMessage(QString,Utils::OutputFormat))); connect(m_slog2Info, &Slog2InfoRunner::output,
connect(this, SIGNAL(started()), m_slog2Info, SLOT(start())); this, static_cast<void(RunControl::*)(const QString &, OutputFormat)>(&RunControl::appendMessage));
connect(this, &RunControl::started, m_slog2Info, &Slog2InfoRunner::start);
if (qnxDevice->qnxVersion() > 0x060500) if (qnxDevice->qnxVersion() > 0x060500)
connect(m_slog2Info, SIGNAL(commandMissing()), this, SLOT(printMissingWarning())); connect(m_slog2Info, &Slog2InfoRunner::commandMissing, this, &QnxRunControl::printMissingWarning);
} }
ProjectExplorer::RunControl::StopResult QnxRunControl::stop() RunControl::StopResult QnxRunControl::stop()
{ {
m_slog2Info->stop(); m_slog2Info->stop();
return RemoteLinuxRunControl::stop(); return RemoteLinuxRunControl::stop();
@@ -62,5 +66,8 @@ ProjectExplorer::RunControl::StopResult QnxRunControl::stop()
void QnxRunControl::printMissingWarning() void QnxRunControl::printMissingWarning()
{ {
appendMessage(tr("Warning: \"slog2info\" is not found on the device, debug output not available."), Utils::ErrorMessageFormat); appendMessage(tr("Warning: \"slog2info\" is not found on the device, debug output not available."), ErrorMessageFormat);
} }
} // namespace Internal
} // namespace Qnx

View File

@@ -34,8 +34,6 @@
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
#include <qdebug.h>
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
@@ -47,19 +45,19 @@ QnxSettingsWidget::QnxSettingsWidget(QWidget *parent) :
m_ui->setupUi(this); m_ui->setupUi(this);
populateConfigsCombo(); populateConfigsCombo();
connect(m_ui->addButton, SIGNAL(clicked()), connect(m_ui->addButton, &QAbstractButton::clicked,
this, SLOT(addConfiguration())); this, &QnxSettingsWidget::addConfiguration);
connect(m_ui->removeButton, SIGNAL(clicked()), connect(m_ui->removeButton, &QAbstractButton::clicked,
this, SLOT(removeConfiguration())); this, &QnxSettingsWidget::removeConfiguration);
connect(m_ui->configsCombo, SIGNAL(currentIndexChanged(QString)), connect(m_ui->configsCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, SLOT(updateInformation())); this, &QnxSettingsWidget::updateInformation);
connect(m_ui->generateKitsCheckBox, SIGNAL(toggled(bool)), connect(m_ui->generateKitsCheckBox, &QAbstractButton::toggled,
this, SLOT(generateKits(bool))); this, &QnxSettingsWidget::generateKits);
connect(m_qnxConfigManager, SIGNAL(configurationsListUpdated()), connect(m_qnxConfigManager, &QnxConfigurationManager::configurationsListUpdated,
this, SLOT(populateConfigsCombo())); this, &QnxSettingsWidget::populateConfigsCombo);
connect(QtSupport::QtVersionManager::instance(), connect(QtSupport::QtVersionManager::instance(),
SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), &QtSupport::QtVersionManager::qtVersionsChanged,
this, SLOT(updateInformation())); this, &QnxSettingsWidget::updateInformation);
} }
QnxSettingsWidget::~QnxSettingsWidget() QnxSettingsWidget::~QnxSettingsWidget()

View File

@@ -32,6 +32,8 @@
#include <QFormLayout> #include <QFormLayout>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils;
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
@@ -46,10 +48,10 @@ static const QList<Abi> qccSupportedAbis()
return abis; return abis;
} }
static void setQnxEnvironment(Utils::Environment &env, const QList<Utils::EnvironmentItem> &qnxEnv) static void setQnxEnvironment(Environment &env, const QList<EnvironmentItem> &qnxEnv)
{ {
// We only need to set QNX_HOST and QNX_TARGET needed when running qcc // We only need to set QNX_HOST and QNX_TARGET needed when running qcc
foreach (const Utils::EnvironmentItem &item, qnxEnv) { foreach (const EnvironmentItem &item, qnxEnv) {
if (item.name == QLatin1String("QNX_HOST") || if (item.name == QLatin1String("QNX_HOST") ||
item.name == QLatin1String("QNX_TARGET") ) item.name == QLatin1String("QNX_TARGET") )
env.set(item.name, item.value); env.set(item.name, item.value);
@@ -70,7 +72,7 @@ ToolChainConfigWidget *QnxToolChain::configurationWidget()
return new QnxToolChainConfigWidget(this); return new QnxToolChainConfigWidget(this);
} }
void QnxToolChain::addToEnvironment(Utils::Environment &env) const void QnxToolChain::addToEnvironment(Environment &env) const
{ {
if (env.value(QLatin1String("QNX_HOST")).isEmpty() if (env.value(QLatin1String("QNX_HOST")).isEmpty()
|| env.value(QLatin1String("QNX_TARGET")).isEmpty()) || env.value(QLatin1String("QNX_TARGET")).isEmpty())
@@ -79,12 +81,12 @@ void QnxToolChain::addToEnvironment(Utils::Environment &env) const
GccToolChain::addToEnvironment(env); GccToolChain::addToEnvironment(env);
} }
Utils::FileNameList QnxToolChain::suggestedMkspecList() const FileNameList QnxToolChain::suggestedMkspecList() const
{ {
Utils::FileNameList mkspecList; FileNameList mkspecList;
mkspecList << Utils::FileName::fromLatin1("qnx-armv7le-qcc"); mkspecList << FileName::fromLatin1("qnx-armv7le-qcc");
mkspecList << Utils::FileName::fromLatin1("qnx-armle-v7-qcc"); mkspecList << FileName::fromLatin1("qnx-armle-v7-qcc");
mkspecList << Utils::FileName::fromLatin1("qnx-x86-qcc"); mkspecList << FileName::fromLatin1("qnx-x86-qcc");
return mkspecList; return mkspecList;
} }
@@ -179,16 +181,16 @@ ToolChain *QnxToolChainFactory::create()
QnxToolChainConfigWidget::QnxToolChainConfigWidget(QnxToolChain *tc) QnxToolChainConfigWidget::QnxToolChainConfigWidget(QnxToolChain *tc)
: ToolChainConfigWidget(tc) : ToolChainConfigWidget(tc)
, m_compilerCommand(new Utils::PathChooser) , m_compilerCommand(new PathChooser)
, m_ndkPath(new Utils::PathChooser) , m_ndkPath(new PathChooser)
, m_abiWidget(new AbiWidget) , m_abiWidget(new AbiWidget)
{ {
m_compilerCommand->setExpectedKind(Utils::PathChooser::ExistingCommand); m_compilerCommand->setExpectedKind(PathChooser::ExistingCommand);
m_compilerCommand->setHistoryCompleter(QLatin1String("Qnx.ToolChain.History")); m_compilerCommand->setHistoryCompleter(QLatin1String("Qnx.ToolChain.History"));
m_compilerCommand->setFileName(tc->compilerCommand()); m_compilerCommand->setFileName(tc->compilerCommand());
m_compilerCommand->setEnabled(!tc->isAutoDetected()); m_compilerCommand->setEnabled(!tc->isAutoDetected());
m_ndkPath->setExpectedKind(Utils::PathChooser::ExistingDirectory); m_ndkPath->setExpectedKind(PathChooser::ExistingDirectory);
m_ndkPath->setHistoryCompleter(QLatin1String("Qnx.Ndk.History")); m_ndkPath->setHistoryCompleter(QLatin1String("Qnx.Ndk.History"));
m_ndkPath->setPath(tc->ndkPath()); m_ndkPath->setPath(tc->ndkPath());
m_ndkPath->setEnabled(!tc->isAutoDetected()); m_ndkPath->setEnabled(!tc->isAutoDetected());
@@ -201,9 +203,9 @@ QnxToolChainConfigWidget::QnxToolChainConfigWidget(QnxToolChain *tc)
m_mainLayout->addRow(tr("NDK/SDP path:"), m_ndkPath); m_mainLayout->addRow(tr("NDK/SDP path:"), m_ndkPath);
m_mainLayout->addRow(tr("&ABI:"), m_abiWidget); m_mainLayout->addRow(tr("&ABI:"), m_abiWidget);
connect(m_compilerCommand, SIGNAL(rawPathChanged(QString)), this, SIGNAL(dirty())); connect(m_compilerCommand, &PathChooser::rawPathChanged, this, &ToolChainConfigWidget::dirty);
connect(m_ndkPath, SIGNAL(rawPathChanged(QString)), this, SIGNAL(dirty())); connect(m_ndkPath, &PathChooser::rawPathChanged, this, &ToolChainConfigWidget::dirty);
connect(m_abiWidget, SIGNAL(abiChanged()), this, SIGNAL(dirty())); connect(m_abiWidget, &AbiWidget::abiChanged, this, &ToolChainConfigWidget::dirty);
} }
void QnxToolChainConfigWidget::applyImpl() void QnxToolChainConfigWidget::applyImpl()

View File

@@ -47,17 +47,17 @@ Slog2InfoRunner::Slog2InfoRunner(const QString &applicationId,
m_applicationId.truncate(63); m_applicationId.truncate(63);
m_testProcess = new QnxDeviceProcess(device, this); m_testProcess = new QnxDeviceProcess(device, this);
connect(m_testProcess, &ProjectExplorer::DeviceProcess::finished, this, &Slog2InfoRunner::handleTestProcessCompleted); connect(m_testProcess, &DeviceProcess::finished, this, &Slog2InfoRunner::handleTestProcessCompleted);
m_launchDateTimeProcess = new ProjectExplorer::SshDeviceProcess(device, this); m_launchDateTimeProcess = new SshDeviceProcess(device, this);
connect(m_launchDateTimeProcess, &ProjectExplorer::DeviceProcess::finished, this, &Slog2InfoRunner::launchSlog2Info); connect(m_launchDateTimeProcess, &DeviceProcess::finished, this, &Slog2InfoRunner::launchSlog2Info);
m_logProcess = new QnxDeviceProcess(device, this); m_logProcess = new QnxDeviceProcess(device, this);
connect(m_logProcess, &ProjectExplorer::DeviceProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput); connect(m_logProcess, &DeviceProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput);
connect(m_logProcess, &ProjectExplorer::DeviceProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError); connect(m_logProcess, &DeviceProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError);
connect(m_logProcess, &ProjectExplorer::DeviceProcess::error, this, &Slog2InfoRunner::handleLogError); connect(m_logProcess, &DeviceProcess::error, this, &Slog2InfoRunner::handleLogError);
connect(m_logProcess, &ProjectExplorer::DeviceProcess::started, this, &Slog2InfoRunner::started); connect(m_logProcess, &DeviceProcess::started, this, &Slog2InfoRunner::started);
connect(m_logProcess, &ProjectExplorer::DeviceProcess::finished, this, &Slog2InfoRunner::finished); connect(m_logProcess, &DeviceProcess::finished, this, &Slog2InfoRunner::finished);
} }
void Slog2InfoRunner::start() void Slog2InfoRunner::start()

View File

@@ -68,6 +68,7 @@ signals:
void warningMessage(const QString &message); void warningMessage(const QString &message);
void stdOutData(const QString &data); void stdOutData(const QString &data);
void stdErrData(const QString &data); void stdErrData(const QString &data);
void finished(); // Used by Qnx.
protected: protected:
const ProjectExplorer::Target *target() const; const ProjectExplorer::Target *target() const;
@@ -86,8 +87,6 @@ private slots:
void handleConnectionFailure(); void handleConnectionFailure();
private: private:
Q_SIGNAL void finished();
virtual bool isDeploymentNecessary() const = 0; virtual bool isDeploymentNecessary() const = 0;
// Should do things needed *before* connecting. Call handleDeviceSetupDone() afterwards. // Should do things needed *before* connecting. Call handleDeviceSetupDone() afterwards.