forked from qt-creator/qt-creator
CodePaster: Avoid use of global object pool
Change-Id: Ib81694d9dd3e8d040adc9ca12e9296e5cceb8208 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -116,8 +116,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
|
||||
// Create the settings Page
|
||||
m_settings->fromSettings(ICore::settings());
|
||||
SettingsPage *settingsPage = new SettingsPage(m_settings);
|
||||
addAutoReleasedObject(settingsPage);
|
||||
SettingsPage *settingsPage = new SettingsPage(m_settings, this);
|
||||
|
||||
// Create the protocols and append them to the Settings
|
||||
Protocol *protos[] = {new PasteBinDotComProtocol,
|
||||
@@ -130,8 +129,6 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
connect(protos[i], &Protocol::pasteDone, this, &CodepasterPlugin::finishPost);
|
||||
connect(protos[i], &Protocol::fetchDone, this, &CodepasterPlugin::finishFetch);
|
||||
settingsPage->addProtocol(protos[i]->name());
|
||||
if (protos[i]->hasSettings())
|
||||
addAutoReleasedObject(protos[i]->settingsPage());
|
||||
m_protocols.append(protos[i]);
|
||||
}
|
||||
|
||||
@@ -167,7 +164,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
connect(m_fetchUrlAction, &QAction::triggered, this, &CodepasterPlugin::fetchUrl);
|
||||
cpContainer->addAction(command);
|
||||
|
||||
addAutoReleasedObject(new CodePasterServiceImpl);
|
||||
new CodePasterServiceImpl(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user