summaryrefslogtreecommitdiff
path: root/src/plugins/perforce
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2018-02-02 10:08:21 +0100
committerhjk <hjk@qt.io>2018-02-06 11:58:15 +0000
commit713b8636ea740502597b79b1a74382d1b3a70ab6 (patch)
treea1ece14ba7f98d1fa2ce01e4880c707dc5a74082 /src/plugins/perforce
parente7792f8f50b21889f727884ab8b94cb87f38169e (diff)
downloadqt-creator-713b8636ea740502597b79b1a74382d1b3a70ab6.tar.gz
Vcs/Text search: Remove a few addAutoReleaseObject uses
Using a QObject parent suffices here. Change-Id: I4dc5448511d55bf14fbd8f810e91336a49e94094 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/perforce')
-rw-r--r--src/plugins/perforce/perforceplugin.cpp11
-rw-r--r--src/plugins/perforce/settingspage.cpp3
-rw-r--r--src/plugins/perforce/settingspage.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index d97e4fc2a8..4a2b46755b 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -189,11 +189,11 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
m_settings.fromSettings(ICore::settings());
- addAutoReleasedObject(new SettingsPage);
+ new SettingsPage(this);
// Editor factories
- addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
- []() { return new PerforceSubmitEditor(&submitParameters); }));
+ new VcsSubmitEditorFactory(&submitParameters,
+ []() { return new PerforceSubmitEditor(&submitParameters); }, this);
const auto describeFunc = [this](const QString &source, const QString &n) {
describe(source, n);
@@ -201,11 +201,10 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
const auto widgetCreator = []() { return new PerforceEditorWidget; };
for (int i = 0; i < editorCount; i++)
- addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
+ new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc, this);
const QString prefix = QLatin1String("p4");
- m_commandLocator = new CommandLocator("Perforce", prefix, prefix);
- addAutoReleasedObject(m_commandLocator);
+ m_commandLocator = new CommandLocator("Perforce", prefix, prefix, this);
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
diff --git a/src/plugins/perforce/settingspage.cpp b/src/plugins/perforce/settingspage.cpp
index 4a9678901c..933ea07b80 100644
--- a/src/plugins/perforce/settingspage.cpp
+++ b/src/plugins/perforce/settingspage.cpp
@@ -117,7 +117,8 @@ void SettingsPageWidget::setStatusError(const QString &t)
m_ui.errorLabel->setText(t);
}
-SettingsPage::SettingsPage()
+SettingsPage::SettingsPage(QObject *parent)
+ : VcsBaseOptionsPage(parent)
{
setId(VcsBase::Constants::VCS_ID_PERFORCE);
setDisplayName(tr("Perforce"));
diff --git a/src/plugins/perforce/settingspage.h b/src/plugins/perforce/settingspage.h
index 4fb6dc903b..db8fdad75f 100644
--- a/src/plugins/perforce/settingspage.h
+++ b/src/plugins/perforce/settingspage.h
@@ -64,7 +64,7 @@ class SettingsPage : public VcsBase::VcsBaseOptionsPage
Q_OBJECT
public:
- SettingsPage();
+ explicit SettingsPage(QObject *parent);
~SettingsPage() override;
QWidget *widget() override;