Vcs/Text search: Remove a few addAutoReleaseObject uses

Using a QObject parent suffices here.

Change-Id: I4dc5448511d55bf14fbd8f810e91336a49e94094
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2018-02-02 10:08:21 +01:00
parent e7792f8f50
commit 713b8636ea
34 changed files with 80 additions and 79 deletions

View File

@@ -157,7 +157,7 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
auto vcsCtrl = initializeVcs<BazaarControl>(context, m_client);
connect(m_client, &VcsBaseClient::changed, vcsCtrl, &BazaarControl::changed);
addAutoReleasedObject(new OptionsPage(vcsCtrl));
new OptionsPage(vcsCtrl, this);
const auto describeFunc = [this](const QString &source, const QString &id) {
m_client->view(source, id);
@@ -165,14 +165,13 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
const int editorCount = sizeof(editorParameters) / sizeof(VcsBaseEditorParameters);
const auto widgetCreator = []() { return new BazaarEditorWidget; };
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc, this);
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitEditorParameters,
[]() { return new CommitEditor(&submitEditorParameters); }));
(void) new VcsSubmitEditorFactory(&submitEditorParameters,
[]() { return new CommitEditor(&submitEditorParameters); }, this);
const QString prefix = QLatin1String("bzr");
m_commandLocator = new CommandLocator("Bazaar", prefix, prefix);
addAutoReleasedObject(m_commandLocator);
m_commandLocator = new CommandLocator("Bazaar", prefix, prefix, this);
createMenu(context);

View File

@@ -65,8 +65,8 @@ void OptionsPageWidget::setSettings(const VcsBaseClientSettings &s)
m_ui.timeout->setValue(s.intValue(BazaarSettings::timeoutKey));
}
OptionsPage::OptionsPage(Core::IVersionControl *control) :
VcsClientOptionsPage(control, BazaarPlugin::instance()->client())
OptionsPage::OptionsPage(Core::IVersionControl *control, QObject *parent) :
VcsClientOptionsPage(control, BazaarPlugin::instance()->client(), parent)
{
setId(VcsBase::Constants::VCS_ID_BAZAAR);
setDisplayName(tr("Bazaar"));

View File

@@ -54,7 +54,7 @@ class OptionsPage : public VcsBase::VcsClientOptionsPage
Q_OBJECT
public:
OptionsPage(Core::IVersionControl *control);
OptionsPage(Core::IVersionControl *control, QObject *parent);
};
} // namespace Internal