forked from qt-creator/qt-creator
Provide instance()-method for Utils::NetworkAccessManager.
Preemptively fix exit warning "QEventLoop cannot be used without QApplication" (Qt 5/dev) emitted by destruction of the of the generic highlighter manager singleton which had a member of type Utils::NetworkAccessManager. Use a single instance of Utils::NetworkAccessManager for the main thread and clean up properly using a qAddPostRoutine(). Change-Id: Ida57b9028a79eb4927818ce49088ea567f3bdfd6 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -130,11 +130,10 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
addAutoReleasedObject(settingsPage);
|
||||
|
||||
// Create the protocols and append them to the Settings
|
||||
const QSharedPointer<NetworkAccessManagerProxy> networkAccessMgrProxy(new NetworkAccessManagerProxy);
|
||||
Protocol *protos[] = { new PasteBinDotComProtocol(networkAccessMgrProxy),
|
||||
new PasteBinDotCaProtocol(networkAccessMgrProxy),
|
||||
new KdePasteProtocol(networkAccessMgrProxy),
|
||||
new CodePasterProtocol(networkAccessMgrProxy),
|
||||
Protocol *protos[] = { new PasteBinDotComProtocol,
|
||||
new PasteBinDotCaProtocol,
|
||||
new KdePasteProtocol,
|
||||
new CodePasterProtocol,
|
||||
new FileShareProtocol
|
||||
};
|
||||
const int count = sizeof(protos) / sizeof(Protocol *);
|
||||
@@ -148,7 +147,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
m_protocols.append(protos[i]);
|
||||
}
|
||||
|
||||
m_urlOpen = new UrlOpenProtocol(networkAccessMgrProxy);
|
||||
m_urlOpen = new UrlOpenProtocol;
|
||||
connect(m_urlOpen, SIGNAL(fetchDone(QString,QString,bool)),
|
||||
this, SLOT(finishFetch(QString,QString,bool)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user