Commit 6e2738af authored by Denis Shienkov's avatar Denis Shienkov

BareMetal: Do not use QPointer if it is not required

Change-Id: Ib7162ae6b40d06bfb54705fd4b53bde2ce78083c
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: default avatarTim Sander <tim@krieglstein.org>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent b6e4e966
......@@ -159,17 +159,17 @@ void BareMetalDebugSupport::startExecution()
m_state = StartingRunner;
showMessage(tr("Starting GDB server...") + QLatin1Char('\n'), Debugger::LogStatus);
connect(m_appRunner.data(), &ProjectExplorer::DeviceApplicationRunner::remoteStderr,
connect(m_appRunner, &ProjectExplorer::DeviceApplicationRunner::remoteStderr,
this, &BareMetalDebugSupport::remoteErrorOutputMessage);
connect(m_appRunner.data(), &ProjectExplorer::DeviceApplicationRunner::remoteStdout,
connect(m_appRunner, &ProjectExplorer::DeviceApplicationRunner::remoteStdout,
this, &BareMetalDebugSupport::remoteOutputMessage);
connect(m_appRunner.data(), &ProjectExplorer::DeviceApplicationRunner::remoteProcessStarted,
connect(m_appRunner, &ProjectExplorer::DeviceApplicationRunner::remoteProcessStarted,
this, &BareMetalDebugSupport::remoteProcessStarted);
connect(m_appRunner.data(), &ProjectExplorer::DeviceApplicationRunner::finished,
connect(m_appRunner, &ProjectExplorer::DeviceApplicationRunner::finished,
this, &BareMetalDebugSupport::appRunnerFinished);
connect(m_appRunner.data(), &ProjectExplorer::DeviceApplicationRunner::reportProgress,
connect(m_appRunner, &ProjectExplorer::DeviceApplicationRunner::reportProgress,
this, &BareMetalDebugSupport::progressReport);
connect(m_appRunner.data(), &ProjectExplorer::DeviceApplicationRunner::reportError,
connect(m_appRunner, &ProjectExplorer::DeviceApplicationRunner::reportError,
this, &BareMetalDebugSupport::appRunnerError);
const QString cmd = p->executable();
......
......@@ -79,7 +79,7 @@ private:
void reset();
void showMessage(const QString &msg, int channel);
QPointer<ProjectExplorer::DeviceApplicationRunner> m_appRunner;
ProjectExplorer::DeviceApplicationRunner *m_appRunner;
const QPointer<Debugger::DebuggerRunControl> m_runControl;
const ProjectExplorer::IDevice::ConstPtr m_device;
BareMetalDebugSupport::State m_state;
......
......@@ -57,7 +57,7 @@ BareMetalDeviceConfigurationWidget::BareMetalDeviceConfigurationWidget(
m_gdbServerProviderChooser->setCurrentProviderId(dev->gdbServerProviderId());
formLayout->addRow(tr("GDB server provider:"), m_gdbServerProviderChooser);
connect(m_gdbServerProviderChooser.data(), &GdbServerProviderChooser::providerChanged,
connect(m_gdbServerProviderChooser, &GdbServerProviderChooser::providerChanged,
this, &BareMetalDeviceConfigurationWidget::gdbServerProviderChanged);
}
......
......@@ -34,8 +34,6 @@
#include <projectexplorer/devicesupport/idevicewidget.h>
#include <QPointer>
namespace BareMetal {
namespace Internal {
......@@ -56,7 +54,7 @@ private slots:
private:
void updateDeviceFromUi();
QPointer<GdbServerProviderChooser> m_gdbServerProviderChooser;
GdbServerProviderChooser *m_gdbServerProviderChooser;
};
} // namespace Internal
......
......@@ -59,7 +59,7 @@ BareMetalDeviceConfigurationWizardSetupPage::BareMetalDeviceConfigurationWizardS
connect(m_nameLineEdit, SIGNAL(textChanged(QString)),
SIGNAL(completeChanged()));
connect(m_gdbServerProviderChooser.data(), &GdbServerProviderChooser::providerChanged,
connect(m_gdbServerProviderChooser, &GdbServerProviderChooser::providerChanged,
this, &QWizardPage::completeChanged);
}
......
......@@ -32,8 +32,6 @@
#ifndef BAREMETALDEVICECONFIGURATIONWIZARDPAGES_H
#define BAREMETALDEVICECONFIGURATIONWIZARDPAGES_H
#include <QPointer>
#include <QWizardPage>
QT_BEGIN_NAMESPACE
......@@ -60,8 +58,8 @@ public:
virtual QString defaultConfigurationName() const;
private:
QPointer<QLineEdit> m_nameLineEdit;
QPointer<GdbServerProviderChooser> m_gdbServerProviderChooser;
QLineEdit *m_nameLineEdit;
GdbServerProviderChooser *m_gdbServerProviderChooser;
};
} // namespace Internal
......
......@@ -190,14 +190,14 @@ DefaultGdbServerProviderConfigWidget::DefaultGdbServerProviderConfigWidget(
setFromProvider();
auto chooser = new Core::VariableChooser(this);
chooser->addSupportedWidget(m_initCommandsTextEdit.data());
chooser->addSupportedWidget(m_resetCommandsTextEdit.data());
chooser->addSupportedWidget(m_initCommandsTextEdit);
chooser->addSupportedWidget(m_resetCommandsTextEdit);
connect(m_hostWidget.data(), &HostWidget::dataChanged,
connect(m_hostWidget, &HostWidget::dataChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_initCommandsTextEdit.data(), &QPlainTextEdit::textChanged,
connect(m_initCommandsTextEdit, &QPlainTextEdit::textChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_resetCommandsTextEdit.data(), &QPlainTextEdit::textChanged,
connect(m_resetCommandsTextEdit, &QPlainTextEdit::textChanged,
this, &GdbServerProviderConfigWidget::dirty);
}
......
......@@ -102,9 +102,9 @@ private:
void setFromProvider();
QPointer<HostWidget> m_hostWidget;
QPointer<QPlainTextEdit> m_initCommandsTextEdit;
QPointer<QPlainTextEdit> m_resetCommandsTextEdit;
HostWidget *m_hostWidget;
QPlainTextEdit *m_initCommandsTextEdit;
QPlainTextEdit *m_resetCommandsTextEdit;
};
} // namespace Internal
......
......@@ -32,7 +32,6 @@
#define GDBSERVERPROVIDER_H
#include <QObject>
#include <QPointer>
#include <QVariantMap>
#include <QWidget>
......@@ -170,15 +169,15 @@ protected:
static QString defaultInitCommandsTooltip();
static QString defaultResetCommandsTooltip();
QPointer<QFormLayout> m_mainLayout;
QPointer<QLineEdit> m_nameLineEdit;
QPointer<QComboBox> m_startupModeComboBox;
QFormLayout *m_mainLayout;
QLineEdit *m_nameLineEdit;
QComboBox *m_startupModeComboBox;
private:
void setFromProvider();
GdbServerProvider *m_provider;
QPointer<QLabel> m_errorLabel;
QLabel *m_errorLabel = 0;
};
class HostWidget : public QWidget
......@@ -197,8 +196,8 @@ signals:
void dataChanged();
private:
QPointer<QLineEdit> m_hostLineEdit;
QPointer<QSpinBox> m_portSpinBox;
QLineEdit *m_hostLineEdit;
QSpinBox *m_portSpinBox;
};
} // namespace Internal
......
......@@ -60,9 +60,9 @@ GdbServerProviderChooser::GdbServerProviderChooser(
layout->addWidget(m_manageButton);
setFocusProxy(m_manageButton);
connect(m_chooser.data(), static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
connect(m_chooser, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &GdbServerProviderChooser::currentIndexChanged);
connect(m_manageButton.data(), &QAbstractButton::clicked,
connect(m_manageButton, &QAbstractButton::clicked,
this, &GdbServerProviderChooser::manageButtonClicked);
connect(GdbServerProviderManager::instance(), &GdbServerProviderManager::providersChanged,
this, &GdbServerProviderChooser::populate);
......
......@@ -31,8 +31,6 @@
#ifndef GDBSERVERPROVIDERCHOOSER_H
#define GDBSERVERPROVIDERCHOOSER_H
#include <QPointer>
#include <QWidget>
QT_BEGIN_NAMESPACE
......@@ -73,8 +71,8 @@ protected:
QString providerText(const GdbServerProvider *) const;
private:
QPointer<QComboBox> m_chooser;
QPointer<QPushButton> m_manageButton;
QComboBox *m_chooser;
QPushButton *m_manageButton;
};
} // namespace Internal
......
......@@ -441,9 +441,10 @@ void GdbServerProvidersSettingsPage::finish()
{
if (m_configWidget)
disconnect(GdbServerProviderManager::instance(), &GdbServerProviderManager::providersChanged,
m_configWidget.data(), &GdbServerProvidersSettingsWidget::providerSelectionChanged);
m_configWidget, &GdbServerProvidersSettingsWidget::providerSelectionChanged);
delete m_configWidget.data();
delete m_configWidget;
m_configWidget = 0;
}
} // namespace Internal
......
......@@ -35,8 +35,6 @@
#include <utils/treemodel.h>
#include <QPointer>
QT_BEGIN_NAMESPACE
class QItemSelectionModel;
class QPushButton;
......@@ -97,7 +95,7 @@ private:
void apply();
void finish();
QPointer<GdbServerProvidersSettingsWidget> m_configWidget;
GdbServerProvidersSettingsWidget *m_configWidget = 0;
};
} // namespace Internal
......
......@@ -291,25 +291,25 @@ OpenOcdGdbServerProviderConfigWidget::OpenOcdGdbServerProviderConfigWidget(
setFromProvider();
auto chooser = new Core::VariableChooser(this);
chooser->addSupportedWidget(m_initCommandsTextEdit.data());
chooser->addSupportedWidget(m_resetCommandsTextEdit.data());
chooser->addSupportedWidget(m_initCommandsTextEdit);
chooser->addSupportedWidget(m_resetCommandsTextEdit);
connect(m_hostWidget.data(), &HostWidget::dataChanged,
connect(m_hostWidget, &HostWidget::dataChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_executableFileChooser.data(), &Utils::PathChooser::rawPathChanged,
connect(m_executableFileChooser, &Utils::PathChooser::rawPathChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_rootScriptsDirChooser.data(), &Utils::PathChooser::rawPathChanged,
connect(m_rootScriptsDirChooser, &Utils::PathChooser::rawPathChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_configurationFileChooser.data(), &Utils::PathChooser::rawPathChanged,
connect(m_configurationFileChooser, &Utils::PathChooser::rawPathChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_additionalArgumentsLineEdit.data(), &QLineEdit::textChanged,
connect(m_additionalArgumentsLineEdit, &QLineEdit::textChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_initCommandsTextEdit.data(), &QPlainTextEdit::textChanged,
connect(m_initCommandsTextEdit, &QPlainTextEdit::textChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_resetCommandsTextEdit.data(), &QPlainTextEdit::textChanged,
connect(m_resetCommandsTextEdit, &QPlainTextEdit::textChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_startupModeComboBox.data(), static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
connect(m_startupModeComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &OpenOcdGdbServerProviderConfigWidget::startupModeChanged);
}
......
......@@ -110,13 +110,13 @@ private:
void setFromProvider();
QPointer<HostWidget> m_hostWidget;
QPointer<Utils::PathChooser> m_executableFileChooser;
QPointer<Utils::PathChooser> m_rootScriptsDirChooser;
QPointer<Utils::PathChooser> m_configurationFileChooser;
QPointer<QLineEdit> m_additionalArgumentsLineEdit;
QPointer<QPlainTextEdit> m_initCommandsTextEdit;
QPointer<QPlainTextEdit> m_resetCommandsTextEdit;
HostWidget *m_hostWidget;
Utils::PathChooser *m_executableFileChooser;
Utils::PathChooser *m_rootScriptsDirChooser;
Utils::PathChooser *m_configurationFileChooser;
QLineEdit *m_additionalArgumentsLineEdit;
QPlainTextEdit *m_initCommandsTextEdit;
QPlainTextEdit *m_resetCommandsTextEdit;
};
} // namespace Internal
......
......@@ -289,31 +289,31 @@ StLinkUtilGdbServerProviderConfigWidget::StLinkUtilGdbServerProviderConfigWidget
setFromProvider();
auto chooser = new Core::VariableChooser(this);
chooser->addSupportedWidget(m_initCommandsTextEdit.data());
chooser->addSupportedWidget(m_resetCommandsTextEdit.data());
chooser->addSupportedWidget(m_initCommandsTextEdit);
chooser->addSupportedWidget(m_resetCommandsTextEdit);
connect(m_hostWidget.data(), &HostWidget::dataChanged,
connect(m_hostWidget, &HostWidget::dataChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_executableFileChooser.data(), &Utils::PathChooser::rawPathChanged,
connect(m_executableFileChooser, &Utils::PathChooser::rawPathChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_verboseLevelSpinBox.data(),
connect(m_verboseLevelSpinBox,
static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &GdbServerProviderConfigWidget::dirty);
connect(m_extendedModeCheckBox.data(), &QAbstractButton::clicked,
connect(m_extendedModeCheckBox, &QAbstractButton::clicked,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_resetBoardCheckBox.data(), &QAbstractButton::clicked,
connect(m_resetBoardCheckBox, &QAbstractButton::clicked,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_transportLayerComboBox.data(),
connect(m_transportLayerComboBox,
static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &GdbServerProviderConfigWidget::dirty);
connect(m_initCommandsTextEdit.data(), &QPlainTextEdit::textChanged,
connect(m_initCommandsTextEdit, &QPlainTextEdit::textChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_resetCommandsTextEdit.data(), &QPlainTextEdit::textChanged,
connect(m_resetCommandsTextEdit, &QPlainTextEdit::textChanged,
this, &GdbServerProviderConfigWidget::dirty);
connect(m_startupModeComboBox.data(),
connect(m_startupModeComboBox,
static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &StLinkUtilGdbServerProviderConfigWidget::startupModeChanged);
}
......
......@@ -121,14 +121,14 @@ private:
void populateTransportLayers();
void setFromProvider();
QPointer<HostWidget> m_hostWidget;
QPointer<Utils::PathChooser> m_executableFileChooser;
QPointer<QSpinBox> m_verboseLevelSpinBox;
QPointer<QCheckBox> m_extendedModeCheckBox;
QPointer<QCheckBox> m_resetBoardCheckBox;
QPointer<QComboBox> m_transportLayerComboBox;
QPointer<QPlainTextEdit> m_initCommandsTextEdit;
QPointer<QPlainTextEdit> m_resetCommandsTextEdit;
HostWidget *m_hostWidget;
Utils::PathChooser *m_executableFileChooser;
QSpinBox *m_verboseLevelSpinBox;
QCheckBox *m_extendedModeCheckBox;
QCheckBox *m_resetBoardCheckBox;
QComboBox *m_transportLayerComboBox;
QPlainTextEdit *m_initCommandsTextEdit;
QPlainTextEdit *m_resetCommandsTextEdit;
};
} // namespace Internal
......
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